I
2
C Module
LH79524/LH79525 User’s Guide
9-2
Version 1.0
9.1 Theory of Operation
The LH79524/LH79525 implements a two-wire I
2
C Module capable of operating in either
Master or Slave mode. The block conforms to the I
2
C 2.1 Bus Specification for data
rates up to 400 kbps. The two wires (pins) in the interface are SCL (serial clock) and
SDA (serial data).
The I
2
C Module buffers a single byte of serial data on receive and transmit. Registers pro-
vide control over operating mode, serial clock frequency, and slave-mode address. A sta-
tus register contains status bits that remain set until cleared by software.
The slaves each have a unique address that is determined by the system designer. When
the master wants to communicate with a slave, the master transmits a start condition that
is then followed by the slave's address and a control bit (R/W) to determine if the master
wants to transmit data or receive data from the slave. The slave will then send an acknowl-
edge (ACK) pulse after the address and R/W bit is received to notify the master that the
slave has received the request. If the master (master-transmitter) is writing to the slave,
(slave-receiver), the receiver will receive a byte of data. This transaction will continue until
the master terminates the transmission with a stop condition. If the master (master-
receiver), is reading from the slave (slave-transmitter), the receiver will transmit a byte of
data to the master, and the master will then acknowledge the transaction with the ACK
pulse. This transaction will continue until the master terminates the transmission by not
acknowledging the transaction after the last byte is received, and then the master will issue
a stop condition. This is shown in Figure 9-2.
Figure 9-2. I
2
C Bus Protocol
LH79525-68
MSB
SDA
SCL
START OR
REPEATED
START
CONDITION
BYTE COMPLETE
INTERUPT WITHIN
SLAVE
SCL HELD LOW
WHILE SERVICING
INTERUPTS
STOP OR
REPEATED START
CONDITION
LSB
7
8
1
2
9
1
2
3-8
9
ACK
(FROM SLAVE)
ACK
(FROM RECEIVER)
SR
P