Repository navigation
Power: set the AXP2101 charge voltage to 4.2V at init (CoreS3 family, Core2 v1.1) - #392
Merged
Merged
Conversation
… Core2 v1.1) The power-on value of REG 0x64 (constant-voltage target) is not always the datasheet default (011b = 4.2V): a CoreS3 SE was reported with 0x64 = 0x00, which is reserved in the current datasheet and was listed as 4.6V in an early revision. The cells on these boards are 4.2V types, so the target is now set explicitly at init, before the TS pin setting that lets the charger start. Chips that already read 0x03 are unaffected. A failed write is logged as a warning. A second Power.begin() call sets 4.2V again (when the write succeeds), replacing a lower target set with setChargeVoltage() before it.
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.
Follow-up to #388 for #387.
The power-on value of the AXP2101 charge-voltage register (
REG 0x64) is not always the datasheet default (011b= 4.2V). The CoreS3 SE in #387 read0x64 = 0x00, which is reserved in the current datasheet and was listed as 4.6V in an early revision. The units here read0x03. M5Unified did not write this register at init, so such a unit charges with whatever the register holds at power-on.The cells on the CoreS3 family and Core2 v1.1 are 4.2V types, so the init now sets 4.2V explicitly through
setChargeVoltage(4200), before the TS pin setting from #388 that lets the charger start. Chips that already read0x03are unaffected. A failed write is logged as a warning.Note: a second
Power.begin()call sets 4.2V again, replacing a lower target set withsetChargeVoltage()before it.Tested on Core2 v1.1: after writing
0x64 = 0x00and restarting the ESP32 (the AXP2101 keeps its registers), the register reads0x03again afterM5.begin().REG 0x67(charge safety timers, also0x00on that unit) is left unchanged here; enabling the timers changes charging behaviour and needs a separate look.