electro-music.com   Dedicated to experimental electro-acoustic
and electronic music
 
    Front Page  |  Radio
 |  Media  |  Forum  |  Wiki  |  Links
Forum with support of Syndicator RSS
 FAQFAQ   CalendarCalendar   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   LinksLinks
 RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in  Chat RoomChat Room 
 Forum index » DIY Hardware and Software
Momentary switch debouncer issues
Post new topic   Reply to topic Moderators: jksuperstar, Scott Stites, Uncle Krunkus
Page 1 of 1 [4 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Author Message
mistercooper



Joined: Jul 17, 2006
Posts: 62
Location: Seattle

PostPosted: Wed Apr 27, 2011 9:11 pm    Post subject: Momentary switch debouncer issues Reply with quote  Mark this post and the followings unread

Hello all,

I am working on a 40106 debounder that I am hoping to use to create manual clocks for some JK flip flops I have set up in an exclusive 'radio button' fashion (only one flip flop's output can be up at a time, each output goes to all of the other JK resets).

I have built 4x this circuit with 1x40106, but I'm having some trouble. The outputs of the schmitt trigger look like they are floating on my scope, and if I look at it with the chip out of its socket the input is indeed swinging from + to com when I hit the button. With the schmitt trigger in its place, the input appears to just stay high even when I press the button. I can't remember where I found this schematic. I had one thought... maybe the R/C values of this circuit need to be recalculated for the VDD voltage I am using? (~12-15v)

I've tied the unused pair of inputs to ground, is that proper practice?

Bonus less important question: is there a difference between CD40106 and HEF40106? Is the HEF TTL level or something?

Best,
Cooper


web-Basic Circuit.jpg
 Description:
 Filesize:  31.85 KB
 Viewed:  259 Time(s)
This image has been reduced to fit the page. Click on it to enlarge.

web-Basic Circuit.jpg


Back to top
View user's profile Send private message
Tim Servo



Joined: Jul 16, 2006
Posts: 924
Location: Silicon Valley
Audio files: 11

PostPosted: Thu Apr 28, 2011 5:03 pm    Post subject: Momentary switch debouncer issues Reply with quote  Mark this post and the followings unread

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
View user's profile Send private message
JovianPyx



Joined: Nov 20, 2007
Posts: 1988
Location: West Red Spot, Jupiter
Audio files: 224

PostPosted: Thu Apr 28, 2011 5:49 pm    Post subject: Reply with quote  Mark this post and the followings unread

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
View user's profile Send private message Visit poster's website
mistercooper



Joined: Jul 17, 2006
Posts: 62
Location: Seattle

PostPosted: Wed May 04, 2011 3:44 pm    Post subject: Reply with quote  Mark this post and the followings unread

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic Moderators: jksuperstar, Scott Stites, Uncle Krunkus
Page 1 of 1 [4 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
 Forum index » DIY Hardware and Software
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Forum with support of Syndicator RSS
Powered by phpBB © 2001, 2005 phpBB Group
Copyright © 2003 through 2009 by electro-music.com - Conditions Of Use