Shop OBEX P1 Docs P2 Docs Learn Events
Share SPI pin and I2C pin? — Parallax Forums

Share SPI pin and I2C pin?

ZootZoot Posts: 2,227
edited 2007-11-22 00:06 in BASIC Stamp
I've got a Stamp project going and I'm one pin short. Two of the components in the project are 24LC32A EEPROM and '595 shift register. I was thinking that I could use the same pin for both SCL and the shift clock on the '595. I would think the pullup on the SCL wouldn't adversely affect the '595 clock input. If that would be OK, then...

What state do I need to leave SDA in when I'm done with I2C communication so that the unrelated activity when I shift out to the '595 on SCL doesn't accidentally cause an I2C stop/start condition?

Other suggestions on sharing a pin like this?

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2007-11-21 23:47
    I would share the data line, not the clock line. If the I2C clock is not doing anything, the EEPROM will ignore the data line. Similarly, if the SPI clock is high (or low), the '595 will ignore the data line.
  • ZootZoot Posts: 2,227
    edited 2007-11-22 00:06
    Cool. Thanks!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    When the going gets weird, the weird turn pro. -- HST
Sign In or Register to comment.