
R8C/36T-A Group
20. Serial Interface (UART2)
Under development Preliminary document
Specifications in this document are tentative and subject to change.
R01UH0240EJ0010 Rev.0.10
Page 432 of 728
Aug 05, 2011
Figure 20.16
STSPSEL Bit Functions
20.3.3.3
Transfer Clock
The CSC bit in the U2SMR2 register is used to synchronize an internally generated clock (internal SCL) and an
external clock supplied to the SCL2 pin. When the CSC bit is set to 1 (clock synchronization enabled), if a
falling edge on the SCL2 pin is detected while the internal SCL is high, the internal SCL goes low. The value of
the U2BRG register is reloaded and counting of the low-level intervals starts. If the internal SCL changes state
from low to high while the SCL2 pin is low, counting stops. If the SCL2 pin goes high, counting restarts.
In this way, the UART2 transfer clock is equivalent to AND of the internal SCL and the clock signal applied to
the SCL2 pin. The transfer clock works from a half cycle before the falling edge of the internal SCL 1st bit to
the rising edge of the 9th bit. To use this function, select an internal clock for the transfer clock.
The SWC bit in the U2SMR2 register determines whether the SCL2 pin is held low or released from low output
at the falling edge of the 9th bit of the clock.
If the SCLHI bit in the U2SMR4 register is set to 1 (enabled), SCL2 output is turned off (placed in the high-
impedance state) when a stop condition is detected.
Setting the SWC2 bit in the U2SMR2 register to 1 (low output) makes it possible to forcibly output a low-level
signal from the SCL2 pin even while sending or receiving data. Setting the SWC2 bit to 0 (transfer clock)
allows the transfer clock to be output from or supplied to the SCL2 pin, instead of outputting a low-level signal.
If the SWC9 bit in the U2SMR4 register is set to 1 (SCL2 pin low output hold enabled) when the CKPH bit in
the U2SMR3 register is 1, the SCL2 pin is held low at the next falling edge after the 9th bit of the clock. Setting
the SWC9 bit to 0 (SCL2 pin low output hold disabled) releases the SCL2 pin from low output.
Start condition detection
interrupt
Stop condition detection
interrupt
(1) Slave Mode
CKDIR = 1 (external clock)
SDA2
Start condition detection
interrupt
Stop condition detection
interrupt
(2) Master Mode
CKDIR = 0 (internal clock)
SCL2
Set STAREQ = 1
(start)
Set STPREQ = 1
(start)
STSPSEL bit
Set to 1 by a
program
Set to 0 by a
program
Set to 1 by a
program
Set to 0 by a
program
SDA2
SCL2
STSPSEL bit 0
1st bit 2nd bit 3rd bit
5th bit 6th bit 7th bit 8th bit 9th bit
1st bit 2nd bit 3rd bit
5th bit 6th bit 7th bit 8th bit 9th bit