English
Language : 

SH7144_08 Datasheet, PDF (542/930 Pages) Renesas Technology Corp – 32-Bit RISC Microcomputer SuperHTM RISC engine Family/SH7144 Series
14. I2C Bus Interface (IIC) Option
The following description gives the procedures to transmit data serially in synchronization with
ICDR (ICDRT) writing operation.
1. Perform initialization according to the procedure described in section 14.4.2, Initialization.
2. Confirm that the bus is free by reading the BBSY flag in ICCR.
3. Set the MST and TRS bits in ICCR to 1 to select the master transmit mode.
4. Then write 1 to BBSY and 0 to SCP. This changes the level on SDA from high to low while
SCL is high, and is thus the generation of the start condition.
5. With the generation of the start condition, the IRIC and IRTR flags are set to 1. When the IEIC
bit in ICCR has been set to 1, an interrupt request is generated for the CPU.
6. Write the data (slave address + R/W) to ICDR after the start condition is detected.
In the I2C bus format (when the FS bit in SAR or the FSX bit in SARX is 0), the first frame
data following the start condition indicates the 7-bit slave address and transmit/receive
direction (R/W).
To determine the end of the transfer, the IRIC flag is cleared to 0.
After writing to ICDR, clear IRIC continuously in order that no other interrupt processing is
executed. If the time for transmission of one frame of data has passed before the IRIC flag
clearing, the end of transmission cannot be determined.
The master device transmits the transmit clock signal and the data written in the ICDR. To
acknowledge its selection, the slave device that has been selected (that matches the slave
address) sets the level on SDA low in the 9th cycle of the transmit clock.
7. When the transmission of one frame has been completed, the IRIC flag is set to 1 on the rising
edge of the 9th cycle of the transmit clock. The level on SCL is automatically fixed low in
synchronization with the internal clock until the next data for transmission has been written to
ICDR.
8. Read the ACKB bit in ICSR to confirm ACKB = 0.
When the slave device does not return acknowledgement and ACKB = 1, execute transmit end
processing in step 12 and carry out transmission again.
9. Write the transmit data to ICDR.
The IRIC flag is cleared to 0 to determine the end of the transfer.
Perform the ICDR writing and the IRIC flag clearing sequentially as in step 6.
Transmission of the next frame is performed in synchronization with the internal clock.
10. When the transmission of one frame has been completed, the IRIC flag is set to 1 on the rising
edge of the 9th cycle of the transmit clock. The level on SCL is automatically fixed low in
synchronization with the internal clock until the next data for transmission has been written to
ICDR.
Rev.4.00 Mar. 27, 2008 Page 498 of 882
REJ09B0108-0400