Using a Watchdog timer




 Using a Watchdog timer

Description: A watchdog timer is a hardware timer that automatically generates a system reset if the main program neglects to periodically service it.

It is often used to automatically reset an embedded device that hangs because of a software or hardware fault.
The main program typically has a loop that it constantly goes through performing various functions.
The watchdog timer is loaded with an initial value greater than the worst case time delay through the main program loop .

Each time it goes through the main loop the code resets the watchdog timer .
If a fault occurs and the main program does not get back to reset the timer before it counts down, an interrupt is generated to reset the processor.
The watchdog timer can detect a fault on an unattended embedded device and attempt corrective action with a reset.

A watchdog timer can get a system out of a lot of dangerous situations.

Comments