Skip to content

V2 PCB: give the power latch hysteresis and hold it from RXD0 - #102

Merged
thePunderWoman merged 1 commit into
mainfrom
pcb-v2-latch-hysteresis
Nov 1, 2026
Merged

thePunderWoman merged 1 commit into
mainfrom
pcb-v2-latch-hysteresis

Conversation

@thePunderWoman

@thePunderWoman thePunderWoman commented Nov 1, 2026 •

Copy link
Copy Markdown
Owner

Makes the V2 power latch behave in every state, with no firmware dependency. Builds on #101 and reverses its pin choice.

Why

  • IO3 from V2 PCB: move PWR_HOLD to IO3 so it holds through USB uploads #101 depends on firmware. Its gpio_hold survived a USB upload on V1 hardware, where IO42's did not, but a firmware bug could still drop power, and it was only tested with no load.
  • RXD0 holds through uploads with no firmware, but could re-latch. Its pull-up returns as the rail collapses at power-off, with the gate sitting at threshold. The latch had no hysteresis, which this PR adds. V1 already has PWR_HOLD on this pin, so uploads on it are proven on real hardware.

Changes

Change Value Why
PWR_HOLD RXD0, pad 40, was IO3 The pull-up holds the latch through any reset or upload with no firmware
XBEE_RESET IO42, pad 38, was RXD0 Moves off RXD0. IO3 goes back to unconnected
C_LATCH_FB1 (new) 470 nF 25 V X7R 0603, CL10B474KA8NNNC, C1623 PWR_EN to gate. Kicks the gate clear of threshold as PWR_EN falls
R_PWR_EN_PD1 22 kΩ, was 100 kΩ, 0402WGF2202TCE, C25768 C_LATCH_FB1 also couples a rising gate back into PWR_EN. At 100 kΩ, that restarts the board at the capacitor tolerance extremes

C_LATCH_FB1 is on the bottom at (137.4, 80.8), below the two transistor courtyards. No new vias, and no existing parts moved.

Bigger C_LATCH_G1, extra series diodes and pull-downs on the hold line were simulated and do not fix the re-latch.

Behaviour changes

  • Firmware: no gpio_hold needed. Drive RXD0 high at boot and low to power off, and never start UART0 on it.
  • Blank boards: a 1 s press, then flash with no button held.
  • Blank or hung boards: the button cannot turn them off, because the pull-up always holds the latch. A blank board stays on until USB and the battery are removed. V2 firmware needs a watchdog, which reboots a hung board but does not turn it off.

Simulation

scripts/spice/latch_v2_sim.py is rewritten around this behaviour, with 47 checks, all passing:

  • insertion, contact bounce, USB hot-plug, and a button knock
  • press time, and holding from the pull-up alone through boot and upload
  • USB pulled while on
  • power-off with the pull-up returning at 2.0-2.8 V, at 30k and 100k, 5 and 20 mA
  • power-off with the button held, and both extremes of the capacitor ratio
Behaviour Result
Turn-on press, worst case 292 ms
Power-off About 0.6-2 s after firmware lets go, or after button release

latch_sim.py also passes. Neither runs in CI.

Verification

  • DRC: 0 violations, 0 unconnected. All 281 netlist nodes match the pads, and sync is clean.
  • stackup check: 0 errors, with the known LED 3.3 V note. bom_check: 45 lines, 0 problems.
  • Production is built from this exact board. The JLC zip matches the gerbers on the 6 layers compared, and the netlist shows PWR_HOLD on pad 40 and XBEE_RESET on pad 38.

Not covered

These are simulated margins, not measured ones. C_LATCH_FB1 has never been on real hardware, the buck is a behavioural model, and the datasheet gives only a typical pull-up, so 30k-100k is a deliberately wide spread. The model leans pessimistic: it restarts the circuit without C_LATCH_FB1 at every load, while V1 stayed off about 10 of 10 on the bench.

Bring-up now includes at least 20 power-offs on USB and on battery, scoping PWR_EN and PWR_LATCH_G.

BAT54W-7-F sourcing with PCBWay is still open.

🤖 Generated with Claude Code

IO3's gpio_hold survived a USB upload on V1 hardware, but it leaves the
latch depending on firmware, and it was only tested with no load. Move
PWR_HOLD back to RXD0, whose pull-up holds the latch through any reset or
upload with no firmware help, and put XBEE_RESET on IO42. IO3 goes back
to unconnected.

That pull-up returns as the rail collapses at power-off, with the gate
sitting at threshold, so the latch needs hysteresis. C_LATCH_FB1 (470 nF,
PWR_EN to gate) kicks the gate clear as PWR_EN falls. It also couples a
rising gate back into PWR_EN, which restarts the board at the capacitor
tolerance extremes with a 100k pull-down, so R_PWR_EN_PD1 is now 22k.

Rewrite latch_v2_sim.py around this behaviour, with 47 checks, and
regenerate the production files.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@thePunderWoman
thePunderWoman force-pushed the pcb-v2-latch-hysteresis branch from 98a81b2 to 1048ddc Compare November 1, 2026 20:03
@thePunderWoman
thePunderWoman merged commit ec92b12 into main Nov 1, 2026
3 checks passed
@thePunderWoman
thePunderWoman deleted the pcb-v2-latch-hysteresis branch November 1, 2026 20:05
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 this pull request may close these issues.

1 participant