ST7MC1xx/ST7MC2xx
10 ON-CHIP PERIPHERALS
10.1 WINDOW WATCHDOG (WWDG)
10.1.1 Introduction
The Window Watchdog is used to detect the oc-
currence of a software fault, usually generated by
external interference or by unforeseen logical con-
ditions, which causes the application program to
abandon its normal sequence. The Watchdog cir-
cuit generates an MCU reset on expiry of a pro-
grammed time period, unless the program refresh-
es the contents of the downcounter before the T6
bit becomes cleared. An MCU reset is also gener-
ated if the 7-bit downcounter value (in the control
register) is refreshed before the downcounter has
reached the window register value. This implies
that the counter must be refreshed in a limited win-
dow.
10.1.2 Main Features
■ Programmable free-running downcounter
■ Conditional reset
– Reset (if watchdog activated) when the down-
counter value becomes less than 40h
– Reset (if watchdog activated) if the downcoun-
ter is reloaded outside the window (see Figure
37)
■ Hardware/Software Watchdog activation
(selectable by option byte)
■ Optional reset on HALT instruction
(configurable by option byte)
10.1.3 Functional Description
The counter value stored in the WDGCR register
(bits T[6:0]), is decremented every 16384 fOSC2
cycles (approx.), and the length of the timeout pe-
riod can be programmed by the user in 64 incre-
ments.
If the watchdog is activated (the WDGA bit is set)
and when the 7-bit downcounter (T[6:0] bits) rolls
over from 40h to 3Fh (T6 becomes cleared), it ini-
tiates a reset cycle pulling low the reset pin for typ-
ically 30μs. If the software reloads the counter
while the counter is greater than the value stored
in the window register, then a reset is generated.
Figure 34. Watchdog Block Diagram
RESET
WATCHDOG WINDOW REGISTER (WDGWR)
-
W6 W5 W4 W3 W2 W1 W0
comparator
= 1 when
T6:0 > W6:0 CMP
Write WDGCR
WATCHDOG CONTROL REGISTER (WDGCR)
WDGA T6 T5 T4 T3 T2 T1 T0
MCC/RTC
6-BIT DOWNCOUNTER (CNT)
fOSC2
DIV 64
12-BIT MCC
RTC COUNTER
MSB
LSB
11
65
0
TB[1:0] bits
(MCCSR
Register)
WDG PRESCALER
DIV 4
60/309
1