8051 Assembly Language Problem
Posted on 2006-04-11
I have a problem. i am trying to create assembly code that reads from a keypad button and sends the value to the display, the buttons are 0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f
the segment codes are as follows, KCODE0: db 3Fh,06h,5Bh,4Fh KCODE1: db 66h,6Dh,7Dh,07h KCODE2: db 7Fh,67h,77H,7Ch KCODE3: db 58h,5Eh,79h,71h
each KCODE relates to a certain coloumn.
My program is meant to display a character say a, when the button a is pressed, and it is meant to stay solid, as in constantly on, until another button is pressed, say b. b then replaces the register of where A resided, and A is shifted to the next register..
The registers available are, R0, R1, R2, R3, this correspoind to the registers, so say R3, would mean this value should show in the most right display. R4, and R5 are used to temporary store values so that they can be compared when buttons are pressed..
My problem that i am having is that when a button is pushed, the register displays the character straight away in the second seven segment display, and the first seven segment display only shows an output when the button is pressed, therefor when the button is depressed, the first seven segment display character disappears and the second seven segment display, the character stays solid..
How would you get it to display two different characters when one button is pushed and when another one is, the register shifts the values...
Hope that explains my problem, Points mostly awarded for helping by providing examples of code:-)
Any questions please ask