Difference between I2C and SPI

What you will learn here about I2C vs SPI:

  • Difference between I2C and SPI
  • How to choose between SPI and I2C





Difference between I2C and SPI

ParameterI2CSPI
Full FormI2C stands for Inter integrated circuitSPI stands for Serial peripheral interface
Number of wiresI2C requires 2 wires (SCL and SDA)SPI requires 4 wires (MISO, MOSI, CS and CLK)
Connection diagrami2c block diagramspi block diagram
CommunicationI2C is half duplex communication means master and slave can talk with each other but not simultaneously.SPI is full duplex communication means master and slave can talk with each other simultaneously
ACKI2C gets Acknowledgement from respective slave after every transmission means I2C gives guarantee of data transmission.SPI doen't get any acknowledgement from the slave device means SPI does not give guarantee of data transmission.
MechanismI2C uses Addressing mechanism to communicate with respective slave.SPI uses slave select or chip select pin to communicate with respective slave.
Multiple slaves or ScaleOnly two wires are enough to communicate with multiple slaves since it supports addressing mechanism.SPI requires one chip select or slave select pin per slave. So as number of slaves increasing, number of slave select or chip select pins also increases.
SpeedI2C is Slower(typically 100kbps, 400kbps and 3.4Mbps)SPI is Faster (upto 10 Mbps)
PowerI2C requires more powerSPI requires less power
DistanceI2C Can be used for long distanceSPI Better for short distance

How to choose between SPI and I2C

We all know about I2C and SPI but we always have a question, how to choose between SPI and I2C right!

When to use SPI

SPI is a better choice when
1)when you want to send data with higher speed.

When to use I2C

I2C is a better choice when
1)you want reliable data transmission since it supports acknowledgment mechanism.

2)Only two wires/ pins require to communicate with multiple slaves. SPI requires the number of slaves equals to the number of slave select wires or number of pins. So I2C is a better choice when you have a limited number of pins.



How useful was this post?

Click on a star to rate it!

Average rating / 5. Vote count:

We are sorry that this post was not useful for you!

Let us improve this post!

You may also like...

Leave a Reply