Over time, the physical size and power requirements of integrated circuits (ICs) have decreased. The main reason behind it is that more transistors can be incorporated into a smaller size and fewer interconnection wires can be available between ICs. The IC's actual circuitry is much lesser than its packaging, but it needs a larger area to cover due to interconnection wires present between ICs.
I2C, or Inter-Integrated circuit bus, can be used to decrease the number of wires required. This communication is assigned a special protocol known as the I2C Protocol. The I2C bus is made up of two active wires and a ground connection. Serial Clock[SCL] and Serial Data[SDA] wires are the two active wires. These wires are bidirectional half-duplex in nature and carry data between devices connected to the bus. Whether it is a microcontroller, memory, or keyboard interface, each device is identified by a unique address and can function as either a transmitter or receiver, depending on its function. Devices on the I2C bus can be easily added or subtracted, making it ideal for low-maintenance and control applications in embedded systems .
I2C communication has different stages. A START condition must be issued on the bus prior to any transaction. The start condition informs all connected ICs that data is going to be transmitted. When a message is finished, a STOP condition has been sent. This is the indicator to every device on the bus that the bus is open to usage again. If a chip was obtained and received data during the previous transaction, this data is going to be processed. The second stage is the transmission of a byte to a slave device. The master can send a byte to a slave after the start condition is being sent. The first byte following a start condition identifies the slave on the bus and selects the operating mode. The slave determines the purpose of the following bytes. In the third stage, the slave device’s byte is received. When the slave's address has been identified and acknowledged, with putting the correct byte to read value, the byte can be read and send to the master device from the slave device. Other stages of I2C communication are getting and giving acknowledgment. The slave must acknowledge the transmission of an address or data byte onto the bus. If an address matches its own, that slave and only that slave will respond with an ACK. If a byte is sent to an already addressed slave, the slave will also respond with an ACK. When the master receives a byte from a slave, it must acknowledge it to the slave device. If there is no more data to receive, the master will send a not-acknowledge (NACK) signal and the data transaction will be terminated.