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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
06/30/06 19:21
Read: times


 
#119491 - Algorithm for Scanning 4*4 Keypad
Responding to: ???'s previous message
Hi,
for hardwae part you could refer to the Michael Karas circuit given to you before. Here is the link for it.

http://www.8052.com/forum/read.phtml?id=88596

only change is, for my logic you use port (1.0 - 1.3) for rows and port (2.0 - 2.3) for columns.

Logic:
1)set port 1 as all zero's.
2)set port 2 as all one's.
3)check column port (port 2.0 - 2.3) for all one's.
if not true goto 1
4)call 20 msec delay
5)check for key press (port 2 value compared to 00001111)
if not equal then it shows that key is pressed.
so use 20msec delay for debounce.

So, as of now we have detected switch press.

To detect which key was pressed...
gound each bit of port 1 starting from LSB and check whether the switch press is detected.

eg: set port 1 as 11111110.
now check for key press.

if key press is detected for the condition shown in the eg.,then the address of the lookup table that is written corresponding to row 1 is moved to the DPTR(data pointer register)
Then the content of the accumulator is right shifted through carry (see RRC instruction)
Then carry bit is watched (for identifying the location of the key is pressed).
if carry bit is set to zero, then
contents in accumulator is cleared and the contents at the address @A+DPTR is moved to accumulator and is send out through the desired port, say port 0.

Thats all.

Suresh.



List of 36 messages in thread
TopicAuthorDate
4x3 keypad interfacing with At89c51            01/01/70 00:00      
   5 errors            01/01/70 00:00      
      Nice attitude!            01/01/70 00:00      
         If the approach is that anyone can get h            01/01/70 00:00      
            Do we know him?            01/01/70 00:00      
               Switch Depressed?            01/01/70 00:00      
                  continous and continous            01/01/70 00:00      
                     Thanks Erik!            01/01/70 00:00      
                  Taking samples            01/01/70 00:00      
                     debounce scheme.            01/01/70 00:00      
                        How to debounce without jumps and branch            01/01/70 00:00      
                           Thank you Kai...            01/01/70 00:00      
                           Having gone through your detailed descri            01/01/70 00:00      
                              Yes, I think so            01/01/70 00:00      
                                 Could you assist me to know that            01/01/70 00:00      
                                    Vertically incrementing            01/01/70 00:00      
                                       Thanks            01/01/70 00:00      
               Homework it is            01/01/70 00:00      
                  "Guilty"...            01/01/70 00:00      
   Post your code            01/01/70 00:00      
      2            01/01/70 00:00      
         There have been several threads            01/01/70 00:00      
         How to post code            01/01/70 00:00      
         why so complex            01/01/70 00:00      
         What Compiler ?            01/01/70 00:00      
            Compiler.KEIL            01/01/70 00:00      
         general idea            01/01/70 00:00      
            Diodes to prevent ghosting            01/01/70 00:00      
    Algorithm for Scanning 4*4 Keypad            01/01/70 00:00      
      thanks            01/01/70 00:00      
         If you'd searched, you'd have had this            01/01/70 00:00      
            Search term "4x4 keypad"            01/01/70 00:00      
   check this code.            01/01/70 00:00      
      Answers            01/01/70 00:00      
   Sorry kai.            01/01/70 00:00      
      keypad scanner in C            01/01/70 00:00      

Back to Subject List