CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug Reports on this forum. Send them to support@ccsinfo.com

I2C vs SPI

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
cfernandez



Joined: 18 Oct 2003
Posts: 144

View user's profile Send private message

I2C vs SPI
PostPosted: Tue Jan 11, 2005 12:05 pm     Reply with quote

Which is the difference between I2C and SPI and which the best option?

I use a I2C eeprom in my project, but now I am evaluating use SPI eeprom (www.ramtrom.com). The only difference is that the SPI (25Mhz) is more fast that I2C (1Mhz), but really the CCS take this advantage?

If somebody can tell me your opinion? Thank you very much!!

Best Regards,
ckielstra



Joined: 18 Mar 2004
Posts: 3576
Location: The Netherlands

View user's profile Send private message

PostPosted: Tue Jan 11, 2005 1:12 pm     Reply with quote

Quote:
The only difference is that the SPI (25Mhz) is more fast that I2C (1Mhz), but really the CCS take this advantage?
In the PIC processor the fastest SPI rate you can get is using the internal SPI hardware. The maximum SPI frequency is then CPU-clock / 4. Assuming you are running at the maximum speed of 40MHz for a PIC18, then your SPI-clock will be 10MHz. So your SPI eeprom is much faster than the maximum SPI-clock achievable in the PIC.

I2C advantages:
- Good software I2C simulation by the the CCS compiler (if you want to use the hardware I2C for something else).
- Requires only 2 I/O pins (SPI requires 3 + 1 select line for every device).
- Multiple masters possible on the same bus.

SPI advantages:
- Faster (higher bitrates and no overhead for addressing etc.)
- Easier protocol (no multi-master, etc).
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group