![](http://datasheet.mmic.net.cn/230000/79RC32438-200BB_datasheet_15568909/79RC32438-200BB_402.png)
IDT I2C Bus Interface
I2C Bus Master Interface
79RC32438 User Reference Manual
15 - 8
November 4, 2002
Notes
Figure 15.7 Master Operation: Master Transmitter Addressing a Slave Receiver (7-bit Address)
At the completion of the start command, the CPU initializes the I2CDO register with an 8-bit data quan-
tity which consists of the 7-bit slave address and a read/write bit set to write.
2
The CPU then writes the
transfer data (WD) command to the I2CMCMD register.
2
This causes the master interface to release the
I
2
C bus and drive the slave address and write bit onto the I
2
C bus. The addressed slave device indicates
that it can accept data by generating an acknowledge.
2
At the completion of the WD command, the D bit is
set in the I2CMS register and the master interface suspends the I
2
C bus. In addition to the D bit being set,
the I2CMS register contains additional status information.
2
The NA bit is cleared if a slave generated an
acknowledge.
2
The LA bit is set if the master interface lost an arbitration with an alternate bus master.
Finally, the ERR bit is set if an unexpected start or stop condition was detected on the I
2
C bus during execu-
tion of the command.
2
Continuing the example shown in Figure 15.7, the CPU transmits data to the addressed slave by writing
the 8-bit data quantity to be transmitted to the I2CDO register and issuing a WD command.
2
At the comple-
tion of each command, the status bits in the I2CMS register become valid and the I
2
C bus is suspended
until the next command is issued.
2
When the CPU wishes to end the transaction because it has no more
data to transmit, or because no acknowledgment was observed,
2
it issues a STOP command.
2
This causes
a stop condition to be driven on the I
2
C bus. When the command completes, the done bit in the I2CMS
register is set. At this point, the CPU may begin a new transaction.
2
Figure 15.8 shows a master receiver transaction to a slave with a 7-bit slave address. The transaction is
similar to the master transmitter transaction shown
2
in Figure 15.7 except that data is driven by the
slave.
2
To transfer data the CPU issues an RDACK command.
2
This causes the master interface to issue
clock pulses on the SCL signal and the slave transmitter to drive data on the SDA signal.
2
The data driven
by the slave transmitter is shifted into the I2CDI register.
2
After the data has been transferred, the master
interface generates an acknowledge.
2
This completes the command, causing the D bit to be set, status
information in the I2CS register to be valid, and the master interface to suspend the I
2
C bus. The RDACK
command will always cause the NA status bit to be cleared.
2
The master interface signals the end of data to
the slave transmitter by not generating an acknowledge.
2
This is done by issuing an RD command rather
than an RDACK command.
2
Figure 15.8 Master Operation: Master Receiver Addressing a Slave Transmitter (7-bit Address)
S
SLA7
NOP
START
WD
W
A
StD
StD
Data
A
StD
WD
WD
Data
A
P
StD
NA
STOP
StD
NOP
Idle bus
From master to slave
Bus suspended by master
From slave to master
S
SLA7
NOP
START
WD
R
A
StD
StD
Data
A
StD
RDACK
RD
Data
A
P
StD
NA
STOP
StD
NOP
Idle bus
From master to slave
Bus suspended by master
From slave to master