RM0082
LS_I2C controller
Doc ID 018672 Rev 1
615/844
Note:
If a bulk read is performed on the slave part of the DW_apb_i2c over the I
2
C bus, then only
MST_ACTIVITY must be IDLE. that is, the Transmit FIFO does not need to be completely
empty. This is a very specific case and should be monitored in software.
●
Dynamically write the IC_TAR and IC_10BITADDR_MASTER using the following
requirements for writing to the IC_TAR register (see
):
–
IC_TAR[12] = IC_10BITADDR_MASTER. Master uses 7 or 10 bit addressing and
is writable when the conditions in step 1 are met and if
I2C_DYNAMIC_TAR_UPDATE is set to ‘b1,
–
IC_TAR[11:10] = Only writable when DW_apb_i2c interface is disabled, which
corresponds to the IC_ENABLE register (see
) being set to ‘b0.
otherwise writes have no effects,
–
IC_TAR[9:0] = IC_TAR. Master’s 10 bit target address is writable at any time when
the conditions in step 1 are met and if I2C_DYNAMIC_TAR_UPDATE is set to ‘b1.
Master transmit and master receive
The I
2
C controller supports switching back and forward between reading and writing
dynamically. To transmit data, write the data to be written to the lower byte of the
IC_DATA_CMD register (
). The CMD bit in the same register should be
written to ‘b0 meaning a write operation. Subsequently, a read command may be issued by
writing “don’t cares” to the lower byte of the IC_DATA_CMD register, and a ‘b1 should be
written to the CMD bit.
As data is transmitted and received, transmit and receive buffer status bits and interrupts
change accordingly.
28.4.3 Multi-master
mode
In a multiple master I2C bus system, the I2C Controller should not be programmed as a
master device. For multiple master systems, the I2C Controller can only be operated as a
slave (set IC_CON.MASTER_MODE to 0 (master disabled).
The I
2
C controller bus protocol allows multiple masters to reside on the same bus. When
two or more masters try to transfer information on the bus at the same time, they must
arbitrate and synchronize the SCL clock.
Master arbitration
Arbitration takes place on the SDA line, while the SCL line is ‘b1. The master, which
transmits a ‘b1 while the other master transmits ‘b0, loses arbitration and turns off its data
output. The master that lost arbitration can continue to generate clocks until the end of the
byte transfer. If both masters are addressing the same slave device, the arbitration could go
into the data phase.
For high-speed mode, the arbitration can not go into the data phase, because each master
is programmed with a different high-speed master code. Because the codes are unique,
only one master can win arbitration, which occurs by the end of the transmission of the high-
speed master code.