Electronic – watchdog timer operation

armmicrocontroller

I have read that watchdog timer pushes microprocessor/controller into reset state whenever it experiences any software anomaly like executing in infinite loop.
and after some time a very senior prof told us that after reset the processor resumes operation from the next instruction to the erroneous one.

when watchdog timer resets the processor, from where does the processor start its next execution?

I just wanted to know what is correct or if some other concept is employed?

Best Answer

It is really down to the designer of the microcontroller. But, in general, a watchdog forces a reset of the processor and typically starts the program from the beginning. It is not always that way though, and the watchdog can also often be used to trigger an interrupt, in which case yes the ISR would return to where it was interrupted with the next instruction to execute.

For instance, a common way to force a software reboot of a chip that doesn't have a reset instruction is to enable the watchdog, then go into a "while(1)" loop, so the watchdog reboots the chip.

The watchdog's interrupt facility is often also used for waking up a microcontroller that has been put to sleep, as most will tick away with their own oscillator. This means the main oscillator can be shut down to conserve power, and the watchdog can then trigger an interrupt that wakes the chip up again.