![](http://datasheet.mmic.net.cn/280000/M37902F8CHP_datasheet_16084061/M37902F8CHP_52.png)
M37902FCCHP, M37902FGCHP, M37902FJCHP
52
MITSUBISHI MICROCOMPUTERS
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
TIMER
There are eight 16-bit timers. They are divided by type into timer A(5)
and timer B(3).
The timer I/O pins are multiplexed with I/O pins for port P5 and P6.
To use these pins as timer input pins, the port direction register bit
corresponding to the pin must be cleared to
“
0
”
to specify input
mode.
TIMER A
Figure 41 shows a block diagram of timer A.
Timer A has four modes: timer mode, event counter mode, one-shot
pulse mode, and pulse width modulation mode. The mode is se-
lected with bits 0 and 1 of the timer Ai mode register (i = 0 to 4). Each
of these modes is described below.
Figure 42 shows the bit configuration of the timer A clock division se-
lect register. Timers A0 to A4 use the count source which has been
selected by bits 0 and 1 of this register.
(1) Timer mode [00]
Figure 43 shows the bit configuration of the timer Ai mode register
during timer mode. Bits 0, 1 and 5 of the timer Ai mode register must
be
“
0
”
in timer mode. The timer A
’
s count source is selected by bits 6
and 7 of the timer Ai mode register and the contents of the timer A
clock division select register. (See Table 12.)
The counting of the selected clock starts when the count start bit is
“
1
”
and stops when it is
“
0
”
.
Figure 44 shows the bit configuration of the count start bit. The
counter is decremented, an interrupt is caused and the interrupt re-
quest bit in the timer Ai interrupt control register is set when the con-
tents becomes 0000
16
. At the same time, the contents of the reload
register is transferred to the counter and count is continued.
Fig. 41 Block diagram of timer A
Timer
One-shot pulse
Pulse width
Count start register
(Address 40
16
)
Countdown
Data bus (odd)
Data bus (even)
Reload register(16)
Counter (16)
(Low-order 8 bits)
(High-order 8 bits)
“
Countdown
”
is always
selected when not in the
event counter mode.
Timer A0 47
16
46
16
Timer A1 49
16
48
16
Timer A2 4B
16
4A
16
Timer A3 4D
16
4C
16
Timer A4 4F
16
4E
16
Countup/Countdown switching
Toggle flip-flop
Up-down register
(Address 44
16
)
Polarity
selection
Addresses
External trigger
Event counter
TAi
IN
(i = 0
–
4)
TAi
OUT
(i = 0
–
4)
Timer (gate function)
select bits
Pulse output
f
1
f
2
f
16
f
64
f
512
f
4096
Timer A clock
division select bit