??? 06/21/05 10:24 Read: times |
#95444 - Not debounce. Hysteresis/schmitt Responding to: ???'s previous message |
Debouncing is a different problem - vibrations that generate quite a variable range of levels, often stepping into each of "legal zones" before stabilizing. So if you expect "bouncing" signal, you just need to ignore its changes for a moment, until it stabilizes.
In case of signal between "legal 0" and "legal 1", you should use a part specifically designed to eliminate this problem: a schmitt trigger as a buffer. This way the output doesn't change when the input voltage is in the "grey zone", that is the output will remain 0 until the input goes above healthy VIH, and then remains 1 until input goes back below VIL. Temporary entering the "grey zone" won't change the output value. The problem may be in some small spikes of voltage, say, you have 1V which should in your case mean 0, but a short random spike triggers the trigger to output 1V input as pure 5V "1" output until the voltage drops below 0.8V for at least a moment. You can prevent this with an antialiasing filter - just a capacitor between the line and the ground. Just note - the bigger the capacitor, the bigger spikes it will be able to absorb, but also the more it will delay the signal so short pulses may get lost. |