I2C - Data Transfer

From Software Engineers Wiki
Jump to: navigation, search

How data is transferred via I2C interface?

Contents

Answer

Start/Stop condition

When the bus is idle, both SDA and SCL are driven high by pull-up resistors. The START(S) condition begins with HIGH to LOW transition of SDL line while SCL line is still HIGH. The STOP(P) condition is LOW to HIGH transition of SDL line while SCL line is HIGH. Both START and STOP condition are generated by the master.

Bit transfer

The data transfer happens when the SCL line is high. After transition of SCL line from LOW to HIGH, the SDA line is sampled. While SCL line is low, data can change on SDA line.

Data transfer

The data transfer happens after START condition. Data is transferred with the MSB (most significant bit) first. After the data transfer, the slave should acknowledge the data by driving SDA line low while driving a pulse on SCL line.

There are three possible data transfer format.

Master transmitting to slave (WRITE): (M) is driven by Master and (S) is driven by slave.

  • START (M)
  • Slave address (M)
  • WRITE command (M)
  • ACK (S)
  • DATA (M)
  • ACK (S)
  • STOP (M)

Master reading from slave (READ):

  • START (M)
  • Slave address (M)
  • READ command (M)
  • ACK (S)
  • DATA (S)
  • ACK (M)
  • STOP (M)

Master reading from and transmitting to slave (READ/WRITE): The repeated START condition is generated by the master whenever new command needs to be sent.

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox