AnsweredAssumed Answered

Mitigating Double Interrupt Using Mechanical Switch and IRQ / KBI

Question asked by Thomas Walsh on Feb 21, 2008
Latest reply on Feb 21, 2008 by Thomas Walsh
A problem which I'm sure others have had, but which is difficult to find mentioned in past discussion:

Using a mechanical (tactile SPST momentary) switch to trigger interrupts using the IRQ or KBI modules, I often get "double clicks."  I am using falling-edge-only detection, so with a perfect switch, this should not happen.  But no mechanical switch is perfect, and the typical 6mm x 6mm tactile switch PCB-mount switch ubiquitous in consumer electronics seems to routinely switch not-so-cleanly, causing multiple pulses instead of a single edge, particularly as pressure is removed from the switch as it returns to "open" position.

Is there a pre-existing primer on dealing with this issue in in the MCU realm?  I'm new.

So far I've implemented a timer that simply skips the interrupt routine if it is called within 250 ms of a previous interrupt.  This works sometimes, but sometimes the user holds the button down longer than 250 ms, and increasing to 500 ms is bad for usability, because people want to click faster than that.

Thanks,
Patrick

Outcomes