What is a watchdog and why should we turn it off?

What is a watchdog

Watchdog (watch dog timer watchdog timer). What is a watchdog ? Let’s imagine this scenario: There is a dog at the door of your house. This dog will be hungry at regular intervals (for example, every 2 hours). When the dog is hungry, it will bite people to death. To ensure safety when people come in and out, the dog must be fed in advance (the dog must be fed within 2 hours after the last feeding). If the dog is not fed within the time limit, it will be bitten to death. It doesn’t matter if you feed the dog in advance, but the time for feeding the dog will start from here.
In reality, electronic equipment often runs away or crashes due to some external factors (such as extreme heat, extreme cold, and complex industrial situations). In this case we want the device to reset automatically without manual intervention (unattended). Watchdogs are used to accomplish this job. The watchdog is actually a timer inside our SoC (similar to an alarm clock, similar to a dog at the door). After the time is set, the watchdog timer will count, and it must be reset before the time is up (before the dog gets hungry). Watchdog timer (dog feeding), if the dog is not fed, the system will be forced to reset.
When the system is working normally, the system software will feed the dog by itself, so the watchdog timer will not be reset. But once the system fails or something goes wrong, there will be no one to feed the watchdog, and it will automatically reset in the next cycle to achieve the desired effect.

Why turn off watchdog

In general CPU design, the watchdog is working by default after the CPU is started (why is it not turned off by default but working? I guess it is because you are afraid that your program will crash or run away at the front end of the startup code and no one will care about it). The advantage is that There are no gaps or loopholes. The disadvantage is that the watchdog will be reset when we are inconvenient to feed the dog (or too lazy to feed the dog) when starting the code segment, so in order to be lazy, we turn off the watchdog before starting the code, and then After the system starts up, you can decide whether to turn on the watchdog as needed (once it is turned on, the dog must be fed at the same time)

Zongheng Intelligent Control’s DTU, RTU and other equipment all use dual watchdog devices, which ensures stable online operation and no downtime! If you need to check the detailed functions of the product, you can check it in the product center of this site!

Contatto