deveopmen
Watchdog Timer
Preliminary Specifications REV.B
Specifications in this manual are tentative and subject to change.
Mitsubishi microcomputers
M16C/80 (144-pin version) group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
75
Watchdog Timer
The watchdog timer has the function of detecting when the program is out of control. The watchdog timer is
a 15-bit counter which down-counts the clock derived by dividing the BCLK using the prescaler. Whether a
watchdog timer interrupt is generated or reset is selected when an underflow occurs in the watchdog timer.
Watchdog timer interrupt is selected when bit 6 of the system control register 0 (address 0008
16
:CM06) is
"0" and reset is selected when CM06 is "1". No value other than "1" can be written in CM06. Once when
reset is selected (CM06="1"), watchdog timer interrupt cannot be selected by software.
When X
IN
is selected for the BCLK, bit 7 of the watchdog timer control register (address 000F
16
) selects the
prescaler division ratio (by 16 or by 128). When X
CIN
is selected as the BCLK, the prescaler is set for
division by 2 regardless of bit 7 of the watchdog timer control register (address 000F
16
). Therefore, the
watchdog timer cycle can be calculated as follows. However, errors can arise in the watchdog timer cycle
due to the prescaler.
When X
IN
is selected in BCLK
Watchdog timer cycle =
When X
CIN
is selected in BCLK
Watchdog timer cycle =
For example, when BCLK is 20MHz and the prescaler division ratio is set to 16, the monitor timer cycle is
approximately 26.2 ms.
The watchdog timer is initialized by writing to the watchdog timer start register (address 000E
16
) and when
a watchdog timer interrupt request is generated. The prescaler is initialized only when the microcomputer is
reset. After a reset is cancelled, the watchdog timer and prescaler are both stopped. The count is started by
writing to the watchdog timer start register (address 000E
16
). CM06 is initialized only at reset. After reset,
watchdog timer interrupt is selected.
Figure 1.10.1 shows the block diagram of the watchdog timer. Figure 1.10.2 shows the watchdog timer-
related registers.
"CM06=0"
Watchdog timer
interrupt request
"CM06=1"
Reset
BCLK
Write to the watchdog timer
start register
(address 000E
16
)
RESET
Watchdog timer
Set to
“7FFF
16
”
1/128
1/16
“CM07 = 0”
“WDC7 = 1”
“CM07 = 0”
“WDC7 = 0”
“CM07 = 1”
HOLD
1/2
Prescaler
Prescaler division ratio (16 or 128) x watchdog timer count (32768)
BCLK
Prescaler division ratio (2) x watchdog timer count (32768)
BCLK
Figure 1.10.1. Block diagram of watchdog timer