20.4.3.1 Early Warning
The early warning feature notifies with an interrupt that the WDT is approaching its time-out condition and behaves differently in Normal mode and in Window mode.
In Normal mode, the early warning interrupt generation is defined by the Early Warning Offset bits in the Early Warning Control register (EWCTRL.EWOFFSET). The Early Warning Offset bits define the number of CLK_WDT_OSC clocks before the interrupt is generated, relative to the start of the WDT time-out period.
The user must take caution when programming the Early Warning Offset bits. If these bits define an early warning interrupt generation time greater than the WDT time-out period, the WDT time-out system Reset is generated prior to the early warning interrupt. Consequently, the early warning interrupt will never be generated.
In Window mode, the early warning interrupt is generated at the start of the open window period. In a typical application where the system is in sleep mode, the early warning interrupt can be used to wake up and clear the WDT, after which the system can perform other tasks or return to the sleep mode.
Example:
If the WDT is operating in Normal mode with CONFIG.PER =
0x2 and EWCTRL.EWOFFSET = 0x1, the early warning
interrupt is generated 16 CLK_WDT_OSC clock cycles after the start of the time-out
period. The time-out system Reset is generated 32 CLK_WDT_OSC clock cycles after the
start of the WDT time-out period.
