Hi,
In my application, I am using the MPU-6050 with Motion Driver 5.1.3. I would like to have the IMU sensors (gyro/accel) run at a high sample rate such as 200Hz so that the DMP can perform its processing accurately, but I would like the DMP to report to my MCU at a much lower rate of 8Hz, in order to free its time for processing other tasks. Is this possible?
With the DMP and MPU library, if I set the DMP's fifo rate to a low rate like 1Hz or 2Hz, I still get interrupts at a very high frequency (probably 200Hz or around that much). However, when I read from the FIFO, there's nothing there except at the rate I configured the DMP at. As a result I am wasting a lot of cycles just checking the fifo and seeing that there's nothing there. Looking at the DMP source code comments in dmp_set_interrupt_mode(), this seems to be intended behaviour as I have either the option of setting a FIFO period as the interrupt rate, or when a tap event occurs, which is not applicable to me. I am wondering if there's a way around this.
I noticed in the library source code that when I set the DMP state to enabled using mpu_set_dmp_state(), it automatically sets the MPU sample rate to 200Hz (hardcoded). I could manually change it to whatever rate I'd like in the source code, and it does indeed reduce the interrupt rate, but I am worried that the DMP will not work correctly if I did. Will this be the case, or is this a good solution to the problem?