Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
09/15/06 22:41
Read: times


 
#124382 - Why so much pain?
Responding to: ???'s previous message
If you scan the keypad at a sufficiently low frequency, i.e. get through the scan at a rate that allows for even the fastest typist to be "caught" yet still allow for the keybounce, you'll need to wait for the debounce interval to pass and then scan and record the result again, comparing with the prior result. If the last result is an "idle" (no keys pressed) code, and that occurs a second time, then the last keypress value stored is the key code you should process. That way, any unwanted "sneak-paths" will have become invalid due to multi-key closures, while the presumably valid key will remain as the last recorded value.

Note that it doesn't matter how fast you scan, so long as the frequency at which you perform the entire scan is lower than the switch bounce time. The way I'd do it is on a timer-driven interrupt basis using

{scan by whatever method may be available}
{save non-idle code}
{compare non-idle code with previous, perhaps several times}
{if equal, then clear saved value and return the matched value}

There are lots of ways of getting this done. The key is not to waste too much time waiting for things. That's why the timer-driven interrupt is handy.

RE


List of 27 messages in thread
TopicAuthorDate
Matrix Keyboard not working            01/01/70 00:00      
   the logic            01/01/70 00:00      
   Lots of problems            01/01/70 00:00      
      no, it's completely bad in concept            01/01/70 00:00      
      Does the LCD Work?            01/01/70 00:00      
      enphasizing            01/01/70 00:00      
   commented code            01/01/70 00:00      
      Persistance my friend            01/01/70 00:00      
         I'll try it in other way            01/01/70 00:00      
            I'll make the corrections            01/01/70 00:00      
      Note on comments            01/01/70 00:00      
         bad, very bad - yes, but not necessarily because            01/01/70 00:00      
            Subroutine Details            01/01/70 00:00      
               I don't know            01/01/70 00:00      
                I do not know what that information is good for.            01/01/70 00:00      
                  Column scan after ROW confirmation            01/01/70 00:00      
                     Maybe the problem is not here            01/01/70 00:00      
      more Informative code            01/01/70 00:00      
         Comments are better            01/01/70 00:00      
         The Algorithm            01/01/70 00:00      
            This isn\'t necessarily true ...            01/01/70 00:00      
               a correct pain in the gluteus maximus            01/01/70 00:00      
                  Why so much pain?            01/01/70 00:00      
               An exercise for the student            01/01/70 00:00      
               everyone else            01/01/70 00:00      
   Does the LCD Work?            01/01/70 00:00      
      LCD is fine            01/01/70 00:00      

Back to Subject List