Jump to content
I2Cdevlib Forums

MPU9150 sensor Who am I register value inconsistent


Recommended Posts

Hi,

I am using MPU9150 sensor with dsPic33fj128GP802.I have just started to learn about I2C.
I tried checking the value of WHO_AM_I register.I use Mplab in debug mode to check the output.I get 0x68(correct result) only sometime.If I reset and check the result again I get 0XFF or 0x00 or any values most of the time.
I am not sure what the problem would be.Can you suggest how can I approach to resolve this problem so that every time I check the value,I get the correct result(0x68).
 

Looking forward to your help.

cleardot.gif

 

Link to comment
Share on other sites

Maybe solution is run I2C master at slower speed eg. 10kHz or 1kHz and see what happends, if so many strange readings you have?

 

I have MPU-6050 and just finished PC (RS232) <-> I2C interface which will allow me directly from Linux box talk to this MPU via optical isolation-no debug modes needed to test AVRs and this MPU.

This will also allow me to set I2C bus operating voltage to 5V or 3.3V.

I'm able to run my Linux box as I2C master now, and test many I2C devices isolated from PC using big LCD screen and no need to debug mode-just print I2C messages and log them to files on PC :)

 

However, I've implemented MPU detection in I2C, where it first tries talk to 0x68 and if fails uses 0x69 and makes second hit and if success stores detected MPU address for data exchange...

 

This what I'm talking about, but I used custom made I2C library which supports my PC RS232 DE9 <-> I2C board:

 

$ cat i2c_rs232_mpu6050test-ADO1.txt
INFO: RS232 I2C port: /dev/ttyS0
INFO: RS232 I2C speed: 1000.0 [Hz]
INFO: RS232 I2C wait speed: 0.001000 (1000 [us])
INFO: RS232 I2C SCL: 1  SDA: 1
DEBUG: Looking for MPU-6050 slave at default address: 0x68
ERROR: address_slave: 0x68 for write failed
DEBUG: Looking for MPU-6050 slave at other address: 0x69
1|^S1|.0._|_.1|.__.1|.__.0|.__.1|.__.0|.__.0|.__.0|.__.0|._1.|_
S1|.0._|_.1|.__.1|.__.0|.__.1|.__.0|.__.0|.__.1|.__.0|._1.|._
_.0|.__.1|.__.1|.__.1|.__.0|.__.1|.__.0|.__.1|._1.|._
P_0|.1.|
INFO: Found MPU-6050 at I2C address: 0x69
S1|.0._|_.1|.__.1|.__.0|.__.1|.__.0|.__.0|.__.1|.__.1|._1.|._
1_.|.__.|.__.|.__.|.__.|.__.|.__.|.__.|.__.1|._
P_0|.1.|
INFO: This MPU-6050 read who am i address: 0x68
P_0|.1.|

First run and with success at very slow delays 1kHz I2C, but I'm unsure now which is max speed with this new board, so decided start with such low I2C speed. I've MPU-6050 ADO pin connected to 3.3Vcc via 4.7k resistor, so my device I2C address as detected is 0x69, but MPU-6050 corectly returns "who am I" 0x68 as expected and described in its datasheet, so I'm able verify if MPU-6050 is available and at which address regardless of its ADO setting.

 

Used custom board to talk directly from Linux PC RS232 De9 <-> I2C below :

linux_pc_rs232_de9_i2c_mpu6050test_ADO1_

Link to comment
Share on other sites

  • 6 months later...

I am using MPU9150 sensor with dsPic33fj128GP802.I have just started to learn about I2C.

I tried checking the value of WHO_AM_I register.I use Mplab in debug mode to check the output.I get 0x68(correct result) only sometime.If I reset and check the result again I get 0XFF or 0x00 or any values most of the time.
I am not sure what the problem would be.Can you suggest how can I approach to resolve this problem so that every time I check the value,I get the correct result(0x68).

I'm having this same problem. Since the MPU9150 I'm using is embedded in epoxy, I can't test it the grounds.  :(

 

I believe that the correct value for WHO_AM_I is the most significant 6 bits of the address which for either 0c68 or 0x69 would be 0x34.

Not sure why I keep getting 0x14...

 

This value is hard coded in MPU6050.cpp:

bool MPU6050::testConnection() {
    return getDeviceID() == 0x34;
}
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...