Rushdiey
Junior Member level 2
- Joined
- Jan 10, 2013
- Messages
- 24
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Activity points
- 1,419
I got the keypade code..
But how to relate them?
This my keypad code
But how to relate them?
This my keypad code
Code:
EN EQU P1.1
RW EQU P1.3
RS EQU P1.2
DP1 EQU P3.0
ORG 00H
START: ACALL DELAY
MOV R5,#28H
ACALL COMMAND
MOV R5,#0EH
ACALL COMMAND
MOV R5,#01H
ACALL COMMAND
MOV R5,#06H
ACALL COMMAND
MOV R5,#80H
ACALL COMMAND
;MOV R5,#7
;LOOP: ; ACALL TULIS
MOV R5,#80H
ACALL COMMAND
MOV R5,#'S'
ACALL TULIS
MOV R5,#82H
ACALL COMMAND
MOV R5,#'A'
ACALL TULIS
MOV R5,#84H
ACALL COMMAND
MOV R5,#'Y'
ACALL TULIS
MOV R5,#86H
ACALL COMMAND
MOV R5,#'A'
ACALL TULIS
MOV R5,#0C1H
ACALL COMMAND
MOV R5,#'C'
ACALL TULIS
;DJNZ R5,LOOP
; MOV R5,#9
; ACALL TULIS
HERE: SJMP HERE
MOV DPTR,#0150H
;MOV R1,#0
NEXT_CHAR: MOV A,#0
MOVC A,@A+DPTR
JZ STRING_END
;ACALL DELAY
MOV R5,A
ACALL TULIS
INC DPTR
AJMP NEXT_CHAR
STRING_END: SJMP $
CLOCK: SETB EN
ACALL DELAY_INIT
CLR EN
ACALL DELAY_INIT
NOP
RET
TULIS: MOV A,R5
;ORL A,#30H
ANL A,#0F0H
MOV P1,A
SETB RS
CLR RW
ACALL CLOCK
MOV A,R5
; ORL A,#30H
SWAP A
MOV P1,A
SETB RS
CLR RW
ACALL CLOCK
RET
COMMAND: MOV A,R5
ANL A,#0F0H
MOV P1,A
CLR RS
CLR RW
ACALL CLOCK
MOV A,R5
SWAP A
MOV P1,A
CLR RS
CLR RW
ACALL CLOCK
RET
DELAY: MOV R7,#0FFH
DEL: NOP
NOP
DJNZ R7,DEL
RET
DELAY_INIT: MOV R7,#0FFH
DEL1: NOP
NOP
NOP
NOP
NOP
NOP
NOP
DJNZ R7,DEL1
STOP: RET
ORG 0150H
TABLE: DB ' ',0
END
Last edited by a moderator: