19.2 Overview
The Watchdog Timer (WDT) is a system function for monitoring correct program
operation. It allows the system to recover from situations such as runaway or deadlocked
code by issuing a Reset. When enabled, the WDT is a constantly running timer configured to
a predefined time-out period. If the WDT is not reset within the time-out period, it will
issue a system Reset. The WDT is reset by executing the Watchdog Timer Reset
(WDR
) instruction from software.
The WDT has two modes of operation: Normal mode and Window mode. The settings in the Control A (WDT.CTRLA) register determine the mode of operation.
A Window mode defines a time slot or "window" inside the time-out period
during which the WDT must be reset. If the WDT is reset outside this window, either too
early or too late, a system Reset will be issued. Compared to the Normal mode, the Window
mode can catch situations where a code error causes constant WDR
execution.
When enabled, the WDT will run in Active mode and all sleep modes. It is asynchronous (i.e., running from a CPU independent clock source). For this reason, it will continue to operate and be able to issue a system Reset even if the main clock fails.
The CCP mechanism ensures that the WDT settings cannot be changed by accident. For increased safety, a configuration for locking the WDT settings is available.