R01UH0136EJ0210 Rev.2.10
Page 277 of 800
Jul 31, 2012
M16C/64A Group
17. Timer A
17.3.4
Event Counter Mode (When Processing Two-Phase Pulse Signal)
Timers A2, A3, and A4 can be used to count two-phase pulse signals. Table 17.10 lists Event Counter
Mode Specifications (When Processing Two-Phase Pulse Signal with Timers A2, A3, and A4). Table
17.11 lists Registers and the Setting in Event Counter Mode (When Processing Two-Phase Pulse
Signal).
Table 17.10
Event Counter Mode Specifications (When Processing Two-Phase Pulse Signal with
Timers A2, A3, and A4)
Item
Specification
Count source
Two-phase pulse signals input to the TAiIN or TAiOUT pin
Count operations
•
Increment or decrement can be selected by a two-phase pulse signal.
•
When the timer overflows or underflows, it reloads the reload register value and
continues counting. When selecting free-run type, the timer continues counting
without reloading.
Number of counts
When selecting reload type:
•
FFFFh - n + 1 when incrementing
•
n + 1 when decrementing
n: setting value of the TAi register, 0000h to FFFFh
Count start condition
Set the TAiS bit in the TABSR register to 1 (start counting).
Count stop condition
Set the TAiS bit to 0 (stop counting).
Interrupt request
generation timing
Timer overflow or underflow
TAiIN pin function
Two-phase pulse input
TAiOUT pin function
Two-phase pulse input
Read from timer
Count value can be read by reading timer A2, A3, or A4 register.
Write to timer
•
When not counting
Value written to the TAi register is written to both the reload register and counter.
•
When counting
Value written to the TAi register is written to only reload register
(transferred to counter when reloaded next).
Selectable functions
•
Select normal or multiply-by-4 processing operation (timer A3).
•
Counter initialization by Z-phase input (timer A3)
The timer count value is initialized to 0 by Z-phase input.
i = 2 to 4
Summary of Contents for M16C/60 Series
Page 853: ...M16C 64A Group R01UH0136EJ0210...