fix: keep button-sense within MCU rail, and add latch-gate margin at low battery - #59
Merged
Merged
Conversation
…low battery Both found by cross-checking a friend's static-analysis tool against our own netlist and datasheets. - R_BTN_PU1 now pulls up to 3V3 instead of VSYS. PWR_BTN_SENSE lands directly on GPIO2, whose ceiling is VDD+0.3V (~3.6V), but idled at VSYS (up to ~4.5V on USB). It also back-fed the unpowered 3V3 rail through the pin's clamp diode when the MCU was off. Safe now that R_INV_BASE1 gives the inverter its own VSYS pull-up, so R_BTN_PU1 no longer supplies it. A divider can't work across the 3.0-4.5V VSYS range (needs >=2.5V to read high but <=3.6V max). - Q_LATCH1 swapped 2N7002 -> AO3400A. With realistic diode drop the gate reaches ~2.4V at VSYS=3.0V, which has no margin against the 2N7002's 2.5V worst-case threshold. AO3400A's Vgs(th) max is 1.45V (same SOT-23 G/S/D pinout, property-only change, no reroute). Layout diagrams/docs updated (callouts D and H); production files regenerated. ERC/DRC clean, all parts have MF/MPN. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
5 tasks
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.
Summary
Two more findings from cross-checking a friend's static-analysis tool against our own netlist and datasheets, each verified before acting:
PWR_BTN_SENSEover-voltage on GPIO2:R_BTN_PU1pulled to VSYS, so the node idled up to ~4.5V on USB against the pin's ~3.6V (VDD+0.3V) ceiling — and back-fed the unpowered 3V3 rail through the pin's clamp diode (~30µA) whenever the MCU was off. Fix:R_BTN_PU1now pulls up to 3V3. This is safe now becauseR_INV_BASE1(last PR) gave the inverter its own VSYS pull-up. A resistor divider can't work here (VSYS spans 3.0–4.5V; the pin needs ≥2.5V to read high and ≤3.6V max), and a clamp would add a part and leave the back-feed. PCB reroute done (pad 1 → 3V3).Q_LATCH1swapped to AO3400A (Vgs(th) max 1.45V, same SOT-23 G/S/D pinout, property-only change, no reroute).power_control_layoutdiagrams/docs updated (callouts D and H); production files regenerated.Known trade-offs / bench watch-items
Q_INV1turns on only afterC_DBNC1charges to ~0.4V (~1ms). Worth scopingPWR_ENon battery insertion.Test plan
kicad-cli sch erc— 0 errors, 1 pre-existing benign warning (D_RGB1lib_symbol_mismatch)kicad-cli sch export netlist—R_BTN_PU1pin 1 on3V3, pin 2 onPWR_BTN_SENSEkicad-cli pcb drc— 0 violations, 0 unconnected padsPWR_ENon battery insert🤖 Generated with Claude Code