Searching \ for '[PIC]: Debounce Circuit' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/devices.htm?key=pic
Search entire site for: 'Debounce Circuit'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: Debounce Circuit'
2003\02\26@084402 by Biswanath Dutta

picon face
Pull-up Resistance at PIC pin. Pushbutton to Gnd. Capacitor across
Pushbutton will give effective debounce ?
If anybody has used this method please confirm. Is there any pitfall ?

Thanks -- Biswanath Dutta

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2003\02\26@085449 by Olin Lathrop

face picon face
> Pull-up Resistance at PIC pin. Pushbutton to Gnd. Capacitor across
> Pushbutton will give effective debounce ?
> If anybody has used this method please confirm. Is there any pitfall ?

It will help.  You might even get away with it altogether.  However, note
that a little debounce code is cheaper and takes less board space than a
cap.


*****************************************************************
Embed Inc, embedded system specialists in Littleton Massachusetts
(978) 742-9014, http://www.embedinc.com

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2003\02\26@085650 by Jai Dhar

flavicon
face
Are you set on debouncing using hardware? Why not use software since you are
using a PIC? For using hardware, I normally use a simple capacitor, resistor
and schmidtt triggered buffer for debouncing... works well for me.

Quoting Biswanath Dutta <spam_OUTbiswanath_duttaTakeThisOuTspamHOTMAIL.COM>:

{Quote hidden}

----------------------------------------
This mail sent through http://www.mywaterloo.ca

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2003\02\26@092748 by Spehro Pefhany

picon face
At 07:11 PM 2/26/2003 +0530, you wrote:
>Pull-up Resistance at PIC pin. Pushbutton to Gnd. Capacitor across
>Pushbutton will give effective debounce ?

Why don't you do it in software? It's not a big challenge or anything.

>If anybody has used this method please confirm. Is there any pitfall ?

It mucks up the contacts (capacitor discharge welder), and it
doesn't work. Other than that it's fine.

Best regards,

Spehro Pefhany --"it's the network..."            "The Journey is the reward"
.....speffKILLspamspam@spam@interlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2003\02\26@093616 by Scott Dattalo

face
flavicon
face
On Wed, 26 Feb 2003, Spehro Pefhany wrote:

> At 07:11 PM 2/26/2003 +0530, you wrote:
> >Pull-up Resistance at PIC pin. Pushbutton to Gnd. Capacitor across
> >Pushbutton will give effective debounce ?
>
> Why don't you do it in software? It's not a big challenge or anything.

Especially since the code is already written:

http://www.dattalo.com/technical/software/pic/debounce.html

>
> >If anybody has used this method please confirm. Is there any pitfall ?
>
> It mucks up the contacts (capacitor discharge welder), and it
> doesn't work. Other than that it's fine.

If there's a resistor between the contact and capacitor, then "welding" is
not an issue. Butt steal, I agree, other than that it's fine.

Scott

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2003\02\26@093824 by Spehro Pefhany

picon face
At 08:54 AM 2/26/2003 -0500, you wrote:
>Are you set on debouncing using hardware? Why not use software since you are
>using a PIC? For using hardware, I normally use a simple capacitor, resistor
>and schmidtt triggered buffer for debouncing... works well for me.

*If* you have a ST input and want to do it with hardware:

             Vdd
              |
             .-.
             | |
           R1| |
             '-'
              |   R2_         _R3
              +--|___|----+--|___|-o  PIC  Schmidt trigger input pin
              |           |
           \  o           |
            \            ---
             \.          ---104 Ceramic
              o           |
              |
              |           |
             ===         ===
             GND         GND


       R1 24K
       R2 100K
       R3 1K

R3 can be eliminated if you can ensure that Vdd can
never drop faster than about 100mV/microsecond.

Best regards,

Spehro Pefhany --"it's the network..."            "The Journey is the reward"
speffspamKILLspaminterlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2003\02\26@095451 by Ian McLean

flavicon
face
As everyone else has said, it is better done in software.  If you must do it
in hardware, your method should work, but is still prone to some bounce.  A
better method is to RC filter the switch output and feed that through a
schmidt trigger (40106).  The switch has to be double pole, with one pole
tied to +5V and the other to ground.  This is a specially good method if
your switches are big, bulky ones prone to a lot of bounce.

