Re: switch debouncing
- From: Mac <foo@xxxxxxx>
- Date: Tue, 18 Oct 2005 03:36:34 GMT
On Mon, 17 Oct 2005 16:56:39 -0700, Mark wrote:
>
> Spehro Pefhany wrote:
>> On Mon, 17 Oct 2005 14:26:30 GMT, the renowned Fred Bloggs
>> <nospam@xxxxxxxxxx> wrote:
>> >>
>> >>
>> >> If it's going into a microcontroller, firmware is almost always the
>> >> best way.
>> >>
>> >>
>> >> Best regards,
>> >> Spehro Pefhany
>> >
>> >Well, if you can arrange things with external hardware so that the
>> >switch input is always valid, that is just that much less the firmware
>> >has to do- especially if the switch input is a very infrequent occurrence.
>>
>> Timer-interrupt driven periodic (in the 100-500Hz range) polling uses
>> negligible bandwidth of a modern processor for any reasonable number
>> of keys. Even if its a frequent occurence. And it can filter out
>> electrical noise and momentary contact breaks due to shock or
>> vibaration as well, if you choose to write it to do so.
>>
>> There is reason to add some external hardware (especially to deal with
>> ESD issues and possibly with the miserably small and variable current
>> that on-board pullups typically deliver) but not for the deboucing.
>> Even a crummy on-board RC clock will yield debouncing times accurate
>> within a few percent at zero additional cost, and les need to test the
>> board for missing parts.
>>
>>
>
>
> ESD protection is a good point... you may also want to put a 1uF cap
> directly across the switch to keep the contacts clean, making a small
> spark...I have a MD player where the switches are all dry contacts i.e.
> very low current, and they are a problem...
>
> Mark
I am not going to put a 1uF cap directly across the switch. That seems
like an exceptionally bad idea to me.
ESD is NOT my thing, but the ESD spike in this case will have to charge
(or discharge) a 1 uF cap through an 18k resistor in order to endanger the
gate. The path to VCC is even more difficult since there is an 82k
resistor there. I am assuming that the 18k will give the protection diodes
on the gate a fighting chance, I guess.
Also, the switch is designed so that the discharge will almost certainly
be to ground, not to the switch contacts.
--Mac
.
- References:
- switch debouncing
- From: Mac
- Re: switch debouncing
- From: Spehro Pefhany
- Re: switch debouncing
- From: Fred Bloggs
- Re: switch debouncing
- From: Spehro Pefhany
- switch debouncing
- Prev by Date: Re: Watt RF vs Watt DC
- Next by Date: Re: Class D Amp. Design
- Previous by thread: Re: switch debouncing
- Next by thread: Re: switch debouncing
- Index(es):
Relevant Pages
|