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

Back to Subject List

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


 
#124396 - Maybe the problem is not here
Responding to: ???'s previous message

We've told you where the problem is - but you haven't attended to it. I'm sure if you put your code through a simulator, you'd see exactly where your problem is.

Try this for some hints. The delay should be a few 10's of microseconds.

Do you have pullup resistors on P1.0..3? If so, what value.

[pre]
ROW1 .equ efh
ROW2 .equ dfh
ROW3 .equ bfh
ROW4 .equ 7fh

scan_keypad:
mov R2,#0 ;keys 0..3
mov P1,ROW1 ;select row 1
acall delay ;wait for things to settle
mov a,P1
anl a,#0fh ;columns only
jnz test_column
mov R2,#4 ;keys 4..7
mov P1,ROW2 ;select row 2
acall delay ;wait for things to settle
mov a,P1
anl a,#0fh ;columns only
jnz test_column
mov R2,#8 ;keys 8..11
mov P1,ROW3 ;select row 3
acall delay ;wait for things to settle
mov a,P1
anl a,#0fh ;columns only
jnz test_column
mov R2,#12 ;keys 12..15
mov P1,ROW4 ;select row 4
acall delay ;wait for things to settle
mov a,P1
anl a,#0fh ;columns only
jnz test_column
mov a,#NO_KEY ;no key was pressed
ret
[/pre]



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