I2C pin choices
sylvie369
Posts: 1,622
I'm trying to use an LIS302DL accelerometer with an I2C interface on a Propeller Protoboard. I set it up with SCL and SDA as pins 0 and 1, but I get no response from the device. To see where the problem was, I took it off and set it up on a Propstick, using pins 28 and 29 there: that worked fine. Then I moved the wires over to pins 0 and 1 (and changed the code), and again, no response. I did dig through the various objects called by the program (lis302dlobject and Basic_i2c_Driver) to see if pin 28 was hard-coded anywhere: that didn't seem to be the problem. I did some other trouble-shooting, such as calling readlocation in the Basic_i2c_Driver directly from my own program: same results. It works if I use pins 28 and 29, and does not work if I use pins 0 and 1. This matters, by the way, because pins 28 and 29 are not available on the Protoboard.
So just now I remembered that on the BS2pe Mobo there are only a couple of different pin options for i2c, and I thought maybe that's the case for the Propeller as well. I moved it over to pins 8 and 9 on the Propstick, and sure enough, it worked. That should work for me on the Protoboard (those pins are available and in a good position), but I'm a bit mystified about why. I'd thought that you could use any consecutive pair of pins for i2c. Are only certain pins available for SCL and SDA i2c connections?
So just now I remembered that on the BS2pe Mobo there are only a couple of different pin options for i2c, and I thought maybe that's the case for the Propeller as well. I moved it over to pins 8 and 9 on the Propstick, and sure enough, it worked. That should work for me on the Protoboard (those pins are available and in a good position), but I'm a bit mystified about why. I'd thought that you could use any consecutive pair of pins for i2c. Are only certain pins available for SCL and SDA i2c connections?
Comments
Thanks.