Mixing I2C and SPI

Author
philippe320
New Member
  • Total Posts : 3
  • Reward points : 0
  • Joined: 2006/10/22 03:13:57
  • Location: 0
  • Status: offline
2007/10/07 21:34:54 (permalink)
0

Mixing I2C and SPI

Hello,

I'm working on a 16F876, with an I2C peripheric and another SPI one.
Everything is working fine if I connect only one at a time.

I've read here http://www.i2cchip.com/mix_spi_i2c.html that I could connect the 2 on the same pins
If I separate the communications in time, it says it should work.

But it doesn't : the I2C peripheric doesn't react anymore with the SPI on the line, even in idle mode.

Does anyone has the solution
Regards

Philippe

#1

4 Replies Related Threads

    DarioG
    Scheisse Menschen
    • Total Posts : 52256
    • Reward points : 0
    • Joined: 2006/02/25 08:58:22
    • Location: hi there
    • Status: offline
    RE: Mixing I2C and SPI 2007/10/08 01:34:07 (permalink)
    0
    Well, I know it's a bit tough to make them live on the same bus, I2C and SPI.
    Those notes on that page do make some sense (I've not checked them carefully, though), but you should check carefully what happens on the bus(es)...

    Dario Greggio
    --
    Wouldn't it be wonderful, if you lost one son for every promise you don't keep?
    #2
    BitWise
    Super Member
    • Total Posts : 1235
    • Reward points : 0
    • Joined: 2004/11/09 13:24:20
    • Location: UK
    • Status: offline
    RE: Mixing I2C and SPI 2007/10/08 03:02:33 (permalink)
    0
    Does the SPI chip still work when both peripherals are in the circuit?
     
    Do you send an I2C 'Stop' (to resync the I2C devices state machine) before issuing other I2C commands?

    Throughout your life advance daily, becoming more skillful than yesterday, more skillful than today. This is never-ending.

    Yamamoto Tsunetomo (1659-1719)
    #3
    philippe320
    New Member
    • Total Posts : 3
    • Reward points : 0
    • Joined: 2006/10/22 03:13:57
    • Location: 0
    • Status: offline
    RE: Mixing I2C and SPI 2007/10/08 23:50:12 (permalink)
    0
    No, the SPI peripherical hangs up : the PIC never get any data from it and the I2C sends only 255 bytes
    and Yes, I always start I2C comm by I2C_start and end by I2C_stop
     
    I tried that connexions http://forum.microchip.com/tm.aspx?m=149624, found here.
     
    but it still doesn't work
    one more detail : my SPI peripherical is a 3.3V and the I2C is a 5V
     
    thanks
    Philippe
     
    #4
    extrapilot
    New Member
    • Total Posts : 26
    • Reward points : 0
    • Joined: 2007/05/18 20:01:53
    • Location: 0
    • Status: offline
    RE: Mixing I2C and SPI 2007/11/19 00:04:10 (permalink)
    0
    Hi
     
    On the physical implementation here though- isnt there a problem in that I2C requires pullups on SCL and SDA? Since these pins are mapped to SCK and SDI on the SPI module, and since the SPI module doesnt seem to need (or want) pullups, does this screw up the SPI signaling?
     
    Rob
    #5
    Jump to:
    © 2017 APG vNext Commercial Version 4.5