kriswiner / MPU9250

Arduino sketches for MPU9250 9DoF with AHRS sensor fusion
1.04k stars 471 forks source link

MPU9250 I AM 0x0 I should be 0x71. Could not connect to MPU9250 (Pro Mini 3v) #211

Open antpgomes opened 7 years ago

antpgomes commented 7 years ago

Hi Everyone

I read through all the posts and for the life of me I can't figure this out.

I have a sparkfun mpu9250, i see it as i2c address 0x68 on the scanner but i can't seem to get the example code to work.

I changed the following line: byte c = myIMU.readByte(0x68, WHO_AM_I_MPU9250); to reflect the address but still no luck.

Any help would be appreciated.

EDIT: I also tried pulling the CS pin high to no avail

lukecaj commented 6 years ago

I'm having the same sort of issue on my Arduino Zero, except I get a value of 0x1. I see 0x68 returned in the I2C scan list, but not 0x71.

kriswiner commented 6 years ago

0x68 is the MPU9250 I2C addresYou have to read the WHO_AM_I register of the MPU9250 to get 0x71.

On Fri, Mar 16, 2018 at 3:08 PM, Luke notifications@github.com wrote:

I'm having the same sort of issue on my Arduino Zero, except I get a value of 0x1. I see 0x68 returned in the I2C scan list, but not 0x71.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU9250/issues/211#issuecomment-373858204, or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qgnP5Li0Zt3OQ3oTX_HZBn3hJIXWks5tfDflgaJpZM4Qt4rL .

kriswiner commented 6 years ago

Are there pullups on the board? Are they working? If you scan for I2C devices what do you see?

On Thu, May 10, 2018 at 6:32 AM, yNosGR notifications@github.com wrote:

I am having the same problem with an amazon MPU9250 board on an 8266. @kriswiner https://github.com/kriswiner, the line @antpgomes https://github.com/antpgomes references above: byte c = myIMU.readByte(0x68, WHO_AM_I_MPU9250); reads i2c address 0x68 and the WHO_AM_I_MPU9250 register (0x75) into byte c.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU9250/issues/211#issuecomment-388054046, or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qj_3FTZqX4YybrFyEb-ezDIOFZlqks5txEFjgaJpZM4Qt4rL .

yNosGR commented 6 years ago

When I scan for devices, I see the bmp180 and the MPU9250; I can poll the bmp180 w/o issue - maybe the 9250 wants to be the only one on the bus? -------8<--snip-->8------- Scanning... I2C device found at address 0x68 ! I2C device found at address 0x77 ! done -------8<--snip-->8-------

kriswiner commented 6 years ago

No, multiple devices can be on the bus, that is the whole point of I2C.

And when you read the WHO_AM_I register, what do you get?

On Thu, May 10, 2018 at 10:02 AM, yNosGR notifications@github.com wrote:

When I scan for devices, I see the bmp180 and the MPU9250; I can poll the bmp180 w/o issue - maybe the 9250 wants to be the only one on the bus? -------8<--snip-->8------- Scanning... I2C device found at address 0x68 ! I2C device found at address 0x77 ! done -------8<--snip-->8-------

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU9250/issues/211#issuecomment-388117210, or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qp6KvOAMRu3RWLsDAgY2ZXmbtXGDks5txHKqgaJpZM4Qt4rL .

yNosGR commented 6 years ago

It replies with a 0x0, like OP.

kriswiner commented 6 years ago

Maybe a crappy sensor, or bad I2C API

On Thu, May 10, 2018 at 10:43 AM, yNosGR notifications@github.com wrote:

It replies with a 0x0, like OP.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU9250/issues/211#issuecomment-388129088, or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qgOjHFDL_z-TayEQvPuL1Awhj6jiks5txHxSgaJpZM4Qt4rL .

yNosGR commented 6 years ago

Since I am using the arduino IDE, I'll blame it on the sensor.

kriswiner commented 6 years ago

Can you try another sensor then. it could be something wrong with your Wire.h calls.

On Fri, May 11, 2018 at 5:00 AM, yNosGR notifications@github.com wrote:

Since I am using the arduino IDE, I'll blame it on the sensor.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU9250/issues/211#issuecomment-388343632, or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qhgYNgI9PoxFmguzvUj9_8NEbRv9ks5txX1FgaJpZM4Qt4rL .

yNosGR commented 6 years ago

I just got a sparkfun board in, wired it up with the same results. The puzzling part is that I am able to communicate with both the bmp180 and bmp280 sensors have here w/o issue. I am not sure what is different about the mpu9250. Oh.. I forgot about the DS1307 on there as well..

kriswiner commented 6 years ago

Do you have pullups enabled on the Sparkfun board?

On Wed, May 16, 2018 at 9:04 AM, yNosGR notifications@github.com wrote:

I just got a sparkfun board in, wired it up with the same results. The puzzling part is that I am able to communicate with both the bmp180 and bmp280 sensors have here w/o issue. I am not sure what is different about the mpu9250.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU9250/issues/211#issuecomment-389574253, or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qn90-DEpe79-OY-xfvGK8lDJmzXUks5tzE4RgaJpZM4Qt4rL .

yNosGR commented 6 years ago

Would I need them on all devices? Currently they are on the bmp180 board, the last device in the chain.

kriswiner commented 6 years ago

No, just somewhere on the I2C bus. Do you have to enable the I2C bus some how on the Sparkfun board? Did you follow their tutorial? Maybe a bad board? Better ask Sparkfun...

On Wed, May 16, 2018 at 11:24 AM, yNosGR notifications@github.com wrote:

Would I need them on all devices? Currently they are on the bmp180 board, the last device in the chain.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU9250/issues/211#issuecomment-389618412, or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qk2ZkYZBXlvbYWy7rxORbTCqrM6Qks5tzG7dgaJpZM4Qt4rL .