228
CHAPTER 12 I2C Interface
MB89960 series
12.5 Operation of the I2C Interface
The I2C Interface can perform serial output of 8-bit data synchronized with a shift clock.
s I2C Bus System Configuration
I2C bus system uses a serial data line (SDA) and a serial clock line (SCL) for data transfer. All
devices connected on it must have open drain or open collector output, logic “and” function is
exercised in both lines with two pull up resistors.
Each device connected to the bus is software addressable by a unique address and simple
master/slave relationships exist at all times; master can operate as master-transmitters or as
master-receivers. As it’s a true multi-master bus including collision detection and arbitration to
prevent data corruption if two or more masters simultaneously initiate data transfer.
s I2C Bus Protocol
Figure 12.5a A Complete Data Transfer
After the START condition (S), a slave address is sent. This address is 7 bits long followed by
an eighth bit which is a data direction bit (R/W). A data transfer is always terminated by a STOP
condition (P) generated by the master. However, if a master still wishes to communicate on the
bus, it can generate a repeated START condition (Sr) and address another slave without first
generating a STOP condition.
s START Condition
When the bus is free, i.e., no master device is engaging the bus (both SCL and SDA lines are at
logical HIGH), a master may initiate communication by sending a START condition. As shown in
Figure 12.5a, a START condition is defined as a HIGH to LOW transition on the SDA line while
SCL is HIGH. This condition denotes the beginning of a new data transfer and wake up all
slaves.
START condition is occurred during the following two situations:
When the I2C bus is not in use (IBCR: MSS = “0”,IBSR: BB = “0”,IBCR: INT = “0” and IBSR: AL
= “0”), IBCR: MSS is written “1”. After that IBSR: BB is set to “1” by indicating that the bus is
busy.
When the bus master device goes into interrupt subroutine (IBCR: MSS = “1”, IBSR: BB = “1”,
IBCR: INT = “1” and IBSR: AL = “0”), IBCR: SCC is written “1”. This is called repeated START
condition.
1
0
110
01
1
0
1100
1
7-bit Address
8-bit Data
R/W
Acknowledge
bit
No
Acknowledge
MSB
LSB
START
Condition
STOP
Condition
SDA
SCL
MSB
LSB