![](http://datasheet.mmic.net.cn/120000/R5F21388SDFP_datasheet_3573603/R5F21388SDFP_315.png)
R8C/38T-A Group
17. Timer RC
Under development Preliminary document
Specifications in this document are tentative and subject to change.
R01UH0241EJ0010 Rev.0.10
Page 284 of 730
Aug 05, 2011
17.2.2
Timer RC General Registers A, B, C, and D (TRCGRA, TRCGRB, TRCGRC,
TRCGRD)
Registers TRCGRA to TRCCRD can be used as output compare or input capture registers. Their functions are
switched by registers TRCIOR0 and TRCIOR1.
The value in the general register set as an output compare register is always compared with the value in the
TRCCNT register. When the values in both registers match (compare match), bits IMFA to IMFD in the
TRCSR register are set to 1. If bits IMIEA to IMIED in the TRCIER register are set to 1 at this time, an
interrupt request is generated. Compare match output can be set by registers TRCIOR0 and TRCIOR1.
When an external input capture is detected, the value in the TRCCNT register is stored in the general register
set as an input capture register, and bits IMFA to IMFD in the TRCSR register are set to 1. If bits IMIEA to
IMIED in the TRCIER register are set to 1 at this time, an interrupt request is generated. The detection edge for
input capture can be selected by registers TRCIOR0 and TRCIOR1.
Also, the TRCGRC register can be used as a buffer register for the TRCRGA register and the TRCGRD register
can be used as a buffer register for the TRCRGB register. These functions are selected by bits BUFEA and
BUFEB in the TRCMR register.
For example, if the TRCGRA register is set as an output compare register and the TRCGRC register is set as a
buffer register for the TRCGRA register, the value in the buffer register TRCGRC is transferred to the
TRCGRA register each time compare match A occurs.
If the TRCGRA register is set as an input capture register and the TRCGRC register is set as a buffer register
for the TRCGRA register, the value in the TRCCNT register is transferred to the TRCGRA register and the
value in the TRCGRA register is transferred to the buffer register TRCGRC when an input capture occurs.
Do not access registers TRCGRA to TRCGRD in 8-bit units. These registers must be accessed in 16-bit units.
The initial values in these registers are FFFFh.
Address 0013Ah (TRCGRA_0), 0013Ch (TRCGRB_0), 0013Eh (TRCGRC_0), 00140h (TRCGRD_0)
Bit
b7b6
b5b4b3
b2b1b0
Symbol
————
———
—
After Reset
1
111
1111
Bit
b15
b14
b13
b12
b11
b10
b9
b8
Symbol
————
———
—
After Reset
1
111
1111
Bit
Function
R/W
b15 to b0 16-bit readable/writable register.
R/W