Fix misconfigured ADC and remove now unnecessary filtering#483
Merged
JF002 merged 5 commits intoInfiniTimeOrg:developfrom Aug 10, 2021
Riksu9000:fix_adc
Merged
Fix misconfigured ADC and remove now unnecessary filtering#483JF002 merged 5 commits intoInfiniTimeOrg:developfrom Riksu9000:fix_adc
JF002 merged 5 commits intoInfiniTimeOrg:developfrom
Riksu9000:fix_adc
Conversation
This was referenced Jul 25, 2021
Contributor
|
Tested this today, indeed it seems to be working as You say. It was even the first time I was able to charge pinetime to 100%! (usually it went up to around 87%) |
deztructor
reviewed
Aug 1, 2021
daniel-thompson
pushed a commit
to wasp-os/micropython
that referenced
this pull request
Nov 8, 2021
In the pinetime, the battery is connected with a 1MOhm resistor, so 3us isn't enough to measure it. The battery is the only place where the ADC is used in the pinetime, so it's ok to hardcode the new value, but it'd be better to make it configurable if contributing upstream. Fixes wasp-os/wasp-os#254 For more details see the same issue in infinitime: InfiniTimeOrg/InfiniTime#483 Signed-off-by: Francesco Gazzetta <fgaz@fgaz.me> [daniel@redfelineninja.org.uk: rebased on v1.15] Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
daniel-thompson
pushed a commit
to wasp-os/micropython
that referenced
this pull request
Nov 8, 2021
In the pinetime, the battery is connected with a 1MOhm resistor, so 3us isn't enough to measure it. The battery is the only place where the ADC is used in the pinetime, so it's ok to hardcode the new value, but it'd be better to make it configurable if contributing upstream. Fixes wasp-os/wasp-os#254 For more details see the same issue in infinitime: InfiniTimeOrg/InfiniTime#483 Signed-off-by: Francesco Gazzetta <fgaz@fgaz.me> [daniel@redfelineninja.org.uk: Rebase from v1.12] Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
fgaz
added a commit
to wasp-os/micropython
that referenced
this pull request
Apr 5, 2024
In the pinetime, the battery is connected with a 1MOhm resistor, so 3us isn't enough to measure it. The battery is the only place where the ADC is used in the pinetime, so it's ok to hardcode the new value, but it'd be better to make it configurable if contributing upstream. Fixes wasp-os/wasp-os#254 For more details see the same issue in infinitime: InfiniTimeOrg/InfiniTime#483 Signed-off-by: Francesco Gazzetta <fgaz@fgaz.me>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There's this table in the SoC datasheet. The battery is connected to the SoC through a 1M resistor, so we must use the longest acquisition time.
After this change, the reported battery voltage is about 100mV higher! The raw measurements are now equally as low noise as the filtered output used before, so the filtering is now unnecessary.
EDIT: If there is still too much noise, hardware oversampling should be used instead of manually averaging samples.