R01UH0092EJ0110 Rev.1.10
Page 254 of 807
Jul 31, 2012
M16C/64C Group
17. Timer A
Figure 17.3
Timer A Block Diagram
Table 17.3
I/O Ports
Pin Name
I/O
Function
TAiIN
Input
(1)
Gate input (timer mode)
Count source input (event counter mode)
Two-phase signal input (event counter mode (two-phase pulse signal
processing))
Trigger input (one-shot timer mode, PWM mode, programmable output
mode)
TAiOUT
Pulse output (timer mode, event counter mode, one-shot timer mode, PWM
mode, and programmable output mode)
Input
(1)
Two-phase pulse input (event counter mode (two-phase pulse signal
processing))
ZP
Input
(1)
Z-phase (counter initialization) input (event counter mode (two-phase pulse
signal processing))
i = 0 to 4; however, i = 2, 3, 4 for two-phase pulse input, and i = 1, 2, 4 in programmable output mode
Notes:
1.
When using pins TAiIN, TAiOUT, and ZP for input, set the port direction bits sharing pins to 0
(input mode).
2.
The TA0OUT pin is N-channel open drain output.
Increment/decrement
·Timer (gate function):
TMOD1 to TMOD0 = 00, MR2 = 1
·Timer:
TMOD1 to TMOD0 = 00b, MR2 = 0
·One-shot timer:
TMOD1 to TMOD0 = 10b
·Pulse width modulation,
programmable output:
TMOD1 to TMOD0 = 11b
TAiIN
Timer B2
overflow
(1)
Count source select
TAj
overflow
(1)
TAiS
Toggle flip-flop
TAiOUT
Decrement
TAiUD
TAk
overflow
(1)
Polarity
select
Note:
1. Overflow or underflow
01b
TAiTGH to TAiTGL
TMOD1 to TMOD0
00b
10b
11b
01b
TCK1 to TCK0, TMOD1 to TMOD0, MR2 to MR0: Bits in the TAiMR register
TAiTGH to TAiTGL: Bits in the ONSF register when i = 0, bits in the TRGSR register
when i = 1 to 4
TAiS: Bit in the TABSR register
TAiUD: Bit in the UDF register
TCS7 to TCS0: Bit in the registers TACS0 to TACS2
POFSi: Bit in the TAPOFS register
PWMFSi: Bit in the PWMFS register
·Event counter: TMOD1 to TMOD0 = 01b
00b
10b
11b
TMOD1 to TMOD0,
MR2
To external
trigger circuit
Data Bus
TCK1 to TCK0
00b
01b
10b
11b
000b
001b
010b
101b
or TCS6 to TCS4
TCS2 to TCS0
011b
TCS3
or
TCS7
Always decrement except
in event counter mode
1
0
i = 0 to 4
j = i - 1, except j = 4 if i = 0
k = i + 1, except k = 0 if i = 4
TAi
TAj
TAk
Timer A0
Timer A4
Timer A1
Timer A1
Timer A0
Timer A2
Timer A2
Timer A1
Timer A3
Timer A3
Timer A2
Timer A4
Timer A4
Timer A3
Timer A0
fC32
fOCO-S
f64TIMAB
f32TIMAB
f8TIMAB
f1TIMAB
or f2TIMAB
110b
TAi1 register
TAi register
Reload register
Counter
PWMFSi
MR0
0
1
POFSi
Содержание M16C Series
Страница 846: ...M16C 64C Group R01UH0092EJ0110...