Download Print this page

Renesas M16C/50 Series User Manual page 289

Advertisement

M16C/5L Group, M16C/56 Group
15.3.3
Event Counter Mode (When Not Using Two-Phase Pulse Signal Processing)
In event counter mode, the timer counts pulses from an external device, or overflows/underflows of
other timers. Timers A2, A3, and A4 can count two-phase external signals. Refer to 15.3.4 "Event
Counter Mode (When Processing Two-Phase Pulse Signal)" for details. Table 15.8 lists Event Counter
Mode Specifications (When Not Using Two-Phase Pulse Signal Processing). Table 15.9 lists Registers
and the Setting in Event Counter Mode (When Not Processing Two-Phase Pulse Signal). Figure 15.6
shows Operation Example in Event Counter Mode.
Table 15.8
Event Counter Mode Specifications (When Not Using Two-Phase Pulse Signal Processing)
Item
Count source
Count operations
Number of counts
Count start condition
Count stop condition
Interrupt request
generation timing
TAiIN pin function
TAiOUT pin function
Read from timer
Write to timer
Selectable functions
i = 0 to 4
R01UH0127EJ0110 Rev.1.10
Sep 01, 2011
External signals input to the TAiIN pin (active edge can be selected)
Timer B2 overflows or underflows
Timer Aj overflows or underflows (j = i - 1, except j = 4 if i = 0)
Timer Ak overflows or underflows (k = i + 1, except k = 0 if i = 4)
Increment or decrement can be selected by a program.
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.
When selecting reload type:
FFFFh - n + 1 for increment
n + 1 for decrement
n: setting value of the TAi register, 0000h to FFFFh
Set the TAiS bit in the TABSR register to 1 (start counting).
Set the TAiS bit to 0 (stop counting).
Timer overflow or underflow
I/O port or count source input
I/O port or pulse output
Count value can be read by reading the TAi register.
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).
Free-run count function
Even when the timer overflows or underflows, the reload register content is not
reloaded.
Pulse output function
Whenever the timer underflows or underflows, the output polarity of the
TAiOUT pin is inverted. When the TAiS bit is set to 0 (stop counting), the pin
outputs a low-level signal.
Output polarity control
The output polarity of the TAiOUT pin is inverted. (While the TAiS bit is set to 0
(stop counting), a high-level signal is output.)
Specification
15. Timer A
Page 252 of 803

Advertisement

loading