Jump to content

Why isn't switch debouncing necessary?


Guest pkstone
 Share

Recommended Posts

Guest pkstone

Please pardon the ignorance of a newbie, but why isn't debouncing required for buttons connected to DIN modules?  I would think that latching the a button value while its contacts were still bouncing would lead to errors.  What am I missing?

Phil

Link to comment
Share on other sites

Guest Flownezz

Someone correct me if i'm wrong, but i think that the debouncing is taken care of in the code - this is a much quicker alternative to hardware debouncing and alot more versatile (different buttons bounce for varying degrees of time - so any hardware approach would end up being based on the worst case scenario thereby increasing latency and decreasing performance)  - hope that helps :) ;D

Link to comment
Share on other sites

Yes, the software takes care about debouncing. But the impementation was very easy: since the button input registers are sampled every 1 mS, temporal transitions are filtered "automatically".

Best Regards, Thorsten.

Link to comment
Share on other sites

Guest pkstone
Yes, the software takes care about debouncing. But the impementation was very easy: since the button input registers are sampled every 1 mS, temporal transitions are filtered "automatically".  (Thorsten)

So if you happen to sample in the middle of a "temporal transition", the software has some kind of state machine that ignores anything that's not steady (perhaps it must last for more than one 1ms sample?)

It's great to know that this is taken care of!  (Throws away 74LS367 buffer for debounce circuit)  :)

Thanks, Thorsten.

Phil

Link to comment
Share on other sites

Hi Phil,

this "unknown" state isn't relevant for the common use due to mechanical reasons. Since you are not able to press and depress a button within one millisecond, it doesn't matter if a transition is recorded one mS sooner or later... and a button is normaly in a stable state again within one mS.

Additional debouncing measures are only necessary if a digital device reacts on a transition immediately (i.E, if an interrupt is triggered by an external pin).

Best Regards, Thorsten.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...