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
Posted: Fri Apr 21, 2006 5:30 am
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.
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