From: krw on
On Thu, 03 Dec 2009 20:25:30 -0800, John Larkin
<jjlarkin(a)highNOTlandTHIStechnologyPART.com> wrote:

>On Thu, 03 Dec 2009 22:12:21 -0600, krw <krw(a)att.bizzzzzzzzzzz> wrote:
>
>>On Thu, 03 Dec 2009 18:52:30 -0800, Jon Kirwan
>><jonk(a)infinitefactors.org> wrote:
>>
>>>On Thu, 03 Dec 2009 17:01:24 -0800, John Larkin
>>><jjlarkin(a)highNOTlandTHIStechnologyPART.com> wrote:
>>>
>>>><snip>
>>>>Sounds like a combination of bad switches, bad electronics (esd
>>>>sensitivity) and bad code. So don't do that. A reasonable physical
>>>>shock shouldn't cause a switch closure on a human interface panel.
>>>><snip>
>>>
>>>What's kind of funny about this discussion (brings a smile to my face)
>>>is that I've never once had to discuss any of this with an electronics
>>>designer for longer than a few moments. Usually, they want to be sure
>>>_I_ am aware and will deal with it. So I'm actually enjoying the new
>>>experience you are affording me.
>>>
>>>Did you read Ganssle's paper cited here in this thread by IanM? There
>>>are some modest scope diagrams there.
>>
>>With a SPDT (see: subject) switch one can make the "perfect"
>>debouncer. Don't need no steenkin' software. ;-)
>
>A lot of pushbuttons, especially membranes, are SPST. Non-click-dome
>membranes often have absurd sliding/bouncing behavior.

Sure, but that wasn't the OP's question. For membranes I usually just
double sample, pretty much like any other asynchronous interface.
From: Jon Kirwan on
On Thu, 03 Dec 2009 22:12:21 -0600, krw <krw(a)att.bizzzzzzzzzzz> wrote:

>On Thu, 03 Dec 2009 18:52:30 -0800, Jon Kirwan
><jonk(a)infinitefactors.org> wrote:
>
>>On Thu, 03 Dec 2009 17:01:24 -0800, John Larkin
>><jjlarkin(a)highNOTlandTHIStechnologyPART.com> wrote:
>>
>>><snip>
>>>Sounds like a combination of bad switches, bad electronics (esd
>>>sensitivity) and bad code. So don't do that. A reasonable physical
>>>shock shouldn't cause a switch closure on a human interface panel.
>>><snip>
>>
>>What's kind of funny about this discussion (brings a smile to my face)
>>is that I've never once had to discuss any of this with an electronics
>>designer for longer than a few moments. Usually, they want to be sure
>>_I_ am aware and will deal with it. So I'm actually enjoying the new
>>experience you are affording me.
>>
>>Did you read Ganssle's paper cited here in this thread by IanM? There
>>are some modest scope diagrams there.
>
>With a SPDT (see: subject) switch one can make the "perfect"
>debouncer. Don't need no steenkin' software. ;-)

Good response! But I had been discussing a reply that brought in the
subject of _software_.

Jon
From: Jon Kirwan on
On Thu, 03 Dec 2009 20:43:31 -0800, John Larkin
<jjlarkin(a)highNOTlandTHIStechnologyPART.com> wrote:

>On Thu, 03 Dec 2009 18:52:30 -0800, Jon Kirwan
><jonk(a)infinitefactors.org> wrote:
>
>>On Thu, 03 Dec 2009 17:01:24 -0800, John Larkin
>><jjlarkin(a)highNOTlandTHIStechnologyPART.com> wrote:
>>
>>><snip>
>>>Sounds like a combination of bad switches, bad electronics (esd
>>>sensitivity) and bad code. So don't do that. A reasonable physical
>>>shock shouldn't cause a switch closure on a human interface panel.
>>><snip>
>>
>>What's kind of funny about this discussion (brings a smile to my face)
>>is that I've never once had to discuss any of this with an electronics
>>designer for longer than a few moments. Usually, they want to be sure
>>_I_ am aware and will deal with it. So I'm actually enjoying the new
>>experience you are affording me.
>
>I'm an EE who mostly does my own programming, so I usually don't have
>to collaborate with anybody to get things to work.

