I2C Nightmare
hylee101001
Posts: 48
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.
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
I suppose that's possible, but the probability is exceedingly small.
That's also possible, but again, the probability is small.
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?
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.
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.
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,