345
CHAPTER 16 SERIAL INTERFACE CHANNEL 0 (
μ
PD78018FY SUBSERIES)
(6) Detecting address coincidence
In the I
2
C bus mode, the master can select a specific slave device by transmitting a slave address to it.
Whether the slave address output by the master coincides with the value of the slave address register (SVA)
of a slave is automatically detected by hardware. When the wake-up function specification (WUP) is 1 and
only if the slave address transmitted by the master coincides with the address set to the SVA, CSIIF0 Is set
(CSIIF0 is also set when the stop condition is detected).
Set SIC to 1 when the wake-up function is used.
Caution
Whether a slave is selected or not is detected by coincidence of the data (address) received
after the start condition.
To detect this coincidence, an address coincidence detection interrupt (INTCSI0) that occurs
when WUP = 1, is usually used. Therefore, to enable detection of whether a slave is selected
or not, be sure that WUP = 1.
(7) Error detection
Because the status of serial bus SDA0 (SDA1) during transmission is also loaded to the serial I/O shift register
0 (SIO0) in the I
2
C bus mode, a transmission error can be detected in the following ways:
(a) By comparing SIO0 data before and after transmission
If the two data are different, it is assumed that a transmission error has occurred.
(b) By using slave address register (SVA)
The transmission data is placed in SIO0 and SVA, and transmission is executed. After transmission has
been completed, the COI bit (that indicates the coincidence signal from the address comparator) of serial
operation mode register 0 (CSIM0) is tested. If this bit is “1”, transmission has been completed normally.
If it is “0”, a transmission error has occurred.
(8) Communication operation
In the I
2
C bus mode, the master outputs an address onto the serial bus to select one of the slave devices
to be communicated.
Following the slave address, the master transmits an R/W bit that indicates the transfer direction of data, and
starts serial communication with the slave.
Timing charts for data communication are shown in Figures 16-21 to 16-22.
The serial I/O shift register 0 (SIO0) performs a shift operation in synchronization with the falling edge of the
serial clock (SCL), and the transmitted data is transferred to the SO0 latch and is output from the SDA0 or
SDA1 pin, with MSB first.
The data input to the SDA0 or SDA1 pin is loaded to the shift register (SIO0) at the rising edge of SCL.