47
ATmega165A/PA/325A/PA/3250A/PA/645A/P/6450A/P [DATASHEET]
8285E–AVR–02/2013
11.4
Watchdog Timer
The Watchdog Timer is clocked from a separate On-chip Oscillator which runs at 1MHz. This is the typical value at
V
CC = 5V. See characterization data for typical values at other VCC levels. By controlling the Watchdog Timer pres-
Reset – instruction resets the Watchdog Timer. The Watchdog Timer is also reset when it is disabled and when a
Chip Reset occurs. Eight different clock cycle periods can be selected to determine the reset period. If the reset
period expires without another Watchdog Reset, the Atmel
ATmega165A/165PA/325A/325PA/3250A/3250PA/645A/645P/6450A/6450P resets and executes from the Reset
To prevent unintentional disabling of the Watchdog or unintentional change of time-out period, two different safety
Figure 11-7. Watchdog Timer.
11.4.1
Timed Sequences for Changing the Configuration of the Watchdog Timer
The sequence for changing configuration differs slightly between the two safety levels. Separate procedures are
described for each level.
11.4.1.1
Safety Level 1
In this mode, the Watchdog Timer is initially disabled, but can be enabled by writing the WDE bit to 1 without any
restriction. A timed sequence is needed when changing the Watchdog Time-out period or disabling an enabled
Watchdog Timer. To disable an enabled Watchdog Timer, and/or changing the Watchdog Time-out, the following
procedure must be followed:
1.
In the same operation, write a logic one to WDCE and WDE. A logic one must be written to WDE regardless
of the previous value of the WDE bit.
2.
Within the next four clock cycles, in the same operation, write the WDE and WDP bits as desired, but with
the WDCE bit cleared.
Table 11-1.
WDT Configuration as a Function of the Fuse Settings of WDTON
WDTON
Safety level
WDT initial state
How to disable the WDT
How to change time-out
Unprogrammed
1
Disabled
Timed sequence
Programmed
2
Enabled
Always enabled
Timed sequence
WATCHDOG
OSCILLATOR