CHAPTER 9 TIMER/COUNTER FUNCTION
322
User’s Manual U15195EJ5V0UD
9.3 Timer 2
9.3.1 Features (timer 2)
Timers 20 and 21 (TM20, TM21) are 16-bit general-purpose timer units that perform the following operations.
•
Pulse interval or frequency measurement and programmable pulse output
•
Interval timer
•
PWM output timer
•
32-bit capture timer when 2 timer/counter channels are connected in cascade
(In this case, four 32-bit capture register channels can be used.)
9.3.2 Function overview (timer 2)
•
16-bit timer/counter (TM20, TM21): 2 channels
•
Bit length
Timer 2 registers (TM20, TM21): 16 bits
During cascade operation: 32 bits (higher 16 bits: TM21, lower 16 bits: TM20)
•
Capture/compare register
In 16-bit mode: 6
In 32-bit mode: 4 (capture mode only)
•
Count clock division selectable by prescaler (set the frequency of the count clock to 10 MHz or less)
•
Base clock (f
CLK
): 1 type (set f
CLK
to 20 MHz or less)
f
XX
/2
•
Prescaler division ratio
The following division ratios can be selected according to the base clock (f
CLK
).
Division Ratio
Base Clock (f
CLK
)
1/2 f
XX
/4
1/4 f
XX
/8
1/8 f
XX
/16
1/16 f
XX
/32
1/32 f
XX
/64
1/64 f
XX
/128
1/128 f
XX
/256