Searching \ for 'Tell me again....' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: techref.massmind.org/techref/index.htm?key=tell+again
Search entire site for: 'Tell me again....'.

Truncated match.
PICList Thread
'Tell me again....'
2000\03\02@213028 by jkitchen

picon face
Tell me why I need a switch debounce routine.  If all I am trying to do
is start a code section by closing a switch (bringing a pin to ground
potential), why do I care if the switch bounces?  After all, it should
make no difference if the pin is pulled to ground once or a hundred
times (in a very short period of time) to start the code routine.  What
am I missing here?   Yes, I am a newbie...   TIA

2000\03\02@214532 by l.allen

picon face
> Tell me why I need a switch debounce routine.  If all I am trying to do
> is start a code section by closing a switch (bringing a pin to ground
> potential), why do I care if the switch bounces?

Right... it matters not a jot...
Only if you are counting, sync-ing or something.
I rarely need to worry about debounce in most
applications I have made, and then my primary course of
action is hardware debounce... usually R/C into a schmitt
trigger followed, as a last resort, with software.
True this is not the cheapest way but I dont build final
production prototypes, and I really hate relying on
software to mask hardware short comings... the potential
gotchas rise exceptionally.

_____________________________

Lance Allen
Technical Officer
Uni of Auckland
Psych Dept
New Zealand

http://www.psych.auckland.ac.nz

_____________________________

2000\03\02@220728 by peter_teng

flavicon
face
Marion,

       It may not matter if your code start the routine once it is pressed at long
as the pressing signal is not connected to interrupt (interrupt service
routine reentering may occurs).
       It also depends on how long does routine runs. If the routine completed
before the bouncing behavior ceases, the routine may retrigger.
       Then it depends on how long does routine runs and how long is the button
pressed for the case of button depressing. For example, if your routine
takes 1ms to complete, while the human press the button for 10ms (which is
easy to accomplish so). Then the depressing action may create bouncing
behavior which in turn trigger your routine.

best regards,
Peter Teng


{Original Message removed}

2000\03\02@225420 by Wagner Lipnharski

picon face
This is exactly the same as your wife asking money.  Confucious says:
If you can make money faster than your wife asks and expends, there is
no problem, but if she asks money faster than you make it, it would be
better to install a debounce routine at your wife... :)

"Marion D. Kitchens" wrote:
>
> Tell me why I need a switch debounce routine.  If all I am trying to do
> is start a code section by closing a switch (bringing a pin to ground
> potential), why do I care if the switch bounces?  After all, it should
> make no difference if the pin is pulled to ground once or a hundred
> times (in a very short period of time) to start the code routine.  What
> am I missing here?   Yes, I am a newbie...   TIA

2000\03\03@004055 by Rob

picon face
For all the potential trouble and extra parts it saves you, please, just use
a debounce routine. They arent all that hard to implement, and if you unit
is used in a noisy enviroment, it won't glitch like crazy either.
Debouncing can also be a sort of error nullify/EMI rejection. Its well worth
the bit of extra code to call a delay routine then to re-read your ports to
make sure that the data is valid. Not only that, if a switch fails or does
something wierd, it won't make your application so prone to runaway because
of some intermittent.

Rob

>
> {Original Message removed}

2000\03\03@051718 by paulb

flavicon
face
Marion D. Kitchens wrote:

> Tell me why I need a switch debounce routine.  If all I am trying to
> do is start a code section by closing a switch (bringing a pin to
> ground potential), why do I care if the switch bounces?  After all, it
> should make no difference if the pin is pulled to ground once or a
> hundred times (in a very short period of time) to start the code
> routine.  What am I missing here?

 OK, if the import of your routine is that it should start up and keep
running, repeating over and over if necessary, while ever the switch is
pressed and for a certain time afterward, then you certainly do not need
debounce.

 An example of this is the stair light timer.  It must go on
immediately and stay on for a minute after the last time the switch was
pressed.  The hold-on is vastly longer than the switch bounce so it
really is of no concern

 The situation where debounce *is* essential is the "do-once"
