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

Rework science code to use interrupts #156

Open
tabiosg opened this issue Jun 28, 2022 · 1 comment
Open

Rework science code to use interrupts #156

tabiosg opened this issue Jun 28, 2022 · 1 comment
Assignees
Labels
good first issue Good for newcomers nucleo

Comments

@tabiosg
Copy link
Collaborator

tabiosg commented Jun 28, 2022

The current architecture of the science code is a round robin w/ interrupts. In the round robin (the loop) is code to read from the thermistors and the spectral sensors. This loop currently takes quite a while to run (about a full second per loop) because reading takes a long time.

A good issue for (new) members next year to tackle is figuring out how to make this faster by either messing around with the hardware (e.g. what registers we're reading from and if it's an issue because of i2c/adc read transaction settings) or changing the software architecture (e.g. move spectral code into interrupts instead).

For reference, here is the link to the code for the loop that takes long to run: https://github.com/umrover/embedded-testbench/blob/official_science/science_nucleo_g0/Core/Src/main_loop.c#L18

@qhdwight
Copy link
Collaborator

I don't know enough about this particular system but in general you want to use interrupts. Any blocking operation should be avoided.

@tabiosg tabiosg changed the title Science code loop is too slow Rework science code to use interrupts May 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers nucleo
Projects
None yet
Development

No branches or pull requests

3 participants