R01UH0092EJ0110 Rev.1.10
Page 501 of 807
Jul 31, 2012
M16C/64C Group
23. Serial Interface UARTi (i = 0 to 2, 5 to 7)
23.3.3.7
SDA Digital Delay
When transferring data with the I2C-bus, change the data while the SCL clock is low. When SDA is
changed while the SCL clock is a high, the change is recognized as one of the corresponding
conditions (see 23.5.3.4 “Setup and Hold Times When Generating a Start/Stop Condition”).
This function delays output from the SDAi pin. By delaying the change of the SDA, the data can be
changed while the SCL clock is low. This function is enabled by setting bits DL2 to DL0 in the UiSMR3
register to 001b to 111b, and disabled by setting them to 000b.
Figure 23.29 SDA Output Selection by Setting Bits DL2 to DL0
23.3.3.8
SDA Input
When the IICM2 bit in the UiSMR2 register (i = 0 to 2, 5 to 7) is set to 0, the first 8 bits of received data
(D7 to D0) are stored in bits 7 to 0 in the UiRB register and the ninth bit (ACK/NACK) is stored in bit 8.
When the IICM2 bit is 1, the first to seventh bits (D7 to D1) of the received data are stored in bits 6 to 0
in the UiRB register and the eighth bit (D0) is stored in bit 8 in the UiRB register. Even when the IICM2
bit is 1, if the CKPH bit in the UiSMR3 register is 1, the same data as when the IICM2 bit is 0 can be
read. To read the data, read the UiRB register after the rising edge of ninth bit of the corresponding
clock pulse.
When receiving byte data, the SDAi pin is released for the first to eighth bits to receive data, and an
acknowledgment is generated for the ninth bit. NACK is generated when the last byte data is received
in master mode, or when the slave address does not match in slave mode. In all other cases, ACK is
generated.
In I
2
C mode, set 9-bit data to the UiTB register. In 9-bit data, set FFh to b7 to b0 to release the SDAi pin
and set b8 to 0 to generate ACK or 1 to generate NACK.
By setting 00FFh or 01FFh as 9-bit data to the UiTB register, the SDAi pin becomes high-impedance for
the first to eighth bits, and data can be received. ACK or NACK is generated at the ninth bit.
Read the received data from the UiRB register. When the clock delay function is used, data transfer to
the UiRB register occurs twice and each UiRB register value is different. Refer to Figure 23.20
“Transfer to UiRB Register and Interrupt Timing” for details.
When DL2 to DL0 are 000b (no delay)
When DL2 to DL0 are 001b (1 to 2 cycles of UiBRG count source)
SCL
UiBRG
count source
When DL2 to DL0 are 111b (7 to 8 cycles of UiBRG count source)
1
2
3
4
5
6
7
8
SDA
SDA
SDA
DL2 to DL0: Bits in the UiSMR3 register
Summary of Contents for M16C Series
Page 846: ...M16C 64C Group R01UH0092EJ0110...