Dear Friends,
I'm trying to use SparkFun MPU-9250 DMP Arduino Library
to read and process values from MPU-9250 on Arduino Fio v3
SparkFun 9DoF IMU Breakout - ICM-20948 (Qwiic) - SEN-15335 - SparkFun Electronics
Fio v3 - ATmega32U4 - DEV-11520 - SparkFun Electronics
I'm using the
9DoF Razor IMU M0 Hookup Guide - SparkFun Learn
to help me along.
I got the acceleration, gyro and temperature data from the sensor, all looks pretty good, as long as dmpBegin call is commented out. If that call is enabled, the Fio becomes a brick upon uploading the sketch.
I get the 'USB Device Not Recognized' windows message and have to do the 'double reset' trick and load another sketch. I've tried it several times, with very consistent results.
I'm using Xbee to send data back to PC. In case when the dmpBegin call is enabled i don't get any serial data at all. When its disabled, imu.begin() returns 0 and i can read the sensor; unfortunately I cannot use features of the DMP library.
I appreciate all and any help.
Here is the Code:
#include <SparkFunMPU9250-DMP.h>
MPU9250_DMP imu;
void setup()
{
Serial1.begin(115200);
Serial1.println(F("Initializing IMU..."));
unsigned short usInit = imu.begin();
if(usInit!=0){
while(true){
Serial1.println("Fail to Communicate" + String(usInit));
delay(2000);
}
}
else {
Serial1.println("MPU9250 Online!");
//Enable the following lines to brick Fio:
// imu.dmpBegin(DMP_FEATURE_6X_LP_QUAT | // Enable 6-axis quat
// DMP_FEATURE_GYRO_CAL, // Use gyro calibration
// 10); // Set DMP FIFO rate to 10 Hz
}
}