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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
09/06/04 16:47
Read: times


 
#76985 - RE: debouncing for matrix keypad ?
Responding to: ???'s previous message
Here is one approach. It is used with a 28 key keypad (1/2" square momentary switches). The micro is a PIC (no BOOs please) and had to multiplex 6 7-segment LEDs.

I choose a 2 ms ON time for each LED for approx. 83 ms refresh cycle. In the timer interrupt routine, just after one LED is turned off, and before the next it to be turned on, the Keypad routine would check the keypad matrix. The matrix was a 4 x 7; the 7 inputs (driven by a port) were set low and the 4 outputs checked for a low. If a low state were seen, then it would decrement a count of 10 for each 2 ms look. If the same code existed for the 10 counts, it was considered valid. This gave a 20 ms 'debounce' time; easily changed to much longer times. (Assumes only one key down at a time.)

Once the 10 counter decremented to zero, then the row vs column was identified by setting one row low at a time and when found then read the column code and convert both row and column codes from unary to binary. Codes 00h - 0Fh for the hex keypad, and 10h - 1Bh for the 'commands'.

Has been working fine for years.


List of 37 messages in thread
TopicAuthorDate
debouncing for matrix keypad ?            01/01/70 00:00      
   RE: debouncing for matrix keypad ?            01/01/70 00:00      
   correction            01/01/70 00:00      
   RE: debouncing for matrix keypad ?            01/01/70 00:00      
      RE: debouncing for matrix keypad ?            01/01/70 00:00      
         RE: debouncing for matrix keypad ?            01/01/70 00:00      
            RE: debouncing for matrix keypad ?            01/01/70 00:00      
         RE: debouncing for matrix keypad ?            01/01/70 00:00      
            RE: debouncing for matrix keypad ?            01/01/70 00:00      
               RE: debouncing for matrix keypad ?            01/01/70 00:00      
            RE: debouncing for matrix keypad ?            01/01/70 00:00      
               RE: debouncing for matrix keypad ?            01/01/70 00:00      
                  RE: debouncing for matrix keypad ?            01/01/70 00:00      
                     RE: debouncing for matrix keypad ?            01/01/70 00:00      
                        RE: debouncing for matrix keypad ?            01/01/70 00:00      
                           RE: debouncing for matrix keypad ?            01/01/70 00:00      
                              almost            01/01/70 00:00      
                                 RE: almost            01/01/70 00:00      
                                    RE: almost            01/01/70 00:00      
                                       RE: almost            01/01/70 00:00      
         RE: debouncing for matrix keypad ?            01/01/70 00:00      
            RE: debouncing for matrix keypad ?            01/01/70 00:00      
               RE: debouncing for matrix keypad ?            01/01/70 00:00      
                  RE: debouncing for matrix keypad ?            01/01/70 00:00      
                     RE: debouncing for matrix keypad ?            01/01/70 00:00      
                        RE: debouncing for matrix keypad ?            01/01/70 00:00      
            RE: debouncing for matrix keypad ?            01/01/70 00:00      
   my example code            01/01/70 00:00      
      RE: my example code            01/01/70 00:00      
   RE: debouncing for matrix keypad ?            01/01/70 00:00      
      RE: debouncing for matrix keypad ?            01/01/70 00:00      
   RE: debouncing for matrix keypad ?            01/01/70 00:00      
      RE: debouncing for matrix keypad ?            01/01/70 00:00      
   4k7 does not present a strong pull-up!            01/01/70 00:00      
      RE: 4k7 does not present a strong pull-u            01/01/70 00:00      
         RE: 4k7 does not present a strong pull-u            01/01/70 00:00      
            RE: 4k7 does not present a strong pull-u            01/01/70 00:00      

Back to Subject List