Wednesday 11 September 2013

Difference between SPI and I2C Protocols

Difference between SPI and I2C Protocols:

Major Difference Between SPI and I2C is: 

1) SPI can be full/half duplex, depending on the hardware, 3 or 4 wire and I2C is half duplex      communication....we cannt send and receive data at a time in I2c..but it possible in SPI ....SPI much    faster Than I2C.......

2)  speed is difference :
In case of i2c is 100/400kbps in 7 bit mode max 400kbps (But High speed I2C communication     protocols allow speeds upto 3.4Mbps!!) 
In case of spi speed is upto 1mbps (the higher speed of SPI is due to fact that unlike I2C, SPI interfaces to a slave device using a sperate pin called the slave select + no concept of acknowledgements which means increased Band width..) 

3) Connection wise:
 I2c require less pin then spi (SPI 3wire: 3 IOs, SPI 4 wire: 4 IOs, I2C: 2 IOs)
as spi require slave select for individual device... 

4) Noise sensitivity of i2c is high... there is chance to corrupt the r/w bit... then whole data is corrputed... but in case of spi.. chance is very less as whole word is trasmitted... However, I must say that I2C is more reliable, since the protocol supports slave feedback machanism (ACK) to detect whether was received correctly or corrupt.
5) it is better to use i2c in case of if u want to connect more device to connect. (slave addressing advantageous over SPI slave select individual pins for individual slaves) 

6) bus arbitration is possible in case of i2c... not in case of spi... (SPI does not require it, since only 1 slave is controlled by the master at any given point) 

No comments:

Post a Comment