Shop OBEX P1 Docs P2 Docs Learn Events
I2C Nightmare — Parallax Forums

I2C Nightmare

hylee101001hylee101001 Posts: 48
edited 2015-03-01 22:28 in Propeller 1
Hi I'm using propeller ASC.

I have been wasting my time on I2C because some device (all have internal pull-ups) are returning 0 ack when written the device address.

For example, some mpu9150 is returning ack when 11010000 is sent. But some of them are not. This is same for altimeter module ms5607 that I bought from parallax.com. Now my only guess is this, i have ordered 10 mpus and 9 of them are defect. What a coincidence!. Or propeller ASC has some limits that I wasn't aware of. Has anyone went through this kind of frustration? Or Do any one have any other better guess on this issue?

thanks.

Comments

  • r.daneelr.daneel Posts: 96
    edited 2015-03-01 17:35
    Now my only guess is this, i have ordered 10 mpus and 9 of them are defect. What a coincidence!.

    I suppose that's possible, but the probability is exceedingly small.
    Or propeller ASC has some limits that I wasn't aware of. Has anyone went through this kind of frustration?

    That's also possible, but again, the probability is small.

    Or Do any one have any other better guess on this issue?

    More likely your code and/or your setup has a defect that you're not aware of. Could you post your code here, and a schematic of your setup?
  • Mike GreenMike Green Posts: 23,101
    edited 2015-03-01 21:45
    The Propeller ASC has 2.2K resistors in series with the Propeller's I/O pins that are connected to the Arduino headers. These are provided to protect the 3.3V Propeller I/O pins from possible 5V logic signals on the Arduino headers, but they can interfere with high speed I/O like I2C. On the other hand, if your mpu9150 or ms5607 boards have pullups to 5V on the I2C lines, the Propeller I/O pins can be damaged without the built-in 2.2K resistors. It all depends on the specifics of how things are connected.

    The SparkFun breakout board for the MPU9150 looks like it can operate with Vcc = 3.3V. In that case, you can solder the ASC jumpers to bypass the 2.2K resistors on the I/O pins you want to use for SDA and SCL. If you operate the MS5607 with VIN = 3.3V, you can bypass the 2.2K resistors on the I/O pins for the MS5607's SDA and SCL signals too.

    The ASC board also has an AUX connector that allows you to directly use several Propeller I/O pins. If you run the MS5607 and MPU9150 off 3.3V, you can connect their SDA and SCL I/O pins directly to the Propeller's I/O pins.
  • DomanikDomanik Posts: 233
    edited 2015-03-01 21:45
    All of the many problems I recently had with the propeller and I2C were self inflicted. The good news is I know more now than when I first started and it seems to be much easier to work with.

    BTW: the MPU9150 can also have an address of 11010001. I took a quick look at the datasheet and there's a lot to this device. It even has a master and aux modes.

    I2C has more than one mode, the most common is open drain, but others don't use the pullup resistors. The IC internal device pullups I've seen are ~10k-20k. I wouldn't count on those and would use external 3k pullups. Some devices will "lock up" if a different address has not acknowledged, for example if the master tries to talk to a slave that's not there. Good luck.
  • DomanikDomanik Posts: 233
    edited 2015-03-01 21:57
    Mike, it seems a 2.2K resistors in series and a stiff pullup at the MPU9150 might work as voltage divider. In that case the output of the propeller wouldn't go low enough. The 10K pullups on the MPU board set it at 0.6 volts for a low or higher if there are more pullups in parallel.
  • Clive WakehamClive Wakeham Posts: 152
    edited 2015-03-01 22:28
    Hi I'm using propeller ASC.

    I have been wasting my time on I2C because some device (all have internal pull-ups) are returning 0 ack when written the device address.

    Has anyone went through this kind of frustration? Or Do any one have any other better guess on this issue?

    thanks.

    I had a similar issue a while ago trying to get a RTC to work.

    Tried everything and had the same issue as you, until I finally got out a magnifying glass and looked at the product code on the chip. It wasn't the chip I had ordered, it was another RTC so it had a different address and different codes to access.

    Once I modified my code it worked as expected.

    Regards,
Sign In or Register to comment.