Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

Clock Stretching

In an I2C communication, a master device determines the clock speed. The I2C bus provides an explicit clock
signal that relieves a master and a slave from synchronizing exactly to a predefined baud rate.However, some
slave devices may receive or transmit bytes of data at a fast rate, but need more time to store a received byte or
prepare another byte to be transmitted. Slaves can then hold the SCL line LOW to force the master into a wait-
state until the slave is ready for the next byte transmission. This mechanism is called clock stretching. An I 2C
slave is allowed to hold the SCL line LOW if it needs to reduce the bus speed. The master on the other hand is
required to read back the SCL signal after releasing it to the HIGH state and wait until the SCL line has
actually gone HIGH. DLN-series adapters support clock stretching. Taking into consideration the impacts of
clock stretching, the total speed of the I2C bus might be significantly decreased.

Repeated START (Sr) Condition


Instead of the STOP condition, the master can generate a repeated START (Sr) condition. Like a START
condition, to generate a repeated START condition, the master changes the SDA line from one to zero while
the SCL line is HIGH (marked in red). In this case, the I2C bus remains busy. To prepare for the repeated
START condition, the master sets the SDA line to one during the LOW phase of the SCL line (marked in
green).

The START (S) and repeated START (Sr) conditions are functionally identical. The repeated start conditions
is used in the following situations:
 To continue transmission with the same slave device in the opposite direction. After the repeated START
condition, the master sends the same slave device address followed by another direction bit.
 To start transmission to or from another slave device. After the repeated START condition, the master sends
another slave address.
 To provide a READ operation from internal address. See READ Operation for details.
DLN adapters use the repeated START condition to read from the internal address (the DlnI2cMasterRead()
function) and to write to and then read from the same slave device (the DlnI2cMasterTransfer() function). If a
DLN adapter needs to communicate with different slaves, it finishes one transmission (with the STOP
condition) and starts another transmission.

You might also like