Position: Index > Unclassified >

Why use watchdog variable timer

2017-12-21 05:19  
Declaration:We aim to transmit more information by carrying articles . We will delete it soon, if we are involved in the problems of article content ,copyright or other problems.

Most of embedded microcontrollers contain watchdog timer. Watchdog variable timer is literally a a€?watchdoga€?. Watchdog timer continuously inspects the program float. Basically if microcontroller program hangs, then watchdog timer resets it and brings embedded system back to life.

The idea is very simple. Lets say, you know, that your program has to be executed during 20ms. And you know that worst case scenario is 30ms. Then you set watchdog variable timer connected to highest priority interrupt a€“ RESET. Once Watchdog timer is triggered, timer counts up to time you set and then it resets the MCU. The only way to avoid reseting is to send command to watchdog timer to start counting over. Technically watchdog variable timer is nothing more that retriggerable one shot multivibrator.

The use of watchdog timer may be various. The one mentioned above is like a program execution loop. Once all procedures are performed, the MCU resets and starts over. Another more valuable and mostly used is for system reset if code failure occur. You may set some flags indicating was procedure successful or not. If not, than you can fire watchdog timer to restart MCU and start over.

wdt.PNG

The only problem with watchdog timer is that it runs independently of the res of the system. It makes problems with debugging because you may suspend system while debugging and then watchdog timer runs out and resets embedded system. But you can always enable or disable the watchdog timer. It is internal it can be done in software, if watchdog timer is external, than the easiest way to do this to put a jumper that breaks the connection between watchdog timer and reset circuit.

Watchdog timer plays important part in RTOS systems. Usually the main task (high priority task) checks the sanity of program float. And if check fails the watchdog timer is triggered to reset the MCU.


Reprinted Url Of This Article:
http://www.scienceprog.com/why-use-watchdog-variable-timer/