21
MITSUBISHI MICROCOMPUTERS
3820 Group
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER
TIMERS
The 3820 group has five timers: timer X, timer Y, timer 1, timer 2,
and timer 3. Timer X and timer Y are 16-bit timers, and timer 1,
timer 2, and timer 3 are 8-bit timers.
All timers are down count timers. When the timer reaches “00
16
”,
an underflow occurs at the next count pulse and the correspond-
ing timer latch is reloaded into the timer and the count is contin-
ued. When a timer underflows, the interrupt request bit corre-
sponding to that timer is set to “1”.
Read and write operation on 16-bit timer must be performed for
both high and low-order bytes. When reading a 16-bit timer, read
the high-order byte first. When writing to a 16-bit timer, write the
low-order byte first. The 16-bit timer cannot perform the correct op-
eration when reading during the write operation, or when writing
during the read operation.
Fig. 11 Timer block diagram
Timer 1 count source
selection bit
Real time port
control bit "0"
"1"
P5
5
/CNTR
1
"0"
f(X
IN
)/16
(f(X
CIN
)/16 in low-speed mode*)
CNTR
1
active
edge switch bit
"10"
Timer Y stop
control bit
Falling edge detection
Period
measurement mode
Timer Y
interrupt
request
Pulse width HL continuously measurement mode
Rising edge detection
"00","01","11"
Timer Y operating
mode bit
Timer X
interrupt
request
Timer X mode register
write signal
P5
4
/CNTR
0
Timer X (low) (8)
Timer X (low) latch (8)
Timer X (high) latch (8)
Q
Q
T
S
P5
4
direction register
Pulse output mode
P5
4
latch
Timer X stop
control bit
"0"
"1"
Timer X write
control bit
Q D
Latch
Q D
Latch
"1"
"0"
"1"
"10"
Timer X operat-
ing mode bit
"00","01","11"
f(X
IN
)/16
(f(X
CIN
)/16 in low-speed mode*)
Pulse width
measurement
mode
CNTR
active
edge switch bit
CNTR
active
edge switch bit
Pulse output mode
Timer 2 latch (8)
Timer 2 (8)
Q
Q
T
S
"0"
P5
6
direction register
P5
6
latch"1"
T
OUT
output
active edge
switch bit "0"
Timer 2 write
control bit
"0"
"1"
T
OUT
output
control bit
"1"
P5
6
/T
OUT
X
CIN
Ti"1"
source selection
bit
"0"
Timer 2
interrupt
request
Timer 3
interrupt
request
T
OUT
output control bit
f(X
IN
)/16(f(X
CIN
)/16 in low-speed mode*)
Timer 2 count source
selection bit
Timer 1 latch (8)
Timer 1 (8)
Timer 1
interrupt
request
Data bus
f(X
IN
)/16
(f(X
CIN
)/16 in low-speed mode*)
IN
)/16
f(X
CIN
)/16 in low-speed mode*)
* Internal clock
φ
= X
CIN
/2.
CNTR
0
interrupt
request
CNTR
1
interrupt
request
Timer Y operating mode bit
"00","01","10"
"11"
P6
0
direction register "0"
Real time port
control bit "1"
P6
0
0
latch
P6
1
direction register "0"
Real time pP6
control bit "1"
P6
1
P6
1
latch
P6
0
data for real time port
P6
1
data for real time port
Timer Y (low) (8)
Timer Y (low) latch (8)
Timer Y (high) latch (8)
Timer 3 latch (8)
Timer 3 (8)
Timer X (high) (8)
Timer Y (high) (8)