
R8C/3GM Group
22. Serial Interface (UART2)
R01UH0284EJ0100 Rev.1.00
Aug 09, 2011
Notes:
1.
If the source of any interrupt is changed, the IR bit in the interrupt control register for the changed interrupt may inadvertently be set to 1
If one of the bits listed below is changed, the interrupt source, the interrupt timing, and others change. Therefore, always be sure to set the IR
bit to 0 (interrupt not requested) after changing these bits.
Bits SMD2 to SMD0 in the U2MR register, the IICM bit in the U2SMR register, the IICM2 bit in the U2SMR2 register, and the CKPH bit in the
U2SMR3 register.
2.
Set the initial value of SDA2 output while bits SMD2 to SMD0 in the U2MR register are 000b (serial interface disabled).
3.
Second data transfer to the U2RB register (rising edge of SCL2 9th bit)
4.
First data transfer to the U2RB register (falling edge of SCL2 9th bit)
5.
6.
Table 22.12
I2C Mode Functions
Function
Clock Synchronous
Serial I/O Mode
(SMD2 to SMD0 = 001b,
IICM = 0)
I2C Mode (SMD2 to SMD0 = 010b, IICM = 1)
IICM2 = 0 (NACK/ACK interrupt)
IICM2 = 1 (UART transmit/receive interrupt)
CKPH = 0
(No Clock Delay)
CKPH = 1
(With Clock Delay)
CKPH = 0
(No Clock Delay)
CKPH = 1
(With Clock Delay)
Source of UART2 bus
-
Start condition detection or stop condition detection
Source of UART2
UART2 transmission
Transmission started or
completed (selectable by
U2IRS bit)
No acknowledgment
detection (NACK)
Rising edge of SCL2 9th bit
UART2
transmission
Rising edge of
SCL2 9th bit
UART2 transmission
Falling edge of SCL2
next to 9th bit
Source of UART2
UART2 reception
When 8th bit received
CKPOL = 0 (rising edge)
CKPOL = 1 (falling edge)
Acknowledgment detection (ACK)
Rising edge of SCL2 9th bit
UART2 reception
Falling edge of SCL2 9th bit
Timing for transferring data
from UART reception shift
register to U2RB register
CKPOL = 0 (rising edge)
CKPOL = 1 (falling edge)
Rising edge of SCL2 9th bit
Falling edge of
SCL2 9th bit
Falling and rising edges
of SCL2 9th bit
UART2 transmission output
delay
No delay
With delay
TXD2/SDA2 functions
TXD2 output
SDA2 I/O
RXD2/SCL2 functions
RXD2 input
SCL2 I/O
CLK2 functions
CLK2 input or output port
selected
(Cannot be used in I2C mode.)
Noise filter width
15 ns
200 ns
Read of RXD2 and SCL2
pin levels
Possible when the
corresponding port
direction bit = 0
Possible regardless of the content of the corresponding port direction bit.
Initial value of TXD2 and
SDA2 outputs
CKPOL = 0 (“H”)
CKPOL = 1 (“L”)
The value set in the port register before setting I2C mode. (2) Initial and end values of
SCL2
-
“H”
“L”
“H”
“L”
UART2 reception
When 8th bit received
CKPOL = 0 (rising edge)
CKPOL = 1 (falling edge)
Acknowledgment detection (ACK)
UART2 reception
Falling edge of SCL2 9th bit
UART2 transmission
Transmission started or
completed (selectable by
U2IRS bit)
UART2 transmission
Rising edge of SCL2
9th bit
UART2 transmission
Falling edge of SCL2
next to 9th bit
UART2
transmission
Rising edge of
SCL2 9th bit
UART2 transmission
Falling edge of SCL2
next to 9th bit
Storage of receive data
1st to 8th bits of the
received data are stored
in bits b0 to b7 in the
U2RB register.
1st to 8th bits of the received data are
stored in bits b7 to b0 in the U2RB register.
1st to 7th bits of the received data are stored
in bits b6 to b0 in the U2RB register. 8th bit is
stored in bit b8 in the U2RB register.
1st to 8th bits are
stored in bits b7 to b0 in
Read of receive data
The U2RB register status is read.
Bits b6 to b0 in the
U2RB register are read
as bits b7 to b1. Bit b8
in the U2RB register is
read as bit b0. (4)