3 ms·
When you have more than a dozen switches to debounce, it is best to opt for a hardware solution unless you're making something in the 100k+ quantities. We've u
by fermienrico 7y ago
When you have more than a dozen switches to debounce, it is best to opt for a hardware solution unless you're making something in the 100k+ quantities.
We've used MAX7370 chip for keyboard applications. Comes with built-in debounce capabilities along with ESD protection, low quiescent current and interrupt-based signal to the MCU. It is expensive but well worth the hassle - it can handle up to 64 switches and saves you the pain of GPIO nightmare with custom matrix. In addition, it comes with a hardware memory buffer so you could do an n-key roll over. I've built stuff that I can mash with my palm - like jamming on a couple of dozen switches at the same time and this chip handles it all. Flawlessly.
- castratikron 7y agoIf you are doing this for a Linux platform, there's actually a gpio matrix keypad driver that works really well. The driver shows up as a regular keyboard input device that can interface with any program that knows how to read /dev/input things.
- lmilcin 7y agoI do not like the idea of sending an interrupt and cause a havoc on OS side every time two metal plates bounce off each other. I can understand this when this happens to a device that is created to monitor the switch (switch matrix controller, keyboard controller, etc.) but when this happens to a machine that may have something more important to do it feels at the very least inelegant.
- fermienrico 7y agoAgreed, just as encapsulation/abstraction is an important and indispensible concept in software engineering, it is also equally if not more critical in hardware applications. For most electronics, there is usually an IC that can solve a problem better than you can develop, often cheaper. 25 discrete components can be encapsulated by a single IC sometimes (with a couple of bypass caps).