Skip to content

Sleep during sensor reading methods #15

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

Closed
joshmcculloch opened this issue Nov 26, 2021 · 2 comments · Fixed by #24
Closed

Sleep during sensor reading methods #15

joshmcculloch opened this issue Nov 26, 2021 · 2 comments · Fixed by #24

Comments

@joshmcculloch
Copy link

joshmcculloch commented Nov 26, 2021

Hi, I'm looking for justification for the sleep functions in the sensor reading methods.
There is a commit from May 2020 stating they were added to fix timing issues. But I wonder if they really needed to be added to the sensor reading methods. They significantly reduce the max sample rate on the raspberry pi, and I haven't had any issues since removing them:
516f2dc
I'd like to create a pull request unless I have mistaken their purpose.

@ladyada
Copy link
Member

ladyada commented Nov 26, 2021

you could do a PR, and we may test/merge when we can!

@jposada202020
Copy link
Contributor

Hello, according to my tests, there could be 3 situations that timing is important:

  1. After, Reset (soft-reset) DEVICE_RESET in the PWR_MGMT_1 register
  2. After Sleep
  3. After reading a different memory bank. But, not sure about this.

Maybe the logic behind removing the sleep from the acc, gyro readings was that probable you could read the 6 values (7 with temp) in one shot, so time was less sensitive there.

Disclaimer: I have not tested the ICM20649.

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