3 ms·
> Actually I think a watchdog timer doesn't watch anything except it's timer. That's exactly how they work. A watchdog is a just a timer with a reset input and
by MisterTea 7y ago
> Actually I think a watchdog timer doesn't watch anything except it's timer.
That's exactly how they work. A watchdog is a just a timer with a reset input and expired output, and perhaps a register for the timer period.
A practical example would a be a watchdog that ensures a control loop is in fact running, if not, reset the CPU. Let's say our control loop has a cycle never longer than 10ms. So we set the watchdog timer to 10ms. You wire the watchdog expired output to the reset pin of your CPU and put a line of code at the end of your control loop that sends a reset signal to the watchdog on each loop. If the program halts, the watchdog is allowed to expire firing the reset signal which will hopefully bring the system back without intervention.
Seen an old JK laser with a two stage hardware watchdog. The engineer who worked on it said the first stage was tied to the NMI pin of the 6809 CPU which resets the control software to a safe state. If that failed, the second stage timed out which meant that something was really wrong (cpu/memory fault) and would shut the machine down.