View previous topic :: View next topic |
Author |
Message |
matt redmond
Joined: 26 Sep 2003 Posts: 6
|
I2C or SPI? |
Posted: Wed Dec 17, 2003 5:40 pm |
|
|
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
|
|
Posted: Thu Dec 18, 2003 7:16 am |
|
|
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
|
SPI/I2C |
Posted: Thu Dec 18, 2003 11:48 am |
|
|
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
|
|
Posted: Thu Dec 18, 2003 2:16 pm |
|
|
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
|
|
Posted: Thu Dec 18, 2003 4:53 pm |
|
|
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 |
|
|
|