fix(power): use BQ25896 ADC for both battery voltage and presence#10442
Draft
DatanoiseTV wants to merge 1 commit into
Draft
fix(power): use BQ25896 ADC for both battery voltage and presence#10442DatanoiseTV wants to merge 1 commit into
DatanoiseTV wants to merge 1 commit into
Conversation
getBattVoltage on the BQ27220+BQ25896 combo returned the fuel-gauge reading while isBatteryConnect derived presence from the BQ25896 charger ADC. The two could disagree on a freshly-attached cell before the fuel gauge had learned: hasBattery would say false but voltage 4.0V, and the upstream PowerFSM would treat the unit as externally powered. Read voltage from the same source as presence so both views move together.
8 tasks
Collaborator
|
@DatanoiseTV you wrote:
The T-Deck does not have a BQ27220/BQ25896 charger/gauge, it uses GPIO ADC battery pin 4. Please use T-Lora Pager or T-Deck Pro for tests with BQ27220/BQ25896. Also, the BQ27220 has a more accurate voltage reporting as it implements the calibrated charging curve and automatically learns the charge capacity from previous full battery cycles. |
Collaborator
|
Be very careful - the bq25896 is currently linked to another bq module for "fuel gauging" and also shares an i2c address with some other common sensors. |
Collaborator
|
yeah, T-Deck I2C keyboard and BQ27220 also have the same I2C address 0x55. Maybe that's where the confusion came from. |
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.

getBattVoltage on the BQ27220+BQ25896 combo returned the fuel-gauge
reading while isBatteryConnect derived presence from the BQ25896
charger ADC. The two could disagree on a freshly-attached cell before
the fuel gauge had learned: hasBattery would say false but voltage
4.0V, and the upstream PowerFSM would treat the unit as externally
powered. Read voltage from the same source as presence so both views
move together.
Split out from #10425 — single-concern PR.
Build verification
pio run -e t-deck-tftsucceeds, no new warnings.Attestations
t-deck-tftonly.