[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Switch debouncing and related stuff (like CPU reset circuits)
Hi,
Electrical engineers among us, please correct me if I wrong :-)
I was designing an ATX power-on circuit for my next 8088/XT board, and
one of the issues was debouncing of the power switch (which is a
momentary switch).
It must be some kind of conspiracy about switch debouncing, it looks
like 90% of the related pages on the Internet are referring to this
"research": http://www.ganssle.com/debouncing-pt2.htm . More exactly
to the circuit on Figure 3 (the circuit on Figure 1, which also
frequently referred everywhere, is mostly unusable, since nobody will
use a double throw switch just to overcome the contact bounce)
The problematic part there is the purpose of the diode... This diode
in the configuration shown on the diagram is useless. It will conduct
electricity only then voltage difference on it is bigger than diode
forward voltage drop, which happens only during very short time. The
given explanation doesn't make any sense. The claim that the voltage
on the capacitor Vfinal will be 4.3V, is wrong... after voltage
difference on the diode will be less than diode forward voltage drop,
the capacitor will continue to charge through R2, and eventually will
reach the power supply voltage (5V).
The only useful purpose that diode might serve in such circuit is the
protection of the Schmitt tigger's input. In this case the diode
should be connected backwards - with the anode connected to the
capacitor and the cathode connected to Vcc. This is mostly useful
then using CMOS gates that have ESD protection diodes on inputs. In
this case, when power supply disconnected, capacitor might discharge
through these ESD protection diodes, potentially damaging them. If
diode is connected as described above, capacitor will discharge
through that diode.
Another problem with debouncing circuits (and CPU reset circuits we
use in N8VEM projects) is that capacitor is discharged through switch,
potentially passing very high current through that switch, and leading
to its failure. To eliminate that we used to add a 10 ohm resistor in
series with the switch, but it looks like 10 ohm is too low to limit
the current. Most tactile switches are rated for 50 mA. When using 10
ohm resistor, the worst case current will be 5V / 10 ohm = 0.5 A. Ten
times more than the switch rating... Now one solution will be just
increasing the resistance of that current limiting diode, say to 100
ohm. But replacing resistor in naive way will basically form a voltage
divider, and depending on the ratio of R1/R2 (resistor that is used to
charge the capacitor to the resistor that used to limit the discharge
current), it is very possible that resulting voltage in the "switch
closed" position will be higher than Schmitt trigger threshold. So
instead of that, I'd recommend using circuit similar to one shown on
Figure 3 (or Figure 2) on the page above, but connecting diode in
reverse between the capacitor and Vcc.
Any comments?
Thanks,
Sergey