I2C Protocol
I2C Protocol
(Inter-Integrated Controller)
Introduction
● I2C stands for Inter-Integrated Circuit.
● Developed by Philips Semiconductor.
● A widely used serial communication protocol for connecting multiple devices on a single
bus.
Purpose
● Facilitates communication between integrated circuits on a circuit board.
● Minimizes wiring complexity by using only two wires:
- SDA (Serial Data Line) and SCL (Serial Clock Line).
● Suitable for connecting microcontrollers, sensors, memory devices, and other peripherals.
Features
● Devices on the I2C bus are identified by unique 7-bit or 10-bit addresses.
● Master device addresses specific slaves for communication.
● It support Single Master-Multi Slave & Multi Master-Multi Slave.
● In I2C only two buses are required for the communication:
- Serial data bus (SDA) & Serial clock bus (SCL).
● Two-Wire Communication: SDA and SCL lines for bidirectional data transfer and clock
synchronization.
● It is worked in half duplex mode.
● Start and Stop Conditions: Communication begins with a start condition and ends with a
stop condition.
● Used for low-speed communication.
Flag Description:
Serial Data Line (SDA):
● Bidirectional line for transmitting data between master and slave devices.
● Devices can pull SDA low to indicate logic 0, and release it for logic 1.
● Open-drain or open-collector configuration allows multiple devices to share the line.
Acknowledgment (ACK):
● Sent by the receiver (master or slave) after successfully receiving a byte.
● Acknowledgment bit is pulled low by the receiver.
● Lack of acknowledgment may indicate an error or the end of data transmission.
Bus Arbitration:
● In multi-master configurations, devices contend for control of the bus.
● Arbitration is determined by which master holds the SDA line low during the ninth clock
cycle.
Clock Stretching:
● Slaves can stretch the clock period by holding the SCL line low.
● Used by a slave to slow down the master if it needs additional time for processing.
Start Condition
● In many cases, multiple data bytes are sent in one I2C frame.
● Each data byte is followed by an ACK bit.
● Bytes may be be all "data" or some may represent an internal address, etc.
● Ex: first byte is a register location and second byte is the data to be written to that
register.
Stop condition
● Arbitration starts when two or more devices attempt to control the bus
simultaneously.
Clock Stretching
● Definition: Slave pauses communication by holding the clock low in I2C clock stretching.
● Purpose: Used when slave needs extra time during read operations.
● Implementation: Slave holds clock low; master waits for it to go high.
● Impact on Bandwidth: Can slow down communication, reducing bus bandwidth,
especially with multiple devices.
● Timing: Allowed after ACK bit and before 1st bit in High-Speed Mode; illegal between
bits 2-9 due to current source boosting.