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 or SPI?

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



Joined: 26 Sep 2003
Posts: 6

View user's profile Send private message

I2C or SPI?
PostPosted: Wed Dec 17, 2003 5:40 pm     Reply with quote

Hi,

Need to interface a EEPROM, probably a MicroChip part, with an '877A. Any thoughts on whether I should go with I2C or SPI? Any advantages to using one over the other?

The only thing I see is that with I2C I can have multiple devices on the bus, where SPI looks to be single-ended. I want whatever is easy and works reliably with the functions provided by CCS' C.

-matt redmond
Snoopy
Guest







PostPosted: Thu Dec 18, 2003 7:16 am     Reply with quote

Hi

SPI is very easy to use instead of I2C.
you can put a lot of device on SDI, SCK SDO,
one pin for each CS. you can use demux (for CS PIN)
if you are using some SPI device. I have never use I2C
a can not take it about the speed.

I use SPI communication a 6Mhz, 24Mhz crystal / 4= 6Mhz SPI communiation.
matt redmond



Joined: 26 Sep 2003
Posts: 6

View user's profile Send private message

SPI/I2C
PostPosted: Thu Dec 18, 2003 11:48 am     Reply with quote

So SPI is a multi-device interface?

You are saying I can put multiple devices sharing the SDI, SCK and SDO pins and then I need one pin for each device to use for CS. Right?

Under what circumstances would I use a demux for CS? When I have more than 2 devices?
Kieran



Joined: 28 Nov 2003
Posts: 39
Location: Essex UK

View user's profile Send private message

PostPosted: Thu Dec 18, 2003 2:16 pm     Reply with quote

I use SPI a lot, it is multi-device but you do need 1 PIC pin to drive each Chip select as Snoopy says. I have connected EEPROMs, display drivers, I/O expand, Maxim UART etc. etc. I have used I2C with EEPROMs but I think it is more difficult to use however fewer pins required to drive it.
snoopy
Guest







PostPosted: Thu Dec 18, 2003 4:53 pm     Reply with quote

Personnally,if i have some device and i can't put in in daisy chain.
i am using a demutiplexer for CS, that is permit to reduce pin from
uChip. but if you have some free pin chose one pin for each SPI.

like i am using a MAX7221, an you can put it in daisy chain mode.
i have only one cs pin for all max7221
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