| Author |
Message |
mistercooper

Joined: Jul 17, 2006 Posts: 62 Location: Seattle
|
|
|
Back to top
|
|
 |
Tim Servo

Joined: Jul 16, 2006 Posts: 924 Location: Silicon Valley
Audio files: 11
|
Posted: Thu Apr 28, 2011 5:03 pm Post subject:
Momentary switch debouncer issues |
 |
|
Looks like the circuit from this site:
http://www.edaboard.co.uk/push-button-contact-debouncing-t234473,start,15.html
I might try tweaking the resistor values. They look a little high (perhaps the pullup to +V isn't strong enough). I would probably try cutting the current values in half.
And yes, unused CMOS inputs must be set to a logic level. +V or Ground, it doesn't matter, as long as they're not left floating.
Tim (my pullups aren't strong enough either) Servo |
|
|
Back to top
|
|
 |
JovianPyx

Joined: Nov 20, 2007 Posts: 1988 Location: West Red Spot, Jupiter
Audio files: 224
|
Posted: Thu Apr 28, 2011 5:49 pm Post subject:
|
 |
|
Oh boy. I've messed with this issue myself. It's a real pain in the rear to be honest.
I'm looking at the switch in the schematic and see it has 4 pins. Is this actually a DPDT switch? If it is, you can debounce it much easier and better with an R-S flip-flop. If the switch is just an SPST, then the circuit you have is more or less what works, but you may need to change (as Tim suggested) the resistor values or even eliminate the diode. The circuit is really a single pole passive lowpass filter (albeit a weird one with two different time constants). As such, regardless of the values of the components, it will never fully eliminate the noise that is called "bounce". You can make the cap or resistor bigger to make the time constant longer, but that can cause things like "hey, I pushed the button, but nothing happened". If the time constant is too short, enough noise gets through that it still fiddles the schmitt trigger anyway.
What I did in the end with my circuit was toss the SPST pushbutton and go with a DPDT type and used an R-S flipflop. This circuit does not depend on a time constant so it works first time, every time without fiddly time constant nonsense. Yes, the switch is more expensive - but it was 100% reliable and didn't matter how fast I pecked at the button.
The output should never look like it's floating if the circuit is grounded to the scope. Can't say what is causing that, but it's certainly not right and might indicate some grounding problem, perhaps with the connection to the scope or perhaps within the circuit itself. When you say it looks like it's floating - do you mean that the output itself floats around or that it looks like the input is floating and the output is toggling between Vss and Vdd? _________________ FPGA, dsPIC and Fatman Synth Stuff
Time flies like a banana. Fruit flies when you're having fun. BTW, Do these genes make my ass look fat? corruptio optimi pessima
|
|
|
Back to top
|
|
 |
mistercooper

Joined: Jul 17, 2006 Posts: 62 Location: Seattle
|
Posted: Wed May 04, 2011 3:44 pm Post subject:
|
 |
|
| Thanks for the info guys! Got it working. The RS solution doesn't work in this case because I'm using spst buchla style switches, or I'd of tried that. |
|
|
Back to top
|
|
 |
|