limon Posted February 2, 2014 Report Share Posted February 2, 2014 Hello all! I am running MPU 6050 example. Every time after burning arduino i see this in the com port monitor: Initializing I2C devices... Testing device connections... MPU6050 connection successful Send any character to begin DMP programming and demo: Initializing DMP... Enabling DMP... Enabling interrupt detection (Arduino external interrupt 0)... DMP ready! Waiting for first interrupt... And this waiting can last VERY long... When I delete this while loop: while (!mpuInterrupt && fifoCount < packetSize) { // other program behavior stuff here // . // . // . // if you are really paranoid you can frequently test in between other // stuff to see if mpuInterrupt is true, and if so, "break;" from the // while() loop to immediately process the MPU data // . // . // . } Everything works OK... No waiting at all, and I see data immediately. This is the question. Must I wait for interrupt or I can read data from MPU (mpu.dmpGetXXXXXXXX) every time I need? lapedNok 1 Quote Link to comment Share on other sites More sharing options...
luisrodenas Posted February 3, 2014 Report Share Posted February 3, 2014 Well, if it works for you... then I guess you can read it using (mpu.dmpGetXXXXXXXX) every time you want, but be sure to read it at a faster frecuency than DMP is running, or fifo will overflow. Anyway, I haven't checked how does this (mpu.dmpGetXXXXXXXX) function work, so I am only speculating. Besides, this long wait you mention has never happened to me. Are you sure that INT pin is connected where it should be connected? limon and nidhin jacob 2 Quote Link to comment Share on other sites More sharing options...
limon Posted February 3, 2014 Author Report Share Posted February 3, 2014 Well, if it works for you... then I guess you can read it using (mpu.dmpGetXXXXXXXX) every time you want, but be sure to read it at a faster frecuency than DMP is running, or fifo will overflow. Anyway, I haven't checked how does this (mpu.dmpGetXXXXXXXX) function work, so I am only speculating. Besides, this long wait you mention has never happened to me. Are you sure that INT pin is connected where it should be connected? Thanks, luisrodenas, for your reply! Here is how I connected MPU to my Arduino UNO: Is it right? And what frequency has DMP? Quote Link to comment Share on other sites More sharing options...
luisrodenas Posted February 3, 2014 Report Share Posted February 3, 2014 That's rigth if you only want to use RAW values... or if you read fifo whenever you want... but the optimal way is by interruptions. Read the DMP sketch's comments. In order to use interruptions you have to connect your MPU's INT pin to Arduino UNO's 0 pin. By default DMP runs at 100Hz, but can be modified if you want to. (Max is 200Hz) limon 1 Quote Link to comment Share on other sites More sharing options...
reptooyep Posted June 29, 2016 Report Share Posted June 29, 2016 Hi there, This thread is interresting for me cause i have a problem with MPU6050. It works fine with my standalone ATMEGA328P but when i want to make it work with my GPS unit (works fine alone), the gyro is too intrusive and the gps freeze after a while. I try to get rid of the interrupt but i can't get anything exept "nan" instead of the pitch and roll value. I took the DMP code for my sketch. Any idea to get the values without interrupt ? nidhin jacob 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.