SPI and I2C usage

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

SPI and I2C usage

1,072 Views
vishaka_maithil
Contributor I

Hi friends,

 

 I would like to be answered for why and when do we use SPI and I2C. I have  RTC ICs that has  SPI and  I2C Interfaces to my controller.Which one should be choosed between is what Iam confused with.

I would appreciate for any reply as soon as possible.

Thank you in advance..

Labels (1)
0 Kudos
2 Replies

336 Views
Witztronics
Contributor IV

manasa,

 

Although in many cases either will do, there are significant differences.  Usually the requirements of the system will drive the design to one or the other.  If this is not the case, then most likely you can use either with similar results.

 

some SPI advantages:

full duplex

up to 70 Mhz (but not all devices)

not limited to 8-bit words

no slave addressing

no arbitration required due to single master

 

some I2C advantages:

2-wire vs 4-wire (some version of SPI only require 3)

all slaves use same two wires

longer distances

communication is "acknowledged" by receiving end

multiple master is easy to implement

 

From experience, I can tell you that not all SPI is the same.  I have run into many instances where one is not compatible with the other.  For example, some SPI memory devices use a different clock polarity than others and sometimes it does not agree with the one offered in the micro.

0 Kudos

336 Views
vishaka_maithil
Contributor I

Hi Wiztronics,

 

  Yes, you are correct that it depends on the system requirements to choose a right communication bus. Thank you for the reply.

0 Kudos