I2C and SPI Protocol

I2C Protocol


I2C config


I2C is a two-wire synchronous serial communication protocol. SDA line is used for transferring data and SCK is used for transferring clock information. Every device connected to an I2C bus has a unique address. I2C communication protocol involves communication between a slave and a master. The device which initiates the communication and which provides the clock is referred to as a master device. The devices which receive the clock signal and receive/transmit data according to the clock signal is termed as a slave device. Each device on the bus is accessed using its slave address.

Communication process in an I2C bus

I2C Frame

i2c frame

START Bit  7-bit Slave Address R/W# ACK 8-bits of Data ACK 8-bits of Data ACK P
START condition

STEP-1) First the MCU will issue a START condition. The devices connected to the bus will listen to the START condition and will stay ready to begin the communication process.

start condition

STEP-2) Then MCU will send the address of the device with which it needs to communicate. Master indicates the action to be performed with the device whether to read or write along with the address.
STEP-3) All devices connected to the bus will receive the address and will compare it with its own address. If the addresses match with each other, the device will send back an ACKNOWLEDGEMENT signal to the master device. If they                   don’t match they will simply wait for the bus to be released with a STOP condition.
STEP-4) Once the MCU sends the address and corresponding device acknowledges, the MCU can start transmitting or receiving data.
STEP-5) When the data transmission or reception is complete, the MCU will stop communicating by sending a STOP condition.

STOP condition

STEP-6) STOP condition indicates that the bus is released and it can be used by any other master (if any) connected to the I2C bus.

stop condition

After a master generate a start condition I2C bus will solely belong to it. The bus will be freed only if the master generate a STOP condition. Any other master connected to the bus can access the bus after a STOP is identified on the bus.

If the master device which uses the bus needs to communicate with a different slave it should generate a RESTART. Instead if it tries to stop current communication and then start again it may lose access to the bus. RESTART is nothing but a start signal without a stop in the bus.

Video Tutorial - How does I2C Protocol Works?


SPI Protocol


Communication in SPI protocol

SPI waveform

Comparison of I2C and SPI Protocol

Inter Integrated IC Communication (I2C)Serial Peripheral Interface(SPI)

i2c conif



Requires only two lines SDA,SCLRequires minimum four lines,SS,SDA(MOSI), SDI(MISO), SCL
Low SpeedHigher Speed
Half DuplexFull Duplex 
Additional Signal select lines not required if devices increasesAdditional Signal select lines are required as devices increases
More Power requiredLess Power Required 
Multimaster can be used easilyMultimaster is difficult to implement


  • Created and Developed by Prof.Sujit Wagh, SKNCOE, Pune
  • WikiNote Foundation

Last modified: Friday, 20 September 2019, 11:37 AM