Rgs
Ian.


{Original Message removed}

2003\02\26@100115 by Olin Lathrop

face picon face
{Quote hidden}

The main time constant should be between R1 and C.  R2 is only there to
avoid welding the contacts, and can be eliminated for small enough values
of C.  The purpose is to have a very small time constant going down and a
much larger one going up.  R2 of 200ohms would be fine, with R1 at least
100x higher.  The R1-C time constant should be a few 10s of milliseconds.


*****************************************************************
Embed Inc, embedded system specialists in Littleton Massachusetts
(978) 742-9014, http://www.embedinc.com

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2003\02\26@103512 by Micro Eng

picon face
OF course there is always the MAXIM chip that does it.  Take a look at the
app note

http://www.maxim-ic.com/appnotes.cfm/appnote_number/287/ln/en


But I agree....do it in software. So mucn easier to control and maintain. I
did mine in a simple macro.






{Quote hidden}

_________________________________________________________________
Add photos to your e-mail with MSN 8. Get 2 months FREE*.
http://join.msn.com/?page=features/featuredemail

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2003\02\26@111040 by Spehro Pefhany

picon face
At 09:59 AM 2/26/2003 -0500, you wrote:
{Quote hidden}

What do think is the advantage of having very asymmetrical time constants?

Best regards,

Spehro Pefhany --"it's the network..."            "The Journey is the reward"
@spam@speffKILLspamspaminterlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2003\02\26@124617 by Olin Lathrop

face picon face
> What do think is the advantage of having very asymmetrical time
> constants?

It will work more like a minimum function instead of an average.  When
bouncing, the average will be about in the middle, right where you don't
want it.  With the fast low going time constant, the level will go low
right away, and only drift up an insignificant amount between bounces.


*****************************************************************
Embed Inc, embedded system specialists in Littleton Massachusetts
(978) 742-9014, http://www.embedinc.com

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2003\02\26@143757 by hard Prosser

flavicon
face
Don't make the cap too big and/or put a small resistor (~ 100 ohm) in
series with the cap. Otherwise, closing the switch discharges the cap with
high current - can eventually burt out the switch.
It depends on switch resistance though - if the switch "on" resistance is
1000 ohms or so (e.g conductive rubber) then it shouldn't be required.

It generally pays to put a simple debounce routine in software as well!

Richard P



Pull-up Resistance at PIC pin. Pushbutton to Gnd. Capacitor across
Pushbutton will give effective debounce ?
If anybody has used this method please confirm. Is there any pitfall ?

Thanks -- Biswanath Dutta

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2003\02\26@212525 by Biswanath Dutta

picon face
Thanks to all for help. Specially Mr. Scott Dattalo whose amazing code I,ve
started using.
Take some time to fully understand it. Thanks a lot

Biswanath Dutta

{Original Message removed}

2003\02\26@212537 by Biswanath Dutta

picon face
Some confusion  re. the values you mention ?

----- Original Message -----
From: Olin Lathrop <KILLspamolin_piclistKILLspamspamEMBEDINC.COM>
To: <RemoveMEPICLISTTakeThisOuTspamMITVMA.MIT.EDU>
Sent: Wednesday, February 26, 2003 8:29 PM
Subject: Re: [PIC]: Debounce Circuit


{Quote hidden}

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


'[PIC]: Debounce Circuit'
2003\03\04@115409 by Bill & Pookie
picon face
Mr. Scott Dattalo's debounce code is a work of
art.

After some experience with keys, switches, photo
cells and magnetic detectors, I denounce
everything in software.  everything....  Even
debounced a few software switches.

As the software denounce depends on timing, have a
constant time free running interrupt routine that
denounces all the input pins, and also outputs all
the updated output pins at same time.

Now to get on the SOAP BOX....

While Mr. Dattalo's debounce code is a work of
art, But "DON'T TRY THIS AT WORK".  Use the code,
but don't try to emulate the style.

You wrote....
>Take some time to fully understand it<

It would be very difficult to modify and if it
didn't work, would be hard to debug.  It would be
a nightmare to debug a page of code written in
this style, even if you wrote it a month ago.

Notice that it takes a web page to comment this
code?  I sort of have a rule that if it takes more
lines to comment a bit of code then the code
takes, then the code is too complicated.  When the
code is written and debuggeg, the programming job
is only half over.  Latter comes the
modifications.  Also the same code may be ported
to other programs.  And the time involved to write
the code could be excessive.

