What is I2C?

What is the I2C Interface? When is this interface used?

1 Answer
Can you answer this question?

Editorial Team - everything RF

Feb 26, 2021

Inter-Integrated-circuit (I2C) is a simple, bidirectional two-wire synchronous serial bus that requires only two wires to transmit information between devices connected to the bus. This interface is useful for projects that have many different parts (eg. sensors, pins, expansions and drivers) working together as they can connect up to 128 devices to the mainboard while maintaining a clear communication pathway. I2C's address system and shared bus enable connection of many different devices using the same wires and all data to be transmitted on a single wire thus reducing the pin count. This makes I2C a bit slower compared to other interfaces, but it's still faster than UART. The speed of I2C is also dependent on data speed, wire quality and external noise.

The I2C protocol has a two-wire interface that can be used to connect low-speed devices like microcontrollers, EEPROMs, A/D and D/A converters, I/O interfaces and other similar peripherals in embedded systems.

It has 2 Lines which are SCL (serial clock line) and SDA (serial data line acceptance port). CL is the clock line for synchronizing transmission. SDA is the data line through which bits of data are sent or received. The master device initiates the bus transfer of data and generates a clock to open the transferred device and any addressed device is considered a slave device. The relationship between master and slave devices, transmitting and receiving on the bus is not constant. It depends on the direction of data transfer at the time. If the master wants to send data to the slave, the master must first address the slave before sending any data. The master will then terminate the data transfer. If the master wants to receive data from the slave, the master must again address the slave first. The host then receives the data sent by the slave and finally, the receiver terminates the receiving process. The host is also responsible for generating the timing clock and terminating the data transfer. It is also necessary to connect the power supply through a pull-up resistor. When the bus is idle, both lines are on a high power level. The capacitance in the line will affect the bus transmission speed. As the current power on the bus is small, when the capacitance is too large, it may cause transmission errors. Thus, its load capacity must be 400 pF, so the allowable length of the bus and the number of connected devices can be estimated.

Advantages of using I2C

  • Has a low pin/signal count even with numerous devices on the bus
  • Flexible, as it supports multi-master and multi-slave communication.
  • Simple as it only uses 2 bidirectional wires to establish communication among multiple devices.
  • Adaptable as it can adapt to the needs of various slave devices.
  • Support multiple masters.

Disadvantages of using I2C

  • Slower speed as it requires pull-up resistors rather than push-pull resistors used by SPI. It also has an open-drain design that limits speed.
  • Requires more space as the resistors consume valuable PCB real estate.
  • May become complex as the number of devices increases.