
R8C/3GM Group
19. Timer RC
R01UH0284EJ0100 Rev.1.00
Aug 09, 2011
19.4
Timer Mode (Input Capture Function)
This function measures the width or period of an external signal. An external signal input to the TRCIOj (j = A, B,
C, or D) pin acts as a trigger for transferring the contents of the TRC register (counter) to the TRCGRj register
(input capture). The input capture function, or any other mode or function, can be selected for each individual pin.
The TRCGRA register can also select fOCO128 signal as input-capture trigger input.
j = A, B, C, or D
Table 19.7
Specifications of Input Capture Function
Item
Specification
Count source
f1, f2, f4, f8, f32, fOCO40M, fOCO-F
External signal (rising edge) input to TRCCLK pin
Count operation
Increment
Count period
The CCLR bit in the TRCCR1 register is set to 0 (free running operation):
1/fk × 65,536
fk: Count source frequency
The CCLR bit in the TRCCR1 register is set to 1 (TRC register set to
0000h at TRCGRA input capture):
1/fk × (n + 1)
n: TRCGRA register setting value
Count start condition
1 (count starts) is written to the TSTART bit in the TRCMR register.
Count stop condition
0 (count stops) is written to the TSTART bit in the TRCMR register.
The TRC register retains a value before count stops.
Interrupt request generation
timing
Input capture (valid edge of TRCIOj input or fOCO128 signal edge)
The TRC register overflows.
TRCIOA, TRCIOB, TRCIOC,
and TRCIOD pin functions
Programmable I/O port or input capture input (selectable individually for
each pin)
INT0 pin function
Programmable I/O port or INT0 interrupt input
Read from timer
The count value can be read by reading TRC register.
Write to timer
The TRC register can be written to.
Selectable functions
Input capture input pin selection
One or more of pins TRCIOA, TRCIOB, TRCIOC, and TRCIOD
Input capture input valid edge selection
Rising edge, falling edge, or both rising and falling edges
Timing for setting the TRC register to 0000h
Overflow or input capture
Input-capture trigger selected
fOCO128 can be selected for input-capture trigger input of the
TRCGRA register.