I²C

I2C[1] (Inter-Integrated Circuit) is a programmable interface that allows you to communicate with I2C peripherals.

I2C is a synchronous serial interface that uses a clock signal to synchronize data transfers between master and slave device:

Master device generates the clock and initiates communication with slaves.

Slave device receives the clock and responds when addressed by the master.

Figure: I2C interface diagram

To allow the I2C master to connect to 128 I2C slave devices, an I2C slave device provides a 7-bit address. Since most slave addresses are determined by the manufacturer, refer to the specification to find the slave device address.

Using the I2C bus, the master controls signal lines called SCL (Shared CLock) and SDA (Shared DAta) to read or write data to or from the device. SCL is a clock line for communication synchronization, and SDA is a data line. The master outputs the clock for synchronization with the SCL, and the slave outputs or receives data through the SDA according to the clock output to the SCL.

If the SDA line is used alone, only half duplex communication is possible because data is sent only to 1 line.