SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER
MITSUBISHI MICROCOMPUTERS
7560 Group
44
Watchdog Timer
The watchdog timer gives a mean of returning to the reset status
when a program cannot run on a normal loop (for example, be-
cause of a software runaway).
The watchdog timer consists of an 8-bit watchdog timer L and a 6-
bit watchdog timer H. At reset or writing to the watchdog timer
control register (address 0037
16
), the watchdog timer is set to
“
3FFF
16
.
”
When any data is not written to the watchdog timer con-
trol register (address 0037
16
) after reset, the watchdog timer is in
stop state. The watchdog timer starts to count down from
“
3FFF
16
”
by writing an optional value into the watchdog timer control regis-
ter (address 0037
16
) and an internal reset occurs at an underflow.
Accordingly, programming is usually performed so that writing to
the watchdog timer control register (address 0037
16
) may be
started before an underflow. The watchdog timer does not function
when an optional value has not been written to the watchdog timer
control register (address 0037
16
). When address 0037
16
is read,
the following values are read:
G
value of high-order 6-bit counter
G
value of STP instruction disable bit
G
value of count source selection bit.
When bit 6 of the watchdog timer control register (address 0037
16
)
is set to
“
0,
”
the STP instruction is valid. The STP instruction is
disabled by rewriting this bit to
“
1.
”
At this time, if the STP instruc-
tion is executed, it is processed as an undefined instruction, so
that a reset occurs inside.
This bit cannot be rewritten to
“
0
”
by programming. This bit is
“
0
”
immediately after reset.
The count source of the watchdog timer becomes the system
clock
φ
divided by 8. The detection time in this case is set to 8.19 s
at f(X
CIN
) = 32 kHz and 32.768 ms at f(X
IN
) = 8 MHz.
However, count source of high-order 6-bit timer can be connected
to a signal divided system clock by 8 directly by writing the bit 7 of
the watchdog timer control register (address 0037
16
) to
“
1.
”
The
detection time in this case is set to 32 ms at f(X
CIN
) = 32 kHz and
128
μ
s at f(X
IN
) = 8 MHz. There is no difference in the detection
time between the middle-speed mode and the high-speed mode.
Fig. 45 Block diagram of watchdog timer
Fig. 46 Structure of watchdog timer control register
Fig. 47 Timing of reset output
X
IN
Data bus
X
CIN
“
1
”
“
0
”
Internal
system clock
selection bit
(Note)
“
0
”
“
1
”
1/16
Watchdog timer H count
source selection bit
Reset circuit
Undefined instruction
Reset
“
3F
16
”
is set when
watchdog timer is
written to.
Internal reset
RESET
Reset release time wait
“
FF
16
”
is set when
watchdog timer is
written to.
STP instruction
STP instruction disable bit
Watchdog timer
H (6)
Watchdog timer
L (8)
Note: This is the bit 7 of CPU mode register and is used to switch the middle-/high-speed mode and low-speed mode.
b
7
b
0
W
W
a
D
t
c
T
h
C
d
O
o
g
N
t
i
m
e
r
r
e
g
i
s
t
e
r
(
a
d
d
r
e
s
s
0
0
3
7
1
6
)
S
T
P
0
i
:
:
n
s
S
S
t
T
T
r
u
P
P
c
t
n
i
n
i
o
s
s
n
t
t
u
r
u
d
i
s
t
t
a
i
o
i
o
b
n
n
l
e
e
d
b
n
i
s
i
a
a
t
i
r
c
c
b
b
l
e
l
e
d
d
1
Watchdog timer H count source selecion bit
0 : Watchdog timer L underflow
1 : f(X
IN
)/16 or f(X
CIN
)/16
W
“
3
a
F
t
F
c
h
F
1
d
o
6
”
g
i
s
t
i
s
m
e
e
t
r
t
o
H
t
(
h
f
e
o
r
w
r
e
a
a
t
c
d
h
-
d
o
u
o
t
o
t
f
m
h
i
g
r
h
b
-
y
o
r
w
d
e
r
i
r
i
n
6
b
i
t
a
)
g
i
e
t
g
v
l
u
e
s
t
o
t
h
i
s
a
d
d
r
e
s
s
.
In
r
e
W
t
s
e
r
n
t
t
c
a
s
h
l
i
d
g
e
a
n
o
a
g
l
t
i
m
e
r
d
e
t
e
c
t
i
o
n
1
m
s
(
f
(
X
I
N
)
=
8
M
H
Z
)
f(
X
I
N
)