Jump to content
I2Cdevlib Forums

Demo Code Continually Freezes/Crashes


Recommended Posts

The demo DMP sketch continually locks up after anywhere between 3-20 seconds into running. The demo code is unmodified in any way other than commenting out a few of the #define's to limit the output. I get no errors and no FIFO overflows, results appear on the serial monitor...but then the program just hangs.

I have a clean setup here...nothing else attached to the Arduino.

Suggestions??

Link to comment
Share on other sites

  • 3 weeks later...

Hi,

I experience the same problem. Would you, kindly, share the rewritten code that does not use interrupts?

BTW, being totally new to this forum, I don't know how you would do that. In case my email address is required I will gladly give it.

Cheers

Sure, he is sample code rewritten for rapid polling of the DMP with no interrupt. Just call it at least as often as the DMP outputs data (which you can set by editing the Motion_Apps header file).  In a test sketch I had this working at 100 Hz with no errors, and in my full project have it working at 20 Hz reliably with no FIFO errors and stable data.

MPU6050_DMP_Polling.txt

Link to comment
Share on other sites

  • 2 weeks later...

I am experiencing the same problem. My setup is 3.3V at 8MHz. Serial.print appears to be a contributing factor. I have been dumping the fifoCount variable and if it stays at 0 all is ok. Sometimes it starts higher and we get a "FIFO Overflow!" message and then it resumes ok. Other times the fifoCount grows and then nothing.

 

Both Arduino and MPU6050 are new to me. Have some MPU's with voltage regulators on order to try with a faster CPU.

 

I am wondering if the mpuInterrupt flag and while loop are at fault. If there are multiple messages available we should get them all  so as to catche up the the device. Looks to me that we never eat more than packetSize element per interrupt.

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...