|
想让LCD1602显示,汇编编译通过了,但不能显示,求看!
[复制链接]
DU EQU P2.6
WE EQU P2.7
RS EQU P3.5
LCDEN EQU P3.4
ORG 0000H
LJMP INIT
ORG 0030H
INIT:
MOV SP,#0060H
CLR DU
CLR WE
CLR LCDEN
MOV A,#10H
LCALL DELAY
MOV A,0X38
LCALL COM
MOV A,0X06
LCALL COM
MOV A,0X0F
LCALL COM
MOV A,0X01
LCALL COM
MOV A,#20H
CALL DELAY
MOV A,0X80
LCALL COM
LJMP MAIN
COM: MOV P0,A
SETB RS
MOV A,#10H
CALL DELAY
CLR LCDEN
MOV A,#10H
LCALL DELAY
SETB LCDEN
MOV A,#10H
LCALL DELAY
CLR LCDEN
MOV A,#10H
LCALL DELAY
RET
DAT: MOV P0,A
SETB RS
MOV A,#20H
LCALL DELAY
CLR LCDEN
LCALL DELAY
SETB LCDEN
LCALL DELAY
CLR LCDEN
LCALL DELAY
RET
MAIN: CLR P3.6
MOV A,#00H
MOV DPTR,#TAB
MOV R3,0X06
MOVC A,@A+DPTR
LCALL DAT
LCALL DELAY
DJNZ R3,MAIN
SJMP $
DELAY:
MOV R0,A
D1:
MOV R2,#200
D2: DJNZ R2,D2
DJNZ R0,D1
RET
TAB: DB 'I','L','O','V','E','U'
END
|
|