TC1796
System Units (Vol. 1 of 2)
Watchdog Timer
User’s Manual
16-18
V2.0, 2007-07
WDT, V2.0
The purpose of the Double Watchdog Error feature is to avoid loops such as: Reset -
software does not start correctly - prewarning - watchdog reset - software does not start
correctly - …
The WDT has an internal counter that generates a constant reset after a second
watchdog error. This counter can be cleared only by external reset sources (power-on
reset or hardware reset).
16.4.7
Determining WDT Periods
The WDT uses the system clock,
f
SYS
. A clock divider in front of the WDT provides two
output frequencies,
f
SYS
/256 and
f
SYS
/16384. Bit WDT_SR.WDTIS selects between
these options.
When the WDT is in Normal Mode, the duration of a WDT cycle is defined as a Normal
Period, as described on
When the WDT is in Time-Out Mode or Prewarning Mode, the duration of a WDT cycle
is defined as a Time-out Period, as described in the next section.
The general formula to calculate a Watchdog period is:
(16.1)
The parameter startvalue represents the fixed value FFFC
H
for the calculation of the
Time-out Period, and the user-programmable reload value WDTREL for the calculation
of the Normal Period. Note that the exponent (1 - WDTIS)
×
6 results to 0 if WDTIS is 1,
and to 6 if WDTIS is 0. This results in the value 256 being multiplied by either 1 (2
0
= 1)
or by 64 (2
6
), giving the two divider factors 256 and 16384.
Note: Because there is no synchronization of the clock divider to the mode transitions of
the Watchdog, the next clock pulse, incrementing the counter, may come after one
clock divider period, or immediately after the counter was reloaded. Thus, it is
recommended that the reload value is programmed to a value that results in one
clock pulse more than the required period.
16.4.7.1 Time-out Period
The duration of Time-Out Mode and Prewarning Mode is determined by the Time-out
Period described here. The Time-out Period that occurs immediately after reset is
governed entirely by system defaults, as no software is able to run at this point; it is
described separately below.
period
2
16
startvalue
–
(
)
256 2
1 WDTIS
–
(
)
6
×
×
×
f
SYS
----------------------------------------------------------------------------------------------------------
=