kriswiner / MPU9250

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

I am 0xFF I should be 0x48 error #237

Open dibs06 opened 6 years ago

dibs06 commented 6 years ago

I am using Sparkfun IMU M0 which combines a MPU9250 and SMD21 microprocessor . I am using Arduino mega and I2C communication protocol for data processing. I am using your AHRS code fro sensor calibration and processong the data. But I get some error which may be the i2c program error I was first used I2C check and its return

Scanning... I2C device found at address 0x0C ! I2C device found at address 0x68 ! done

Then I was compile your AHRS code and its returns

MPU9250 initialized for active data mode.... AK8963 I AM 0xFF I should be 0x48 Communication failed, abort!

what should I do? Please give me some Idea about AHRS code Thank you

kriswiner commented 6 years ago

No idea, did you enable pass through mode on the MPU9250?

On Mon, Feb 19, 2018 at 11:39 PM, dibs06 notifications@github.com wrote:

I am using Sparkfun IMU M0 which combines a MPU9250 and SMD21 microprocessor . I am using Arduino mega and I2C communication protocol for data processing. I am using your AHRS code fro sensor calibration and processong the data. But I get some error which may be the i2c program error I was first used I2C check and its return

Scanning... I2C device found at address 0x0C ! I2C device found at address 0x68 ! done

Then I was compile your AHRS code and its returns

MPU9250 initialized for active data mode.... AK8963 I AM 0xFF I should be 0x48 Communication failed, abort!

what should I do? Please give me some Idea about AHRS code Thank you

— 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/237, or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qrwGrHIowIdYUD-Ak3dTyNwsQ3c1ks5tWnaVgaJpZM4SLh1k .

dibs06 commented 6 years ago

How to enable pass through mode in MPU9250? I have no idea about that. Your cooperation is highly appreciated kris. Thank you

kriswiner commented 6 years ago

Did you read the data sheet and register map? Look at the sketches in this repository?

On Tue, Feb 20, 2018 at 8:56 PM, dibs06 notifications@github.com wrote:

How to enable pass through mode in MPU9250? I have no idea about that. Your cooperation is highly appreciated kris. Thank you

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

kriswiner commented 6 years ago

// Configure Interrupts and Bypass Enable // Set interrupt pin active high, push-pull, hold interrupt pin level HIGH until interrupt cleared, // clear on read of INT_STATUS, and enable I2C_BYPASS_EN so additional chips // can join the I2C bus and all can be controlled by the Arduino as master writeByte(MPU9250_ADDRESS, INT_PIN_CFG, 0x12); // INT is 50 microsecond pulse and any read to clear writeByte(MPU9250_ADDRESS, INT_ENABLE, 0x01); // Enable data ready (bit 0) interrupt

On Tue, Feb 20, 2018 at 9:40 PM, Tlera Corporation tleracorp@gmail.com wrote:

Did you read the data sheet and register map? Look at the sketches in this repository?

On Tue, Feb 20, 2018 at 8:56 PM, dibs06 notifications@github.com wrote:

How to enable pass through mode in MPU9250? I have no idea about that. Your cooperation is highly appreciated kris. Thank you

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

glucee commented 6 years ago

@kriswiner I have the same problem, my code comes from Sparkfun, https://github.com/sparkfun/SparkFun_MPU-9250_Breakout_Arduino_Library

The code for enable bypass is:

// Configure Interrupts and Bypass Enable // Set interrupt pin active high, push-pull, hold interrupt pin level HIGH // until interrupt cleared, clear on read of INT_STATUS, and enable // I2C_BYPASS_EN so additional chips can join the I2C bus and all can be // controlled by the Arduino as master. writeByte(MPU9250_ADDRESS, INT_PIN_CFG, 0x22); // Enable data ready (bit 0) interrupt writeByte(MPU9250_ADDRESS, INT_ENABLE, 0x01);

I have changed 0x22 to 0x12, but I still get 0xFF.

@dibs06 have you solved your problem yet ?

kriswiner commented 6 years ago

Do you have this in your code?

// Configure Interrupts and Bypass Enable // Set interrupt pin active high, push-pull, hold interrupt pin level HIGH until interrupt cleared, // clear on read of INT_STATUS, and enable I2C_BYPASS_EN so additional chips // can join the I2C bus and all can be controlled by the Arduino as master writeByte(MPU9250_ADDRESS, INT_PIN_CFG, 0x12); // INT is 50 microsecond pulse and any read to clear writeByte(MPU9250_ADDRESS, INT_ENABLE, 0x01); // Enable data ready (bit 0) interrupt

On Wed, Mar 21, 2018 at 10:37 AM, glucee notifications@github.com wrote:

@kriswiner https://github.com/kriswiner I have the same problem, my code comes from Sparkfun

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

naveedanwarbhatti commented 6 years ago

@dibs06 @glucee I'm facing the same problem. Have you guys solved your problem yet?

glucee commented 6 years ago

@naveedanwarbhatti Yes, I did, you could find my correction in https://github.com/glucee/SparkFun_MPU-9250_Breakout_Arduino_Library or you just clone from my code

naveedanwarbhatti commented 6 years ago

@glucee Thanks a lot. It worked

BhavyaKrishna commented 6 years ago

I am a kind of new to this ..pardon me if my doubt is too silly..I am facing the same issue and when I add the suggested code, I am getting the error that 'writeByte' was not declared in this scope..what should I do?

kriswiner commented 6 years ago

You will need to define the writeByte method; cpy from one of the reposited sketches? Which MCU are you using?

On Thu, May 17, 2018 at 10:22 PM, BhavyaKrishna notifications@github.com wrote:

I am a kind of new to this ..pardon me if my doubt is too silly..I am facing the same issue and when I add the suggested code, I am getting the error that 'writeByte' was not declared in this scope..what should I do?

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

BhavyaKrishna commented 6 years ago

I am using ATMEGA328 on the arduino UNO

kriswiner commented 6 years ago

This sketch doesn;t work?

https://github.com/kriswiner/MPU9250/blob/master/MPU9250BasicAHRS.ino

On Thu, May 17, 2018 at 10:28 PM, BhavyaKrishna notifications@github.com wrote:

I am using ATMEGA328 on the arduino UNO

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

BhavyaKrishna commented 6 years ago

I didn't try this code .I tried the MPU9250BasicAHRS_I2C.ino. I will try this and tell..Thanks for the quick reply.

BhavyaKrishna commented 6 years ago

I am getting the error not enough memorywhen i ran that code .Do you by any chance know smaller code just to serially print the roll, pitch and yaw alone without all the lcd part? also I tried defining a method for writebyte, but the error still persisted .

naveedanwarbhatti commented 6 years ago

try this one: https://github.com/naveedanwarbhatti/MPU-9250-Arduino

BhavyaKrishna commented 6 years ago

I am getting the same error again. AK8963 I AM 0xFF I should be 0x48 Communication failed, abort!.. How exactly did you overcome the error.And did you also use UNO?

naveedanwarbhatti commented 6 years ago

I changed the AK8963 from 0x49 to 0x00 (thanks to @glucee) and it resolved the error.

define WHO_AM_I_AK8963 0x49 -> #define WHO_AM_I_AK8963 0x00

And yes! I'm running it on UNO

naveedanwarbhatti commented 6 years ago

/src/MPU9250.h line#23

BhavyaKrishna commented 6 years ago

Thank you so much it worked..