I am so impressed with this code that I tried to
port it to basic one time.

Bill

the code
www.dattalo.com/technical/software/pic/debo
unce.html




{Original Message removed}

2003\03\04@152242 by Wouter van Ooijen

face picon face
> Notice that it takes a web page to comment this
> code?  I sort of have a rule that if it takes more
> lines to comment a bit of code then the code
> takes, then the code is too complicated.

I think your argument holds only when you compare two solutions that
require a compareable number of code lines, and one requires much more
comment lines than the other. A lot of things (involving vertical
counters and other clever constructs) can also be done by 'simple' code,
but when a very compact coding style is the only way to squeeze the
application in the code space and/or CPU time that is available there is
no other solution to compare it to, so it wins by default.

And you might know (or not) that Scott spends some of his time hacking
at a PIC compiler (at least he used to). Now do yopu or don't you want a
compiler to create compact yet unreadable (at least to you) code?

Wouter van Ooijen

-- -------------------------------------------
Van Ooijen Technische Informatica: http://www.voti.nl
consultancy, development, PICmicro products

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

2003\03\05@024856 by hael Rigby-Jones

picon face
> -----Original Message-----
> From: Bill & Pookie [SMTP:spamBeGonewilliamcornutt111spamBeGonespamATTBI.COM]
> Sent: Tuesday, March 04, 2003 4:51 PM
> To:   TakeThisOuTPICLISTEraseMEspamspam_OUTMITVMA.MIT.EDU
> Subject:      Re: [PIC]: Debounce Circuit
>
> I denounce everything in software.  everything....
>
>
Yeah, I have days like that too... :o)

Mike


=======================================================================
This e-mail is intended for the person it is addressed to only. The
information contained in it may be confidential and/or protected by
law. If you are not the intended recipient of this message, you must
not make any use of this information, or copy or show it to any
person. Please contact us immediately to tell us that you have
received this e-mail, and return the original to us. Any use,
forwarding, printing or copying of this message is strictly prohibited.
No part of this message can be considered a request for goods or
services.
=======================================================================
Any questions about Bookham's E-Mail service should be directed to RemoveMEpostmasterspamTakeThisOuTbookham.com.

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.

2003\03\05@092401 by Scott Dattalo

face
flavicon
face
On Tue, 4 Mar 2003, Bill & Pookie wrote:

> Mr. Scott Dattalo's debounce code is a work of
> art.

Well, I don't know about that...
<snip>

>
> Now to get on the SOAP BOX....
>
> While Mr. Dattalo's debounce code is a work of
> art, But "DON'T TRY THIS AT WORK".  Use the code,
> but don't try to emulate the style.

Nor do I know about that!

>
> You wrote....
> >Take some time to fully understand it<
>
> It would be very difficult to modify and if it
> didn't work, would be hard to debug.  It would be
> a nightmare to debug a page of code written in
> this style, even if you wrote it a month ago.

I certainly wouldn't know *anything* about that! :)

{Quote hidden}

If you write code professionally, you'll find that quality commenting is
necessary. The project I'm working on now has a ratio of about 6:1 for
lines of comments to assembly instruction. I.e. for every instruction,
there are on average SIX lines of comments describing it. The comment
style is not too unlike the one on my debounce webpage: a few paragraphs
describing the problem and solution, followed by a high-level psuedo code
implementation, and succint single line descriptions near every
instruction relating back to the more verbose descriptions.

There's nothing wrong with writing complex code in and of itself. However,
sometimes it's important to just get *something* working, and later on go
back and optimize it if necessary. What you'll find is that over time
you'll build up a library of snippets and experience upon which you can
leverage for future projects. Writing a debounce routine from scratch is
fairly trivial, writing one that's highly optimized is challenging, and
using a highly optimized one that has already been written is the ideal
situation! The same goes for just about any code (though in some cases,
starting from scratch is not trivial).

> I am so impressed with this code that I tried to
> port it to basic one time.

That should be easy! There's the C-implementation right in the comments.

A challenging thing to do would be to modify the code to have a 3-bit
vertical counter instead of a 2-bit one. I think it'd take five more
instructions.

Scott

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.

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