← Back to context

Comment by Arch-TK

6 months ago

The thing about debouncing is that debouncing interrupts from input pins connected directly to e.g. switches is universally a bad idea.

Interrupt pins are weird, level change too slowly? You might never see the interrupt trigger or you'll see it trigger more than once. Switch back and forth many times at a high frequency before settling? Again, you might see interrupts for every switch or you might just get nothing at all. (In summary, directly connecting a noisy switch to an interrupt pin will mean you can lose level transition events.)

To make this work reliably you either need to debounce in hardware before it reaches your interrupt pin or forego interrupts entirely in favour of polling the input pin at a specific speed and keeping a state history.

So the term as it originates in electronics is now both misused and if you do translate it back to electronics it's considered a terrible idea.