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

Bug: Voltage readout sometimes mixes digits #91

Open
jan-Sanku opened this issue Aug 12, 2024 · 2 comments · May be fixed by #92
Open

Bug: Voltage readout sometimes mixes digits #91

jan-Sanku opened this issue Aug 12, 2024 · 2 comments · May be fixed by #92

Comments

@jan-Sanku
Copy link

when the voltage is on the very edge of a 0.1V step (say, 4.200V), the readout sometimes mixes 0.1 and 0.02 digits from separate sensor readings. (at least that's what i think is happening)

expected result at 4.200V: 4.20, 4.22 or 4.18 (may vary between separate readouts)

actual result is any of: 4.20, 4.22, 4.28, 4.10, 4.12, 4.18

so far, tested on versions 0273-2024-04-20, 0125-2024-04-20 and 0135-2024-04-20

@SammysHP
Copy link
Contributor

SammysHP commented Aug 13, 2024

Confirmed. And I thought it was just my imagination...

But it's a pretty easy fix. For the second decimal place blink_num() is called a second time in fsm/adc.c. Between the two calls voltage got updated by the ADC interrupt handler. The solution is to either cache voltage or pass all digits at once to blink_num().

I will fix it today evening (UTC+2).

@jan-Sanku
Copy link
Author

cool, thanks!

SammysHP added a commit to SammysHP/anduril that referenced this issue Aug 13, 2024
An ADC conversion between the two blink_num() calls could potentially
update the voltage in a way the the second digit rolls over and the
resulting number doesn't make sense.

Fixes ToyKeeper#91
@SammysHP SammysHP linked a pull request Aug 13, 2024 that will close this issue
Isilmerie pushed a commit to Isilmerie/anduril that referenced this issue Oct 14, 2024
An ADC conversion between the two blink_num() calls could potentially
update the voltage in a way the the second digit rolls over and the
resulting number doesn't make sense.

Fixes ToyKeeper#91
Isilmerie pushed a commit to Isilmerie/anduril that referenced this issue Oct 14, 2024
An ADC conversion between the two blink_num() calls could potentially
update the voltage in a way the the second digit rolls over and the
resulting number doesn't make sense.

Fixes ToyKeeper#91
Isilmerie pushed a commit to Isilmerie/anduril that referenced this issue Oct 14, 2024
An ADC conversion between the two blink_num() calls could potentially
update the voltage in a way the the second digit rolls over and the
resulting number doesn't make sense.

Fixes ToyKeeper#91
Isilmerie pushed a commit to Isilmerie/anduril that referenced this issue Oct 14, 2024
An ADC conversion between the two blink_num() calls could potentially
update the voltage in a way the the second digit rolls over and the
resulting number doesn't make sense.

Fixes ToyKeeper#91
Isilmerie pushed a commit to Isilmerie/anduril that referenced this issue Oct 14, 2024
An ADC conversion between the two blink_num() calls could potentially
update the voltage in a way the the second digit rolls over and the
resulting number doesn't make sense.

Fixes ToyKeeper#91
Isilmerie pushed a commit to Isilmerie/anduril that referenced this issue Oct 14, 2024
An ADC conversion between the two blink_num() calls could potentially
update the voltage in a way the the second digit rolls over and the
resulting number doesn't make sense.

Fixes ToyKeeper#91
Isilmerie pushed a commit to Isilmerie/anduril that referenced this issue Oct 14, 2024
An ADC conversion between the two blink_num() calls could potentially
update the voltage in a way the the second digit rolls over and the
resulting number doesn't make sense.

Fixes ToyKeeper#91
Isilmerie pushed a commit to Isilmerie/anduril that referenced this issue Oct 14, 2024
An ADC conversion between the two blink_num() calls could potentially
update the voltage in a way the the second digit rolls over and the
resulting number doesn't make sense.

Fixes ToyKeeper#91
Isilmerie pushed a commit to Isilmerie/anduril that referenced this issue Oct 14, 2024
An ADC conversion between the two blink_num() calls could potentially
update the voltage in a way the the second digit rolls over and the
resulting number doesn't make sense.

Fixes ToyKeeper#91
Isilmerie pushed a commit to Isilmerie/anduril that referenced this issue Oct 16, 2024
An ADC conversion between the two blink_num() calls could potentially
update the voltage in a way the the second digit rolls over and the
resulting number doesn't make sense.

Fixes ToyKeeper#91
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

Successfully merging a pull request may close this issue.

2 participants