MB89960 series
CHAPTER 12 I2C Interface
229
12
Besides the above two situations, writing IBCR: MSS = “1” or IBCR: SCC = “1” do not generate
any START condition. Moreover, during the bus is used by other master device in the system,
IBSR: AL bit is set when IBCR: MSS is written “1”.
s Addressing
In master mode, after the START condition is generated, IBSR: BB and IBSR: TRX is set. The
slave address stored in IDAR register (bit 7 to bit 1) is sent out with MSB first. This is a seven
bits long calling address followed by a R/W bit (bit 0 of IDAR). The R/W bit tells the slave the
desired direction of data transfer.
After the slave address is transferred, an acknowledge bit is received. An acknowledge bit is
signaled from the receiving device by pulling the SDA line LOW at the 9th clock. (See
Figure12.5a) Then the R/W bit (bit 0 of IDAR) is logically reversed and put into IBSR: TRX.
In slave mode, after the START condition is detected, IBSR: BB = “1” and IBSR: TRX = “0” is
set. The received data from master is stored into IDAR register and compared with its own
specific address stored in IADR. When they are matched, IBSR: AAS is set and an
acknowledge bit is sent to the master. Then the bit 0 of the received data (bit 0 of IDAR) is put
into IBSR: TRX.
s Data Transfer
Once a successful slave addressing is achieved, the data transfer can proceed byte by byte in a
direction specified by the R/W bit sent by the calling master.
Each data byte is 8 bit long. Data can be changed only during SCL line is LOW and must be
held stable during SCL is HIGH as shown in
Figure 12.5a. One clock pulse is for one bit data
transferring, MSB is transferred first. Each byte data has to be followed by an acknowledge bit,
which signaled from the receiving device by pulling the SDA line LOW at the 9th clock. So one
complete data byte transferring needs 9 clock pulses.
s Acknowledge
The acknowledge bit is sent from the receiver to the transmitter at the 9th clock in data byte
transfer.
In the receiver, the transmission of acknowledge bit can be enabled (IBCR: ACK = “1”) or
disabled (IBCR: ACK = “0”) by setting the bus control register. In the transmitter, the
acknowledge bit is detected and stored in IBSR: LRB.
When the master receiver does not acknowledge the slave transmitter after one byte
transmission, the IBSR: TRX in slave device is cleared and slave receive mode is set. So that
the slave releases the SDA line for the master to generate STOP or repeated START condition.
s STOP condition
The master can terminate the communication by generating a STOP condition to free the bus.
However, the master may generate a START condition followed by a calling command without
generating a STOP condition first. This is called repeated START condition. A STOP condition
is defined as a LOW to HIGH transition on the SDA line while SCL is HIGH.
When the bus master device goes into interrupt subroutine (IBCR: MSS = “1”, IBSR: BB = “1”,
IBCR: INT = “1” and IBSR: AL = “0”), IBCR: MSS is written “0” to generate the STOP condition
and then the device is changed to slave mode.
Besides the above situation, writing IBCR: MSS = “0” do not generate any STOP condition.