Watchdog Timer

Computer Engineering

How It Works

A watchdog timer is an autonomous hardware safety supervisor designed to detect and rescue microcontrollers from firmware lockups, deadlocks, and execution faults. Clocked by an independent on-chip oscillator, the timer decrements continually from a programmed reload value. Firmware must periodically execute a service instruction ('kicking the dog') before the counter underflows; if a software hang stalls servicing, the timer reaches zero and drives an unmaskable hardware system restart.

Governing Equation
$$ T_{\text{timeout}} = \frac{\text{Prescaler} \cdot \text{Counter}_{\text{reload}}}{f_{\text{WD\_osc}}} $$