
R8C/38T-A Group
16. Timer RB2
Under development Preliminary document
Specifications in this document are tentative and subject to change.
R01UH0241EJ0010 Rev.0.10
Page 276 of 730
Aug 05, 2011
16.5.3
TOCNT Bit Setting and Pin States
The TOCNT bit in the TRBIOC register can be used to select whether a timer waveform or fixed value is
output. However, regardless of the setting of the TOCNT bit, the output is high impedance in timer mode and a
waveform is output in programmable one-shot and programmable wait one-shot generation modes.
TOPL, TOCNT: Bits in TRBIOC register
If the TOCNT bit is rewritten in programmable waveform generation mode, the pin state does not change
immediately. The data is reflected in the pin state when one of the following conditions is met. Note that when
the TOCNT bit is 1 (fixed-value output), the value, which is set for the primary period in the TOPL bit in the
TRBIOC register, is output.
[Update conditions for pin states]
When the TSTART bit in the TRBCR register is changed from 0 (count stops) to 1 (count starts).
When the TRBPR register is reloaded to the counter.
16.5.4
Coordination with Event Link Controller (ELC)
In programmable one-shot and programmable wait one-shot generation mode, through coordination with the
ELC, timer RB2 can start the count at the rising edge of event input from the ELC.
When an interrupt is generated, the one-shot output signal (counter source synchronization signal) for the ELC
goes to high level at the same time. This signal is automatically cleared to 0 one cycle of the count source after
it is set. Note that this signal is unrelated to the setting of the timer RB2 interrupt enable bit (TRBIE bit in the
TRBIR register).
Table 16.8
Output Data in Each Mode
Operating Mode
Output Enabled/Disabled
Output Data
Timer mode
Output disabled
High impedance
Programmable waveform generation mode
TOCNT
0
Waveform output
1
Fixed value
(inverted value of TOPL)
Programmable one-shot generation mode
Output enabled
Waveform output
Programmable wait one-shot generation mode