assembly - Managing History of a keypad interfaced with an LCD on 8052 -
so i'm writing assembly code interface keypad dot-matrix 7x5 lcd on 8052 micro-controller atmel. of things done , interfacing complete, i.e. keys displayed on lcd whenever pressed. works, problem have interfaced push button external interrupt (int0), when pressed has display history of previous keys pressed ( maximum of 5 ).
what tried push every key pressed stack , whenever push button pressed, should theoretically pop stack 4 times display 2nd last character pressed, while restoring stack before returning returns correct address. problem that, since have couple of sub-routines , delays in lcd output function, have no clue pressed key's value goes stack keeps changing popped value not of key pressed. it's garbage.
i'm new assembly i'm short of answers here.
here's way tried without use of stack. if holds value of key pressed, follows:
mov 05h,06h mov 06h,07h mov 07h,a
theoretically, first value should go 05h, second 06h , 3rd 07h doesn't work @ all.
another thing tried like, mov r1,#18h in beginning:
mov @r1,a inc r1
so 18h holds first value, 19h holds 2nd , on doesn't work. works mov @r1,a followed mov r1,#19h way values followed first value overwritten 19h. i'm guessing inc r1 command doesn't work.
Comments
Post a Comment