IO-18 Button without a debounce capacitor where the firmware assumes an RC filter¶
| Severity | Status | Implementation |
|---|---|---|
| suggestion | planned | mid, depends on CFG-2, RPT-13 |
Looks at. Switch parts, the firmware's assumption.
What it catches. A button on a GPIO with no capacitor to ground, where the firmware relies on a hardware filter (no software debounce, or an edge interrupt that counts presses).
Why it matters. Contacts bounce for hundreds of µs to several ms; an interrupt sees each bounce as a press, and an analog-decoded button (several buttons on one ADC pin through a ladder) reads intermediate values during the bounce. Firmware and hardware must agree on who filters.
Example. B153A's PA7 carries a button (10 kΩ to GND) and a slide switch on one ladder decoded by button.rs, which assumes an RC filter; the board has none. Rev B adds 10-100 nF to GND.
How to check. Buttons (switch parts) on GPIO nets without a capacitor to ground; whether the firmware assumes a filter comes from the project (CFG-2), and the programmer report states "hw debounce: none" either way (RPT-13).
Fix. A capacitor (10-100 nF with the existing pull, giving 0.1-1 ms) and, for slow RC edges, a Schmitt-trigger input.
References. Ganssle part 2 ("An RC Debouncer"); Wikipedia, Switch (contact bounce); B153 rev B change list.