Q) Differentiate between I2C and SPI.
Answer:
I2C is a serial communication protocol that connects between low-speed devices, and it has
a master-slave control system. This controls multiple slaves from a single master, in which
each of the slaves has a unique address.
The serial peripheral interface (SPI) is an exchange of data between two devices, this
protocol act as an interface between those two. One device is acting as a master and
another is a slave at that time, it operates in a full duplex mode, which means that data is
transferred in both directions at the same time.
Step-by-step Explanation
SPI I2C
data input line (SI1), data output line (SO1), The Seral data line(SDA), Serial Clock
and a serial clock line (SCK1), these three Lines(SCL), and chip select(CS) are
bus lines are used four wire protocol. required, this is a four-wire protocol.
It is a half-duplex It is a full-duplex protocol.
Clock stretching is not possible Support clock stretching
Faster I2C slower than SPI
Doesn't contain any start or end bits. Includes extra start and stop bits
Has higher data rates >=10 MHz Has transfer rates up to 100khz at the
standard model, and 400khz at Fast mode.
Used in single master and single slave Used in multiple master and slave
applications, and less hardware complexity. applications, and has more complexity.
Answer:
I2C is a serial communication protocol that connects between low-speed devices, and it has
a master-slave control system. This controls multiple slaves from a single master, in which
each of the slaves has a unique address.
The serial peripheral interface (SPI) is an exchange of data between two devices, this
protocol act as an interface between those two. One device is acting as a master and
another is a slave at that time, it operates in a full duplex mode, which means that data is
transferred in both directions at the same time.
Step-by-step Explanation
SPI I2C
data input line (SI1), data output line (SO1), The Seral data line(SDA), Serial Clock
and a serial clock line (SCK1), these three Lines(SCL), and chip select(CS) are
bus lines are used four wire protocol. required, this is a four-wire protocol.
It is a half-duplex It is a full-duplex protocol.
Clock stretching is not possible Support clock stretching
Faster I2C slower than SPI
Doesn't contain any start or end bits. Includes extra start and stop bits
Has higher data rates >=10 MHz Has transfer rates up to 100khz at the
standard model, and 400khz at Fast mode.
Used in single master and single slave Used in multiple master and slave
applications, and less hardware complexity. applications, and has more complexity.