![Atmel AVR132 Скачать руководство пользователя страница 6](http://html1.mh-extra.com/html/atmel/avr132/avr132_application-note_3003535006.webp)
6
AVR 132 Application Note
2551A–AVR–11/03
Using the WDT Interrupt
Mode
As described above, the WDT has its own internal oscillator running independently from
the main CPU clock. This makes it possible to use the WDT Interrupt as a wakeup
source from all sleep modes. By enabling only the WDT Interrupt Mode, a timeout will
generate an interrupt request, but not cause any system resets on further timeouts.
Having a wakeup source without running the main CPU clock is an excellent way of sav-
ing power. Using power-down sleep mode with the WDT as a wakeup source draws
approx 3mA when running at 3V supply voltage. An example on how to use the WDT as
a wakeup source is shown in Figure 4.
Figure 4. Using the WDT as a Wakeup Timer
If periodic wakeups are preferred, the disabling of the WDT Interrupt Mode can be left
out. The WDT will then generate an interrupt on every timeout, waking up the CPU if it is
in sleep mode.
Note that the WDT System Reset Mode must not be enabled when using the WDT
solely as a wakeup timer. If it is enabled, a system reset will occur on the next timeout.
Using the WDT both as a wakeup timer and system reset source is described in the fol-
lowing section.
Ready to sleep
Enable sleep mode if
not already enabled
Enable interrupts if not
already enabled
Enable WDT Interrupt
Mode
SLEEP
WDT timeout wakeup
Disable WDT Interrupt
Mode
Continue
Set WDT timeout
period