SparkFun Forums 

Where electronics enthusiasts find answers.

Have questions about a SparkFun product or board? This is the place to be.
By tBone
#199142
Hello,
I'm trying to use SparkFun MPU-9250 DMP Arduino Library
https://github.com/sparkfun/SparkFun_MP ... no_Library
to read and process values from MPU-9250 on Sparkfun Fio v3 (Atmega 32U4, same as Pro Micro).
https://www.sparkfun.com/products/13762
https://www.sparkfun.com/products/11520
I'm using the
https://learn.sparkfun.com/tutorials/9d ... no-library
tutorial 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:
Code: Select all
#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
     }
}