What is input (e.g. pushbutton) debouncing?
Submitted By: Jan Waclawek FAQ Last Modified: 11/07/06
- Some of the input devices, especially pushbuttons, tend to produce a rapidly changing signal (e.g. due to mechanical vibrations of the button's contacts) rather than a single sharp transition. As software usually requires a single transition, some sort of debouncing is needed. There are several options:
- use some sort of "analog" hardware filtering (e.g. RC) - BEWARE can go wrong with the '51 quasibidirectional ports - see this thread
- use dedicated debouncing IC
- the best: debounce in software
An example of debouncing routine in C is in this post by Peter Dannegger.
Another alternative to those already mentioned
Submitted By: Jez Smith FAQ Last Modified: 11/07/06
- In addition to the mentioned methods of switch debouncing, there is the hardware digital filter aproach as used in the dallas semiconductor switch debouncers for example the MAX6816 which can debounce multiple switch inputs in parallel generating an interrupt on a change of switch input, and providing additional electro-static discharge protection.there is some VHDL code in the hardware library section which implements a similar function in a small CPLD, clearly this code is pretty wonderous as it was written by moi.
Vertical counters ?
Submitted By: Steve M. Taylor FAQ Last Modified: 11/07/06
- There is also an elegant method of debouncing multiple keys using a "vertical counter" which by manipulations of the bits of two bytes can debounce 8 individual switches.
The relevant thread is here.
http://www.8052.com/forum/thr...read=76130
Add Information to this FAQ: If you have additional information or alternative solutions to this question, you may add to this FAQ by clicking here.