ABC of Electronics cosycom.com
EMBEDDED SYSTEMS & MICROCONTROLLERS · PAGE 16

Watchdog Timer and Sleep Modes

Recover from hangs and sip power.

A watchdog is a timer that resets the chip unless firmware clears it regularly. If the program freezes, the clear never happens and the reset restores operation.

Sleep modes stop the CPU and unused peripherals to save current. A battery sensor node may sleep nearly all the time and wake on a timer or pin interrupt.

Clear the watchdog only from healthy code paths, not from inside an interrupt that keeps running while the main loop is stuck.