algorithm.  If the "do" time is much longer than the bounce time, you
may assume that debounce is unnecessary.

 ... But ...

 Bounce works both ways.  What happens when the button is released?
You have probably put in a "lock-out" function whereby the action is
done and if the switch is still pressed, you wait until it is released
because after all, you only wanted the action done once.

 What will however happen is that the contact will release for a moment
then bounce on again a couple (or more) of times.  Your "lock-out"
function now assumes it is released, and proceeds to reset, then
immediately sees the contact made again, so initiates a new "do-once"
cycle - you have one action on press, and another, incorrectly, on
release.

 So, if you are implementing a "do-once" operation, you probably do
need debounce.  It also makes the system relatively immune to power
transient, lightning, static etc...
--
 Cheers,
       Paul B.

2000\03\03@105939 by jkitchen

picon face
Hmmm.....  I don't think I'll mess with the wife routine :-)


Wagner Lipnharski wrote:

{Quote hidden}

2000\03\03@114620 by Harold M Hallikainen

picon face
On Thu, 2 Mar 2000 21:33:38 -0500 "Marion D. Kitchens"
<spam_OUTjkitchenTakeThisOuTspamEROLS.COM> writes:
> Tell me why I need a switch debounce routine.  If all I am trying to
> do
> is start a code section by closing a switch (bringing a pin to
> ground
> potential), why do I care if the switch bounces?  After all, it
> should
> make no difference if the pin is pulled to ground once or a hundred
> times (in a very short period of time) to start the code routine.
> What
> am I missing here?   Yes, I am a newbie...   TIA

       You're probably not missing anything unless your routine is short enough
that it finishes and the main loop calls it again on each successive
bounce, calling your routine a hundred times instead of once.

Harold



FCC Rules Online at http://hallikainen.com/FccRules
Lighting control for theatre and television at http://www.dovesystems.com

________________________________________________________________
YOU'RE PAYING TOO MUCH FOR THE INTERNET!
Juno now offers FREE Internet Access!
Try it today - there's no risk!  For your FREE software, visit:
dl.http://www.juno.com/get/tagj.

2000\03\03@171113 by Brent Brown

picon face
Yes you are quite right, you don't always have to have a full
debounce routine. Writing a proper debounce routine is a
significant chore in most projects and is not always required.

Everything people have metioned so far is true, except I don't have
a wife so I'm not qualified to comment on spouse bounce.

Advantage of no switch debounce can mean less delay to start of
routine from initial switch closure. Only thing to consider is that
this scheme reacts instantly to false triggers. These really do
happen in all kinds of electrically noisy environments, trust me! To
get around this and still keep it simple, I usually write my code to
do the following:-

- Is the switch closed?
- Yes.
- Well thats OK, but wait 5ms just to be sure.
- Is the switch still closed?
- OK, now I believe that the switch really is closed
- Run the appropriate routine
- If it was a short routine, wait here for about 300ms
- OK, now go back to the top and wait for the next event

The 5ms delay, or more, works pretty well at rejecting noise on the
input. The 300ms or so delay effectively sets the "auto repeat" time
of the switch. Alternatively you may wish to wait for the switch to
be released before looping the code.

Brent Brown
Electronic Design Solutions
16 English Street
Hamilton, New Zealand
Ph/fax: +64 7 849 0069
Mobile: 025 334 069
eMail:  .....brent.brownKILLspamspam@spam@clear.net.nz

2000\03\03@200606 by Graeme Zimmer

flavicon
face
Hi all,

> Yes you are quite right, you don't always have to have a full
> debounce routine. Writing a proper debounce routine is a
> significant chore in most projects and is not always required.

It might be worth mentioning that a simple way to eradicate Contact Bounce
is to use a Change-Over switch instead of a single contact.

You put Ground on one contact and +5V on the other and a small cap on the
middle.

When the contact goes across, the voltage changes in a clean step with no
possiblity of bounce.

Its probably best to put the cap right at the pin with a series resistor to
the outside world to avoid EMC problems.

cheers .............. Zim

More... (looser matching)
- Last day of these posts
- In 2000 , 2001 only
- Today
- New search...