EE's almost cannot get along without developing such skills, anymore,
it seems. Too often a damned lot better than many embedded
programmers without electronics knowledge. ;) I think it's a mark of
excellence that you do the hands-on whether often or from time to
time.

Jon

>>Did you read Ganssle's paper cited here in this thread by IanM? There
>>are some modest scope diagrams there.
>
>I'd seen that one before. It's not earth-shaking.
>
>One way we debounce things in FPGAs is to clock the external state
>into an N-bit shift register, N=4 maybe, using the local system clock,
>sometimes divided down. If all SR bits are 1, set an RS flipflop; if
>all are 0, clear it. That's usually for stuff much faster than contact
>closures, like count inputs coming in from a customer or an
>asynchronous system that might have ringing or glitches.
From: Edmond H. Wollmann on

"John Larkin" <jjlarkin(a)highNOTlandTHIStechnologyPART.com> wrote in message
news:2k3eh5lsso6nmcoejtpdq8aea5atv6thc2(a)4ax.com...
> On Wed, 02 Dec 2009 14:03:58 -0800, Jon Kirwan
> <jonk(a)infinitefactors.org> wrote:
>
>>On Tue, 01 Dec 2009 19:45:21 -0800, John Larkin
>><jjlarkin(a)highNOTlandTHIStechnologyPART.com> wrote:
>>
>>><snip>
>>>If you sample the switch state every, say, 20 milliseconds, and act on
>>>what you see, there's no need to debounce at all.
>>
>>I am generally able to tell when, and usually am annoyed by, equipment
>>sampling that way.
>>
>>Jon
>
> Can you push a button for less than 20 milliseconds?
>
> John


Hey John lackin, listen up, you are going to miss seeing the impulse if your
software is dragged down by heavy task, especially in embedded system, equipped
with slow CPU, don't say it won't happen, it happens all the time. Debouncing
through hardware is the best solution, so your software can see wider impulse
Stupid! You and John Fools are too goofy in your shitty brains.







From: Dan Coby on
Edmond H. Wollmann wrote:
> "John Larkin" <jjlarkin(a)highNOTlandTHIStechnologyPART.com> wrote in message
> news:2k3eh5lsso6nmcoejtpdq8aea5atv6thc2(a)4ax.com...
>> On Wed, 02 Dec 2009 14:03:58 -0800, Jon Kirwan
>> <jonk(a)infinitefactors.org> wrote:
>>
>>> On Tue, 01 Dec 2009 19:45:21 -0800, John Larkin
>>> <jjlarkin(a)highNOTlandTHIStechnologyPART.com> wrote:
>>>
>>>> <snip>
>>>> If you sample the switch state every, say, 20 milliseconds, and act on
>>>> what you see, there's no need to debounce at all.
>>> I am generally able to tell when, and usually am annoyed by, equipment
>>> sampling that way.
>>>
>>> Jon
>> Can you push a button for less than 20 milliseconds?
>>
>> John
>
>
> Hey John lackin, listen up, you are going to miss seeing the impulse if your
> software is dragged down by heavy task, especially in embedded system, equipped
> with slow CPU, don't say it won't happen, it happens all the time. Debouncing
> through hardware is the best solution, so your software can see wider impulse
> Stupid! You and John Fools are too goofy in your shitty brains.

I have built systems for over 30 years. We have never bothered doing hardware
debouncing. Switches are sampled in a regular timer interrupt service routine.
With this scheme, you can do whatever debouncing scheme that you want. You can
also latch contact closures so that they can be processed whenever desired. We
built systems using 8080s with a few Mhz clock rates with no problems.

Only an extremely poorly designed piece of equipment would miss contact closures
if you are sampling them with a timer interrupt. (You would have to be missing
entire interrupt service requests and this would mean that you have major problems.)