R8C/36T-A Group
21. Clock Synchronous Serial Interface
Under development Preliminary document
Specifications in this document are tentative and subject to change.
R01UH0240EJ0010 Rev.0.10
Page 499 of 728
Aug 05, 2011
21.4.2.3.1
Flow for Generating Repeat Start Condition during I2C Master
Transmit Mode
To generate a repeat start condition after receiving NACK, use the following procedure:
(1) Confirm a NACK error.
(2) Generate a repeat start condition (write 1 to the BBSY bit and 1 to the SCP bit in the SICR2 register with
the MOV instruction)
(3) Confirm the rising edge of the SCL signal.
(4) Clear bits TEND and NACKF in the SISR register.
21.4.2.3.2
Operation when Start Condition/Stop Condition is Detected during
I2C Master Transmit Operation
The following shows the operation and software flow when a start condition/stop condition is detected during
I2C master transmit operation.
(1) Detect an arbitration lost and enter slave receive mode.
(2) Clear bits TDRE and ORER_AL in the SISR register.
(3) Confirm the BBSY bit in the SICR2 register.
When 1: Enter slave address reception.
When 0: Either of the host/slave can operate.
21.4.2.4
Master Receive Operation
In master receive mode, the master device outputs the receive clock, receives data from the slave device, and
returns an acknowledge signal.
Figures 21.21 and
21.22 show the Operation Timing in Master Receive Mode
(I2C bus Interface Mode).
The receive procedure and operation in master receive mode are as follows:
(1) After setting the TEND bit in the SISR register to 0, set the TRS bit in the SICR1 register to 0 to switch
from master transmit mode to master receive mode. Then, set the TDRE bit in the SISR register to 0.
(2) Reception is started by performing a dummy read of the SIRDR register. The receive clock is output in
synchronization with the internal clock and data is received. The master device outputs the level set by the
CEIE_ACKBT bit in the SIER register to the SDA pin at the rising edge of the 9th clock cycle of the
receive clock.
(3) When one frame of data reception is completed, the RDRF bit in the SISR register is set to 1 at the rising
edge of the 9th clock cycle of the receive clock. If the SIRDR register is read at this time, the received data
can be read and the RDRF bit is set to 0 at the same time.
(4) Reception can be performed continuously by reading the SIRDR register every time the RDRF bit is set to
1. If reading of the SIRDR register is delayed by another process and the 8th clock cycle falls while the
RDRF bit is 1, the SCL signal is held low until the SIRDR register is read. No stop condition or repeat start
condition can be generated at this time.
(5) If the next frame is the last receive frame, set the RCVD bit in the SICR1 register to 1 (next receive
operation disabled) and the CEIE_ACKBT bit to 1 before reading the SIRDR register. This enables
returning NACK to the slave device and a stop condition can be generated after the next reception.
(6) When the RDRF bit is set to 1 at the rising edge of the 9th clock cycle of the receive clock, generate a stop
condition.
(7) When the STOP bit in the SISR register is set to 1, read the SIRDR register. Then, set the RCVD bit to 0
(next receive operation continues).
(8) Return to slave receive mode.