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

Compounding lag in sample period #192

Open
udellc opened this issue Apr 14, 2022 · 0 comments
Open

Compounding lag in sample period #192

udellc opened this issue Apr 14, 2022 · 0 comments

Comments

@udellc
Copy link
Member

udellc commented Apr 14, 2022

Describe the bug
Gurpreet observes bug where our sample time stamps creep longer and longer, from the original period set. This is likely because we are scheduling the wake up next alarm signal interrupt for the DS3231 at the end of each sample cycle. But - if a sample cycle takes several seconds, those seconds will be added to the end of each period, delaying further and further.

Hardware in Use
Hypnos, in Loom and outside of Loom

To Reproduce
Use any of the data logging examples.

Expected behavior
Timestamps should be consistent to the period we wish (e.g. timestamp samples should be about 5min apart each time, not 5min +5sec)

Additional context
The proposed fix is just to change the place where we are scheduling all our sample alarms from the End of the sample cycle, to the very Start of the cycle, right after we Wake from the DS3231 interrupt signal. The DS3231 is powered on a coincell and never sleeps - so, we can set the next alarm even before everything else has been properly been powered on (power up cycle).

We need to Test this hypothesis is effective.
Then update all examples with the new order of operations.

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