74
4958B–AUTO–11/10
Atmel ATA6285/ATA6286 [Preliminary]
The Timer0 can also be used as a watchdog timer to prevent a system from stalling. The watch-
dog divider is a 3-bit counter that is supplied by a separate output clock (CLK
WD) of Timer0. It
generates a system reset when the 3-bit counter overflows. To avoid this, the 3-bit counter must
be reset before it overflows. The application software has to accomplish this by executing the
WDR
Watchdog Reset
instruction to restart the Watchdog Counter before the time-out value
is reached. The Watchdog Counter 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 Reset, the ATA6289 resets and executes from the reset
vector. By controlling the Watchdog Timer0 prescaler, the Watchdog Reset interval can be
control register WDTCR.
To prevent unintentional disabling of the Watchdog or unintentional change of time-out period,
two different safety levels are selected by the fuse WDTON as shown in
Table 3-30.3.13.3.1
Watchdog Timer0 Control Register
Bits 7..5 - Res: Reserved Bits
These bits are reserved bits at the ATA6289 and will always read as zero.
Bit 4 - WDCE: WatchDog Change Enable Bit
This bit must be set when the WDE bit is written to logic zero. Otherwise, the Watchdog will not
be disabled. Once written to one, hardware will clear this bit after four clock cycles. Refer to
description of the WDE bit for a Watchdog disable procedure. This bit must also be set when
changing the watchdog prescaler bits, refer to
Table 3-30Bit 3 - WDE: WatchDog Enable Bit
When the WDE bit is written to logic one, the Watchdog Timer is enabled, and if the WDE bit is
written to logic zero, the Watchdog Timer function is disabled. WDE can only be cleared if the
WDCE bit has logic level one. To further ensure program security the Watchdog set-up must fol-
low a special timed sequence. To disable the Watchdog Timer by clearing the WDE bit following
procedure must be executed:
1.
In one operation, write a logic one to WDCE and WDE. A logic one must be written to
WDE even though it is set to one before the disable operation starts.
2.
Within the next four clock cycles, write logic 0 to WDE. The Watchdog will be disabled.
Table 3-30.
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
Bit
76
543
210
-
WDCE
WDE
WDPS2
WDPS1
WDPS0 WDTCR
Read/Write
R
R/W
Initial Value
00
000