Shop OBEX P1 Docs P2 Docs Learn Events
Question for ya — Parallax Forums

Question for ya

Jason WilliamsJason Williams Posts: 8
edited 2009-11-21 20:54 in Propeller 1
I have been going through the documentation for the propeller, and I have a question. Some of it talks about the prop using a "software" based I2C. Now, if it's software based, does that mean any of the IO pins could be used for the SCL and SDA pins? Is there something special about pins 28 & 29?

The only reason I ask is out of curiosity. I'm no EE, so I didn't know if there's a physical difference in the silicon that mandates I2C is on pins 28 & 29 only.

Everything I've read says that the props are hardcoded to look for the EEPROM on 28 & 29 for boot, but I didn't know if there's something special about those. And that makes me ask another question. Since all the serial apps have start methods that specify pins 30 & 31 for serial communications, does that mean theoretically you could use any two pins for serial?

Sorry if I'm rambling, my mind wanders a little too easily.

JW

Comments

  • Luis DigitalLuis Digital Posts: 371
    edited 2009-11-21 20:47
    They have a special use to boot, but then (in your applications) can use any combination.
  • sylvie369sylvie369 Posts: 1,622
    edited 2009-11-21 20:49
    I believe you'll find that if you use pins other than 28 and 29 for I2C, that you need to make sure that you add 1K pullup (to 3.3V) resistors to those pins, or at least to the one that you use for SDA.

    I'm no EE either, but I tried using a couple of other pins (just because they were in the neighborhood), and went bananas trying to figure out why they weren't working, until I posted to the forum and someone walked me through it. That was over a year ago, and I can't find the thread now, but it was extremely helpful. Hopefully one of those folks will chime in here and explain it again: I could use a refresher.

    Post Edited (sylvie369) : 11/21/2009 8:55:14 PM GMT
  • Mike GreenMike Green Posts: 23,101
    edited 2009-11-21 20:54
    Yes, any two I/O pins can be used for I2C. Pins 28 and 29 happen to be used that way during the boot process (coded into the software), but there's nothing special about them. The I2C protocol does require a pullup resistor on the SDA line and should have a pullup resistor on the SCL line, but can work with only the one resistor if there's only one bus master and no clock stretching done.

    Most of the I2C I/O driver software in the Propeller Object Exchange is written to use any pair of I/O pins for I2C.
Sign In or Register to comment.