Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dmp_set_fifo_rate() dependent on SMPLRT_DIV #4

Open
vcortex91 opened this issue Feb 14, 2017 · 0 comments
Open

dmp_set_fifo_rate() dependent on SMPLRT_DIV #4

vcortex91 opened this issue Feb 14, 2017 · 0 comments

Comments

@vcortex91
Copy link

vcortex91 commented Feb 14, 2017

Note that this concerns a src/util file, and therefore may be out of the scope of Sparkfun contributions.

in dmp_set_fifo_rate() (line 648 of src/util/inv_mpu_dmp_motion_driver.c), I had to change the function to reflect that the DMP FIFO rate appeared to be 4x larger than what I expected it to be:

div hz_expected hz_actual
0 200 800
1 100 400
3 50 200
4 40 160
7 25 100
15 12.5 50

Other relevant configuration is that gyro was set to 1kHz (DLPF_CFG to 0x01) since I read in the datasheet that DMP would not function if there was an 8kHz sampling rate, which is default for gyro. Note that accel sampling rate is 1kHz by default.

However, when I set the SMPLRT_DIV to 0x04 (i.e. 1kHz/(4+1) = 200Hz), I get frequencies that I would expect based on the existing code.

And finally, when I set the SMPLRT_DIV to 0x09 (i.e. 1kHz/(9+1) = 100Hz), I get frequencies that are 2x small than expected.

My point is that the DMP FIFO rate appears dependent on SMPLRT_DIV. That relationship seems to be that the DMP FIFO further subdivides SMPLRT_DIV, but maxes out at 800Hz. Therefore, dmp_set_fifo_rate() assumes SMPLRT_DIV = 0x04 s.t. 1kHz/(4+1) = 200Hz.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant