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

SPI and I2C

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



Joined: 02 Jun 2004
Posts: 16

View user's profile Send private message Send e-mail MSN Messenger

SPI and I2C
PostPosted: Fri Apr 21, 2006 4:28 am     Reply with quote

Hi i am looking to run some spi and i2c devices on a pic 16f877. I have an i2c eeprom and temp semsor and an spi rtc and a/d. My question is can the serial clock and serial data lines be used for both system or would i be better seperating the two buses?
Humberto



Joined: 08 Sep 2003
Posts: 1215
Location: Buenos Aires, La Reina del Plata

View user's profile Send private message

PostPosted: Fri Apr 21, 2006 5:30 am     Reply with quote

Quote:

My question is can the serial clock and serial data lines be used for both system or would i be better seperating the two buses?


SPI and I2C are both synchronous interfaces but have different protocol so if you are trying to share the Data and Clock lines definately the answer is NO, mostly because I2C lines are bidirectional and level-sensitive.

SPI protocol doesn´t have addressing capabilities. Normal use of this protocol is enabling (addressing) the target device with a dedicated line.

I2C protocol does have addressing capabilities and expect that slaves sharing the bus are identified by a unique address.

Devices with SPI interface can share the bus only with SPI devices.
Devices with I2C interface can share the bus only with I2C devices.

Humberto
zogbog



Joined: 02 Jun 2004
Posts: 16

View user's profile Send private message Send e-mail MSN Messenger

PostPosted: Fri Apr 21, 2006 6:15 am     Reply with quote

Thanks for the help and quick response
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