20.6.1 Principle of Operation
The Watchdog Timer (WDT) is a system for monitoring correct program operation, making it possible to recover from error situations such as runaway code, by issuing a Reset. When enabled, the WDT is a constantly running timer that is configured to a predefined time-out period. Before the end of the time-out period, the WDT should be set back, or else, a system Reset is issued.
The WDT has two modes of operation, Normal mode and Window mode. Both modes offer the option of Early Warning interrupt generation. The description for each of the basic modes is given below. The settings in the Control A register (CTRLA) and the Interrupt Enable register (handled by INTENCLR/INTENSET) determine the mode of operation:
CTRLA.ENABLE | CTRLA.WEN | Interrupt Enable | Mode |
---|---|---|---|
0 | x | x | Stopped |
1 | 0 | 0 | Normal mode |
1 | 0 | 1 | Normal mode with Early Warning interrupt |
1 | 1 | 0 | Window mode |
1 | 1 | 1 | Window mode with Early Warning interrupt |