Timer A
Specifications in this manual are tentative and subject to change
Rev. E
MITSUBISHI MICROCOMPUTERS
M30245 Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
112
Figure 1.78. Timer A-related registers (1)
Function
R W
Timer Ai register (i = 0 to 4) (Note 1)
b7
b8)
(b15
b0
O O
X O
16-bit counter (set to divide ratio)
16-bit counter (set to divide ratio) (Note 2)
16-bit counter (set to one-shot width)
(Note 6)
16-bit PWM (set to PWM pulse "H" width)
(Note 4, 7)
Low-order bits: 8-bit prescaler
(set to PWM period) (Notes 5, 7)
High-order bits : 8-bit PWM
(set to PWM pulse "H" width) (Notes 5, 7)
0000
16 to FFFF16
Values that can be set
0000
16 to FFFF16
0000
16 to FFFF16
0000
16 to FFFF16
00
16 to FE16 (Both high-order and
low-order addresses) (Note 3)
Note 1 : Read and write data in 16-bit units.
Note 2 : Counts pulses from an external source or timer overflow.
Note 3 : Use MOV instruction to write to this register.
Note 4 : When setting value is n, PWM period and "H" width of PWM pulses are:
PWM period : (216 - 1)/fi
PWM pulse "H" width : n/fi
Note 5 : When setting value of high-order address is n and setting value of low-
order address is m, PWM period and "H" width of PWM pulse are:
PWM period : (28 - 1) X (m + 1)/fi
PWM pulse "H" width : (m + 1)n/fi
Note 6 : When the Timer Ai register is set to "0000
16", the counter does not
operate and the Timer Ai interrupt request is not generated. When the
pulse is set to output, the pulse is not output from the TAiOUT pin.
Note 7 : When the Timer Ai register is set to "0000
16", the pulse width modulator
does not operate and the output level of the TAiOUT pin remains "L"
level, therefore the Timer Ai interrupt request is not generated. This also
occurs in the 8-bit pulse width modulator mode when the significant 8
high-order bits in the Timer Ai register are set to "00
16".
b7
b0
Symbol
TA0
TA1
TA2
TA3
TA4
Address
0387
16, 038616,
0389
16, 038816,
038B
16, 038A16,
038D
16, 038C16,
038F
16, 038E16
When reset
Indeterminate
(Note 3)
Bit Symbol
Bit Name
Function
R W
TA1TGL
Timer A1 event/trigger
select bit
Symbol
TRGSR
Address
0383
16
When reset
00
16
Trigger select register
b7
b5
b6
b4
b3
b2
b1
b0
O O
TA1TGH
TA2TGL
TA2TGH
TA3TGL
TA3TGH
TA4TGL
TA4TGH
O O
Timer A2 event/trigger
select bit
Timer A3 event/trigger
select bit
Timer A4 event/trigger
select bit
0 0 : Input on TA1
IN is selected (Note)
0 1 : Invalid
1 0 : TA0 overflow is selected
1 1 : TA2 overflow is selected
b1 b0
0 0 : Input on TA2
IN is selected (Note)
0 1 : Invalid
1 0 : TA1 overflow is selected
1 1 : TA3 overflow is selected
b3 b2
0 0 : Input on TA3
IN is selected (Note)
0 1 : Invalid
1 0 : TA2 overflow is selected
1 1 : TA4 overflow is selected
b5 b4
0 0 : Input on TA4
IN is selected (Note)
0 1 : Invalid
1 0 : TA3 overflow is selected
1 1 : TA0 overflow is selected
b7 b6
Note: Set the corresponding port direction register to "0"
Timer mode
Event counter
mode
One-shot
timer mode
16-bit PWM
8-bit PWM
Mode