XC2200 Derivatives
System Units (Vol. 1 of 2)
System Control Unit (SCU)
User’s Manual
6-211
V2.1, 2008-08
SCU, V1.13
6.11.3
Functional Description
The following part describes all functions of the WDT.
6.11.3.1 Timer Operation
The timer is enabled when instruction ENWDT (Enable Watchdog Timer) is executed
correctly.
The WDT uses the input clock
f
IN
which is equal to the system clock
f
sys
. A clock divider
in front of the WDT timer provides two output frequencies,
f
IN
/ 256 and
f
IN
/ 16384. The
selection of the counting rate is done via bit
.IR.
WDT Periods
The general formula to calculate a Watchdog period is:
(6.4)
The parameter <startvalue> represents either the user-programmable reload value
WDTREL.RELV (default value FFFC
H
) for the calculation of the period in Normal Mode
or the fixed value FFFF
H
for the calculation of the period in Prewarning Mode.
WDT Timer Reload
The counter is reloaded and the prescaler is cleared when one of the following conditions
occurs:
•
A successful access to register WDTREL
•
The WDT is serviced via instruction SRVWDT
•
A WDT overflow condition (Prewarning Mode is entered).
The different reload value for the counter in Prewarning Mode is FFFF
H
.
•
The Disable Mode is entered (when instruction DISWDT is executed)
•
Upon any reset
6.11.3.2 Timer Modes
The Watchdog Timer provides following modes:
•
Normal Mode
•
Disable Mode
•
Prewarning Mode
provides a state diagram of the different Timer Modes and the transition
possibilities. Please refer to the description of the conditions for changing from one mode
to the other.
period
2
16
startvalue
–
⎝
⎠
⎛
⎞
256 2
1 IR
–
(
)
6
⋅
⋅
⋅
f
IN
-----------------------------------------------------------------------------------------------------------------------------------
=