Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Message

Re: Keyboard delay

2005-02-20 by brewski922

--- In AVR-Chat@yahoogroups.com, Valerij Avrealij <avrealij@m...> 
wrote:
> Hello 2AVR-Chat members.
> 
> I have interrupt based keyboard inquiry. How much time I need wait
> after interrupt occurs and keyboard inquiry?
> Thanks.
> 
> --
>  Valerij Avrealij

It depends on the bounce time of the switches. Sometimes the 
manufacture datasheet has the specs for the bounce, settling, time. 
Most don't. Probably needless to say, but I'll say it anyway in case 
there is folks that are not awhere of it. From the time that a switch 
makes initial contact and a valid read is made of what switch created 
the closure, the contact needs to settle to a continuous closure.

Anyway, for your case if you feel you are having problems with 
contact bounce or something else and feel a time-delay is need go 
ahead a insert a delay. Start with something big that WILL correct 
the problem, say a 0.001 or may be 0.01 or even 0.1 and see what 
happens. When the problem is corrected say between 0.001 and 0.01, 
split the difference and try 0.05. If that worked split the 
difference again. You will eventually get to a point where one delay 
works and just a bit faster fails. Using the number that works 
increase the delay a little, I usually use 10% slower. This gives you 
a little insurance.

Mike

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.