The setup is simple: a 27k resistor (couldn't find a 47k) is connected between +5v and a generic Chinese 6mm square tact switch. The switch pulls the south end of the resistor to ground, so when the button is pushed, the output should fall to zero volts, and when released, it should rise back to 5v.
Here's what actually happens... note that this doesn't happen every time, but it happens often enough - one in four or five - that it needs attention. This is triggered on the falling edge, but shows a bounce lasting around half a millisecond. All these show a similar effect; a bounce occuring on the rising edge as the switch is released.
Well, ok, let's see what happens when you put that through a 74hc04. Some things to remember: this is a worst case situation; there is no decoupling on the '04, the remaining inputs are all unterminated, and of course as an hc type, the logic generically switches at half rail. These images are looking at the output of the '04, so the signal goes high when the button is pressed; the trigger is on the positive slope. Again, there's disturbance at the end of the press - as might be expected, given the input signal. Here, we see from the triggering point that there's a glitch about 2.5ms before the button is fully released. This is a tight zoom into the falling transition - note that I'm still triggering on the _rising edge_. Not good.
OK, so let's stick a 100nF capacitor on the input to the '04 and ground. Here's the effect on a 5ms scale, input to the inverter. But here's the output back at 200us
Neil