
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 000016. 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 4016)
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 4716 4616
Timer A1 4916 4816
Timer A2 4B16 4A16
Timer A3 4D16 4C16
Timer A4 4F16 4E16
Countup/Countdown switching
Toggle flip-flop
Up-down register
(Address 4416)
Polarity
selection
Addresses
External trigger
Event counter
TAiIN
(i = 0–4)
TAiOUT
(i = 0–4)
Timer (gate function)
Count source
select bits
Pulse output
f1
f2
f16
f64
f512
f4096
Timer A clock
division select bit