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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
08/27/06 18:15
Read: times


 
#123145 - could it be your approach?
Responding to: ???'s previous message
423 ms is a pretty long time for a single keypress. If it were a normal keyboard, you'd be likely to miss keystrokes entirely. Unless this is a very, VERY slow keypad, nearly half a second is probably too slow.

I'd say you want to scan the keypad at a 50 ms +/- 20% rate. I doubt that anyone can strike a key and release the key within 50 ms, at least with a typical keypad. On a standard keyboard, intended for typing and not "push-this-button, then-push-that-button" operation, it should probably be 20 ms.

If you see a key pressed, store the value in a register. If, on the next scan, 50 ms later, that same value is present, simply wait for the idle code to return. If it doesn't there's some sort of error, e.g. a multi-key-press, or the like. If a single occurrence of a keypress occurs followed by the idle code, then it's valid. If, OTOH, it's followed by a different code, followed by the idle code, then it's the second code that's valid, since multi-key-presses are typically "misses" meaning that one briefly struck one key while trying to hit the other, so the correct one will persist. If you echo the input to a display of some sort, this error should become obvious to the user if it's misinterpreted, so, no harm, no foul, if you've provided a back-up key.

There are many ways to skin a cat.

RE






List of 20 messages in thread
TopicAuthorDate
problem with delays            01/01/70 00:00      
   Omitted pull-ups at Port 0?            01/01/70 00:00      
      No, it's pulled high            01/01/70 00:00      
         You should see the connection...            01/01/70 00:00      
   could it be your approach?            01/01/70 00:00      
   p0 initialised as input port            01/01/70 00:00      
   post the WHOLE code            01/01/70 00:00      
   WHOLE code            01/01/70 00:00      
      Try this            01/01/70 00:00      
   WHOLE code            01/01/70 00:00      
      Assuming that the external pullups are not working            01/01/70 00:00      
         why is the delay not being excecuted?            01/01/70 00:00      
            HOW DO YOU KNOW            01/01/70 00:00      
               Through debugging            01/01/70 00:00      
                  I know nothing about keil debugger            01/01/70 00:00      
                     make code that resembles the flowchart and you wil            01/01/70 00:00      
      whole?            01/01/70 00:00      
         Ashwins stack handling is totally unsuited!            01/01/70 00:00      
      to generate tone of octave(8keys)with 89c51            01/01/70 00:00      
         sandy please start a new thread            01/01/70 00:00      

Back to Subject List