10. Watchdog Timer
page 75
8
2
3
f
o
5
0
2
,
5
1
.
r
a
M
0
.
1
.
v
e
R
0
1
0
-
2
0
2
0
B
9
0
J
E
R
)
T
6
2
/
C
6
1
M
,
A
6
2
/
C
6
1
M
(
p
u
o
r
G
A
6
2
/
C
6
1
M
10.1 Count source protective mode
In this mode, a on-chip oscillator clock is used for the watchdog timer count source. The watchdog timer
can be kept being clocked even when CPU clock stops as a result of run-away.
Before this mode can be used, the following register settings are required:
(1) Set the PRC1 bit in the PRCR register to “1” (enable writes to PM1 and PM2 registers).
(2) Set the PM12 bit in the PM1 register to “1” (reset when the watchdog timer underflows).
(3) Set the PM22 bit in the PM2 register to “1” (on-chip oscillator clock used for the watchdog timer count
source).
(4) Set the PRC1 bit in the PRCR register to “0” (disable writes to PM1 and PM2 registers).
(5) Write to the WDTS register (watchdog timer starts counting).
Setting the PM22 bit to “1” results in the following conditions
The on-chip oscillator starts oscillating, and the in-chip oscillator clock becomes the watchdog timer count
source.
The CM10 bit in the CM1 register is disabled against write. (Writing a “1” has no effect, nor is stop mode
entered.)
The watchdog timer does not stop when in wait mode.
Figure 10.2 WDC Register and WDTS Register
Watchdog timer start register (Note)
Symbol
Address
After reset
WDTS
000E16
Indeterminate
WO
b7
b0
Function
The watchdog timer is initialized and starts counting after a write instruction to
this register. The watchdog timer value is always initialized to “7FFF16”
regardless of whatever value is written.
RW
Note : Write to the WDTS register after the watchdog timer interrupt occurs.
Watchdog timer control register
Symbol
Address
After reset
WDC
000F16
00XXXXXX2(Note 2)
Function
Bit symbol
RW
b7
b6
b5
b4
b3
b2
b1
b0
High-order bit of watchdog timer
WDC7
Bit name
Prescaler select bit
0 : Divided by 16
1 : Divided by 128
Reserved bit
Must set to “0”
0
RO
RW
Cold start / warm start
discrimination flag (Note 1,2,3)
0 : Cold start
1 : Warm start
WDC5
Note 1: Writing to the WDC register causes the WDC5 bit to be set to “1” (warm start).
Note 3: Do not use in M16C/26T.
(b4-b0)
(b6)
Watchdog timer period =
Watchdog timer count (32768)
on-chip oscillator clock