Timer A
Unde
deeopmen
Preliminary Specifications REV.E
Specifications in this manual are tentative and subject to change.
Mitsubishi microcomputers
M30220 Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
67
Timer A
Figure 1.13.3 shows the block diagram of timer A. Figures 1.13.4 to 1.13.8 show the timer A-related
registers.
Use the timer Ai mode register (i = 0 to 7) bits 0 and 1 to choose the desired mode.
Timer A has the four operation modes listed as follows:
Timer mode: The timer counts an internal count source.
Event counter mode: The timer counts pulses from an external source or a timer over flow.
One-shot timer mode: The timer stops counting when the count reaches “0000
16
”.
Pulse width modulation (PWM) mode: The timer outputs pulses of a given width.
Figure 1.13.4. Timer A-related registers (1)
Figure 1.13.3. Block diagram of timer A
Count start flag
(Address 0340
16
, 0380
16
)
Up count/down count
Timer A0
Timer A1
Timer A2
Timer A3
Timer A4
Timer A5
Timer A6
Timer A7
TAi
Addresses
0387
16
0386
16
Timer A4
0389
16
0388
16
Timer A0
038B
16
038A
16
Timer A1
038D
16
038C
16
Timer A2
038F
16
038E
16
Timer A3
0347
16
0346
16
Timer A7
0349
16
0348
16
Timer A5
034B
16
034A
16
Timer A6
TAj
TAk
TAm
Timer B2
Timer B2
Timer B2
Timer B2
Timer B2
Timer B5
Timer B5
Timer B5
Timer A1
Timer A2
Timer A3
Timer A4
Timer A0
Timer A6
Timer A7
Timer A5
Always down count except
in event counter mode
Reload register (16)
Counter (16)
Low-order
8 bits
High-order
8 bits
Clock source
selection
Timer
(gate function)
Timer
One shot
PWM
f
1
f
8
f
32
f
C132
External
trigger
TAi
IN
(i = 0 to 7)
TBm overflow
(m = 2 when i
£
4, m = 5 when i
3
5)
TAj overflow
(j = i –1. Note, however, that j = 4 when i = 0,
j = 6 when i = 5, j = 5 when i = 7)
TAk overflow
(k = i + 1. Note, however, that k = 0 when i = 4,
k = 7 when i = 5, k = 6 when i = 7)
Event counter
Clock selection
Pulse output
Toggle flip-flop
TAi
OUT
(i = 0 to 7)
Data bus low-order bits
Data bus high-order bits
Up/down flag
(Address 0344
16
, 0384
16
)
Down count
Polarity
selection
Timer Ai mode register
Symbol
Address
When reset
00
16
00
16
TAiMR(i=0 to 4)
TAiMR(i=5 to 7)
0396
16
to 039A
16
0356
16
to 0358
16
Bit name
Function
Bit symbol
TMOD0
b7
b6
b5
b4
b3
b2
b1
b0
0 0 : Timer mode
0 1 : Event counter mode
1 0 : One-shot timer mode
1 1 : Pulse width modulation
(PWM) mode
b1 b0
TCK1
MR3
MR2
MR1
TMOD1
MR0
TCK0
Function varies with each operation mode
Count source select bit
(Function varies with each operation mode)
Operation mode select bit
AA
AA
AA
AA
AA
AA
AA