Watchdog

A watchdog timer counts down from a preset value. The running firmware must periodically write a special key to restart the countdown. If the firmware crashes, freezes, or enters an infinite loop, the countdown reaches zero and the watchdog asserts a hardware reset, restarting the system.

A free-running counter decrements toward zero on each oscillator tick. Writing the correct unlock sequence to the service register reloads the counter to its preset value. The oscillator is intentionally independent of the system clock (often a dedicated RC oscillator) so a clock failure also triggers the timeout.

In plain terms

A dead-man's switch: firmware must kick it at regular intervals to prove it's alive; if it misses one kick, the watchdog assumes the code is hung and pulls the reset line.

Why designers use it

Best for

Key specifications

When not to use it

Common mistakes

Where you will find it

A short history

A watchdog expects the processor to service it within a defined interval. If that activity stops, the watchdog can assert a reset or fault output. This helps a system recover from some software hangs, especially in unattended equipment, but a watchdog cannot detect every possible software fault.

Good to know

Related