Why does my handheld console reset whenever I press two buttons at the same time?

Oct 29, 2026 Last reply: 2 hours ago 3 Replies

First reply

Mike_Harvest

The most likely cause isn't the power rail sagging from the buttons themselves, but a noise coupling issue or a specific logic state transition on the pins when both buttons close at the exact same millisecond. STM32s are super sensitive to input glitches, expecially if those…

Read the full reply

So I built myself a little handheld game console as a weekend project and it mostly works now, but there's one wierd thing I can't figure out. Whenever I hit two buttons at once, say the d-pad and a face button, the whole thing restarts. One button alone is totally fine. I'm using an STM32 board running off a single lithium cell thru a small boost converter. My first thought was the power rail sagging when both buttons draw current at once, but buttons barely pull anything, right? Unless I've wired something up so the lines are somehow loading each other.



I've got pull-ups on the button pins and I'm reading them with polling in a simple loop. No interrupts, nothing fancy. Could it be a ground issue? My grounds all run back to one point on the board but the button harness is a bit of a spaghetti mess of jumper wires. Has anyone hit something like this before? realy scratching my head here because it's so consistent. Two buttons equals reset, every single time.


The most likely cause isn't the power rail sagging from the buttons themselves, but a noise coupling issue or a specific logic state transition on the pins when both buttons close at the exact same millisecond. STM32s are super sensitive to input glitches, expecially if those inputs are connected to a shared ground path or if they're routed close to a clock signal trace. Since you're using polling, you might be hitting a rare condition where the simultaneous ground pull on two pins creates a momentary dip that the internal voltage regulators or even the MCU's brownout detection interprets as a system failure leading to a reset. Even if the pins aren't directly reset inputs, some STM32s will trigger a watchdog or hard fault if inputs enter an undefined or excessively rapid state. You mentioned using pull-ups, wich is good, but if those buttons are mechanically noisy, the sudden simultaneous closing could cause a transient spike before the pull-up catches it. The solution is almost certainly better input filtering or debouncing. Don't just rely on software polling; if you're reading two inputs, you need to ensure the transition to the 'pressed' state is clean and isolated.

Try adding simple capacitor smoothing right across the input pin and ground for each button. A small ceramic capacitor like 100nF placed physically close to the button pin and the ground trace can help filter out those tiny voltage spikes and noisy current fluctuations that happen when the contacts close. This is a common fix for issues that only appear under specific hardware-trigger conditions like this. Also, double-check your schematic to ensure the ground paths for the button harness and the main power ground are not fighting each other or creating a poorly defined ground loop, even if they lead to one point.

If you want to keep it entirely software based, you could implement a basic state machine that requires the buttons to be held for a specific minimum time before registering the input. This kind of hardware filtering usally solves these 'works for one, fails for two' quirks.

Honestly, I think you might want to look closer at your voltage regulator even though it sounds obvious. When two circuits close at once, even if the current is low, the sudden spike in current draw can cause a momentary voltage dip across a weak power supply. That quick drop might be enugh to trigger the brownout detection on the STM32 itself. Maybe try adding a bigger capacitor right before the regulator input, just to buffer any sudden transient spikes that could be tripping your chip's safety checks.

I've dealt with this before where the input reading timing gets slightly off, even without true noise. Even if your ground is clean, if the two inputs switch state at almost the exact same cycle, the internal register read might get corrupted. You need to use the built-in hardware debounce. For my work, I always set the debouncing window to 5ms minimum for any mechanical input. It filters out that weird 'two buttons' glitch before the core logic sees it. That should stop the unexpected reset.

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required