
R8C/3GM Group
17. Timer RA
R01UH0284EJ0100 Rev.1.00
Aug 09, 2011
17.5
Event Counter Mode
Note:
1. The level of the output pulse becomes the level when the pulse output starts when the TRAMR
register is written to.
Table 17.4
Event Counter Mode Specifications
Item
Specification
Count source
External signal which is input to TRAIO pin (active edge selectable by a program)
Count operations
Decrement
When the timer underflows, the contents of the reload register are reloaded and
the count is continued.
Divide ratio
1/(n+1)(m+1)
n: setting value of TRAPRE register, m: setting value of TRA register
Count start condition
1 (count starts) is written to the TSTART bit in the TRACR register.
Count stop conditions 0 (count stops) is written to the TSTART bit in the TRACR register.
1 (count forcibly stops) is written to the TSTOP bit in the TRACR register.
Interrupt request
generation timing
When timer RA underflows [timer RA interrupt].
TRAIO pin function
Count source input
TRAO pin function
Programmable I/O port or pulse output
(1)Read from timer
The count value can be read by reading registers TRA and TRAPRE.
Write to timer
When registers TRAPRE and TRA are written while the count is stopped, values
are written to both the reload register and counter.
When registers TRAPRE and TRA are written during the count, values are
).
Selectable functions
TRAIO input polarity switch function
The active edge of the count source is selected by the TEDGSEL bit in the
TRAIOC register.
Count source input pin select function
P1_5 or P1_7 is selected by bits TRAIOSEL0 to TRAIOSEL1 in the TRASR
register.
Pulse output function
Pulses of inverted polarity can be output from the TRAO pin each time the timer
underflows (selectable by the TOENA bit in the TRAIOC register).
(1) Digital filter function
Whether enabling or disabling the digital filter and the sampling frequency is
selected by bits TIPF0 and TIPF1 in the TRAIOC register.
Event input control function
The enabled period for the event input to the TRAIO pin is selected by bits
TIOGT0 and TIOGT1 in the TRAIOC register.