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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
10/12/99 02:48
Read: times


 
#838 - Reply to Jana---LCD and keypad
Jana has a problem with keypad and an LCD.
He wants every time he press a button in the keypad (encoder 74c922) to see in the display an asterisk *
I think that is very interesting so i decide to write something that i recently try it

If u have any other ideas please help him
Thanks

EN EQU P2.7
RW EQU P2.6
RS EQU P2.5
DATABYTE EQU P0
BLCD DATA 25H
LCD_LINE DATA 24h
BFLAG BIT 2Fh ;25.7 = 2Fh
;busy flag

star equ 00101010B ; m1632 lcd
;module
org 0000h
lcall wait_lcd
lcall init_lcd
Lcall key_is_pressed
;.......

init_lcd: ;initilaze
;;;;;;;;;




ret




WAIT_LCD: SETB EN
SETB RW
CLR RS
MOV dAtaBYTE,#11111111B
MOV BLCD,DATABYTE JB BFLAG,WAIT_LCD RET

key_is_pressed:
jb p3.3,$
lcall write_asterisk
lcall wait_lcd
jnb p3.3,$
ret



WRITE_asterisk: MOV A,#0
MOV R0,#0
MOV dPTR,#TABLE_STAR
LOOP117: MOVC A,@A+DPTR
SETB EN
SETB RS
CLR RW
MOV DATABYTE,A
CLR EN
ACALL WAIT_LCD
INC R0
MOV A,R0
CJNE R0,#1,LOOP117
RET


TABLE_STAR: DB STAR

No replies in thread

Back to Subject List