MPU-9250 MPU9250BasicAHRS_I2C troubleshooting

Have questions about a SparkFun product or board? This is the place to be.

Moderators: phalanx, TS-Tim

MPU-9250 MPU9250BasicAHRS_I2C troubleshooting

Postby Slaghton » Fri Mar 17, 2017 5:07 pm

Hi, I recently bought the Sparkfun MPU-9250 and hooked it up to my arduino mega but I think im doing something wrong. Loading up the MPU9250BasicAHRS_I2C example script and uploading I get this in the serial monitor.

Code: Select all
MPU9250 I AM 0x71 I should be 0x71
MPU9250 is online...
BHW::ii = 0
BHW::ii = 1
BHW::ii = 2

//This repeats till 199, saving thread space.

BHW::ii = 199
x-axis self test: acceleration trim within : 2.7% of factory value
y-axis self test: acceleration trim within : -0.6% of factory value
z-axis self test: acceleration trim within : 2.0% of factory value
x-axis self test: gyration trim within : -4.7% of factory value
y-axis self test: gyration trim within : -1.0% of factory value
z-axis self test: gyration trim within : 0.9% of factory value
MPU9250 initialized for active data mode....
AK8963 I AM 0xFF I should be 0x48
Communication failed, abort!


I'm new to this but I was hoping there was a working example to learn and build myself up from. Can anyone share a tip on what I should do?
Slaghton
 
Posts: 3
Joined: Fri Mar 17, 2017 5:00 pm

Re: MPU-9250 MPU9250BasicAHRS_I2C troubleshooting

Postby Slaghton » Sat Mar 18, 2017 8:20 pm

(Didn't see ability to edit my main post)
I want to say I got it working and it seems to be reading all the axis correctly by making the change belo.

I just commented out this block of code
Code: Select all
    //    if (d != 0x48)
    //    {
    //      // Communication failed, stop here
    //      Serial.println(F("Communication failed, abort!"));
    //      Serial.flush();
    //      abort();
    //    }


Though, I wonder if i just bypassed something and temporarily fixed the problem. I believe what its trying to do here is communicate with the magnetometer but I seem to get readings from it with this fix so idk.
Slaghton
 
Posts: 3
Joined: Fri Mar 17, 2017 5:00 pm

Re: MPU-9250 MPU9250BasicAHRS_I2C troubleshooting

Postby DanV » Mon Mar 20, 2017 11:30 am

At this gitHub site
https://github.com/sparkfun/SparkFun_MPU-9250_Breakout_Arduino_Library/tree/master/examples/MPU9250BasicAHRS_I2C

the .INO download has a comment next to it:

"Added SPI capabilities. WARNING: Not reading from AK8963 over SPI yet."
that chunk of code you commented out might be trying to read the AK8963 over SPI.

But then I also do not know how / why you're getting readings ...
DanV
 
Posts: 254
Joined: Sat Apr 25, 2015 9:29 am

Re: MPU-9250 MPU9250BasicAHRS_I2C troubleshooting

Postby Slaghton » Mon Mar 20, 2017 2:31 pm

Ah, thanks for the info. There is two sketches I can use (I2C and SPI) and i'm using the I2C. I believe the SPI was giving me more problems so that makes sense. I'll have to look into this more later. For now, it seems I can get correct axis readings on all axis so i'll just leave it be till i'm hooking the chip up to my robot. Will probably learn more later as I progress.
Slaghton
 
Posts: 3
Joined: Fri Mar 17, 2017 5:00 pm

Re: MPU-9250 MPU9250BasicAHRS_I2C troubleshooting

Postby rony albert » Tue Mar 21, 2017 5:11 am

In my case it ends up with configuration. I have checked everything twice but still facing same issue please help me how can i tackle it down. Prompt response would be much appreciated!
rony albert
 
Posts: 4
Joined: Tue Mar 21, 2017 5:07 am


Return to SparkFun Product Questions

Who is online

Users browsing this forum: Majestic-12 [Bot] and 11 guests