NCV81276
www.onsemi.com
17
a stop signal. The number of data bytes that can be
transmitted over the serial bus in a single read or write
operation is limited only by what the master and slave
devices can handle.
The serial bus protocol operates as follows:
1. The master initiates data transfer by establishing
a START condition, defined as a high-to-low
transition on the serial data line SDA while the serial
clock line, SCL, remains high. This indicates that an
address/data stream will follow. All slave
peripherals connected to the serial bus respond to the
START condition, and shift in the next eight bits,
consisting o f a 7-bit address (MSB first) plus an R/W
bit, which determines the direction of the data
transfer, i.e., whether data will be written to or read
from the slave device. The peripheral whose address
corresponds to the transmitted address responds by
pulling the data line low during the low period before
the ninth clock pulse, known as the Acknowledge
Bit. All other devices on the bus now remain idle
while the selected device waits for data to be read
from or written to it. If the R/W bit is a 0, the master
will wr ite to the slave device. If the R/W bit is a 1, the
master will read from the slave device.
2. Data is sent over the serial bus in sequences of nine
clock pulses, eight bits of data followed by an
Acknowledge Bit from the slave device. T ransitions
on the data line must occur during the low period of
the clock signal and remain stable during the high
period, as a low-to-high transition when the clock is
high may be interpreted as a STOP signal. The
number of data bytes that can be transmitted over the
serial bus in a single READ or WRITE operation is
limited only by what the master and slave devices
can handle.
3. When all data bytes have been read or written, stop
conditions are established. In WRITE mode, the
master will pull the data line high during the 10th
clock pulse to assert a STOP condition. In READ
mode, the master device will override the
acknowledge bit by pulling the data line high during
the low period before the ninth clock pulse. This is
known as No Acknowledge. The master will then
take the data line low during the low period before
the tenth clock pulse, then high during the tenth
clock pulse to assert a STOP condition.
4. Any number of bytes of data may be transferred over
the serial bus in one operation, but it is not possible
to mix read and write in one operation because the
type of operation is determined at the beginning and
cannot subsequently be changed without starting
a new operation. To write data to one of the device
data registers or read data from it, the Address
Pointer Register must be set so that the correct data
register is addressed, and then data can be written
into that register or read from it. The first byte of
a write operation always contains an address that is
stored in the Address Pointer Register . If d at a i s t o b e
written to the device, the write operation contains
a second data byte that is written to the register
selected by the address pointer register. The device
address is sent over the bus followed by R/W set to
0. This is followed by two data bytes. The first data
byte is the address of the internal data register to be
written to, which is stored in the Address Pointer
Register. The second data byte is the data to be
written to the internal data register.
READ A SINGLE WORD
The master device asserts the start condition. The master
then sends the 7-bit slave address. It is followed by a R/W
bit that indicates the direction of operation, which will be
a write operation in this case. The slave whose address is on
the bus acknowledges it by an ACK signal on the bus (by
holding SDA line low). The master then sends register
address on the bus. The slave device accepts it by an ACK.
The master then asserts a repeated start condition followed
by a 7-bit slave address. The master then sends a direction
bit R/W which is Read for this case. Controller
acknowledges i t b y a n ACK signal on the bus. This will start
the read operation and controller sends the high byte of the
register o n the bus. Master reads the high byte and asserts an
ACK on the SDA line. Controller now sends the low byte of
the register on the SDA line. The master acknowledges it by
a no acknowledge NACK on the SDA line. The master then
asserts the stop condition to end the transaction.
Figure 9. Single Register Read Operation
= Generated by the Master
= Generated by the Slave
S = Start Condition
P = Stop Condition
Sr = Repeated Start Condition
ACK/NACK = Acknowledge/No Acknowledge
S 0 ACKSr 1 PNACKACK ACKSlave Address Register Address Slave Address Register Data