Open HughAndersonNUS opened 6 years ago
Hi - I will answer my own question.
It turns out that if you use DMP, the interrupt rate is determined by more than just the sample rate divisor. The last byte in the dmpConfig array in MPU6050_6Axis_MotionApps20.h also affects it.
If it is 0x01:
........ 0x02, 0x16, 0x02, 0x00, 0x01 // D_0_22 inv_set_fifo_rate
then mpu.setRate(9) results in 50Hz, not 100Hz. On the other hand, if it is 0x00:
........ 0x02, 0x16, 0x02, 0x00, 0x00 // D_0_22 inv_set_fifo_rate
then mpu.setRate(9) results in 100Hz. Hooray!
Cheers Hugh
Hi, I am confused by the behaviour of the MPU6050. It seems to have an interrupt rate sample rate that is one half what is expected from the data sheets. For example, if I take the MPU6050_DMP6 example, the default sample/interrupt rate appears to be 100Hz (even though the sample rate divisor is set in the initialization (MPU6050_6Axis_MotionApps20.h) to give a sample rate of 200Hz). If I add in mpu.setRate(9) in the initialization:
I now get 50Hz interrupts! Has anyone else noticed this effect? Does it happen only when using DMP? I have a few different systems here, and they all seem to act in this way. Cheers Hugh