Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.
when designing embedded SW it is important to assure that the CPU will not be locked by a task that doesn't end (e.g. the SW has entered a infinite loop because of a bug not detected before).
To prevent these stalling conditions some MCU are equipped with internal watchdog (WD) circuitry. Basically it is a dedicated timer circuit, controlled by the status of the bit on a set of internal CPU registers: once the timer has been started, if the write of a particular code in the registers is not detected before the counter expires the CPU is automatically reset. The write of the refresh code restart the timer and re-arms the WD for the next period.
In this way the system has the capability to self-recover from unforeseen and non recurrent hang-up conditions (just think at the times you pressed the ctrl-alt-canc sequence with Windows ;-) ). Otherwise you should have to switch off/on the device but this is not always possible!
For OS I think that the concept is the same, but instead of dedicated circuitry you have a dedicated task running at lowest priority, which periodically resets the WD timer when the higher priority processes release the control to it.
If a process hang-up for any reason, the WD task will not be scheduled causing the WD timer to expire and an error condition will be raised to the OS.
watchdog timer is a timer which watches i mean it reads the status of the microcontroller by sending one type of signal .if the microcontroller gets hang-up it will restart the controller.
A watch dog timer is -as the name suggests- a timer. It’s a special timer that should be refreshed (reset) periodically by the programmer and if it is not refreshed within a certain period it reset the Micro controller. The main idea is, if your program is running ok then it will refresh the watch dog timer in time but in case your program is not running well for example ….. it hang-up then your program will fail to refresh the watch dog timer and the micro controller will be reset.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.