本帖最后由 wangerping 于 2010-4-1 14:40 编辑
我的这个程序(是教程上的),用keil编译通过了。但与Proteus联调的时候,却lcd上面没有显示任何东西,为什么啊?是程序错了,还是设置出了问题呢?程序如下,电路在附件,愿大虾们指教哦:
RS BIT P2.7
RW BIT P2.6
E BIT P2.5
DOUT EQU P3
ORG 0030H
LOP: MOV SP, #5FH
ACALL LCD_MODEL
MOV DOUT, #81H
ACALL READY
MOV DPTR, #TAB
ACALL WRITE
MOV P3, #0C1H
ACALL READY
MOV DPTR, #TAB1
ACALL WRITE
AJMP $
WRITE: CLR A
MOVC A, @A+DPTR
CJNE A, #0FFH,s
AJMP EXIT
S: MOV DOUT, A
ACALL WRITE1
INC DPTR
AJMP WRITE
EXIT: RET
WRITE1: SETB RS
CLR RW
CLR E
ACALL DELAY
SETB E
RET
LCD_MODEL: MOV DOUT, #01H
ACALL READY
MOV DOUT, #03H
ACALL READY
MOV DOUT, #00000110B
ACALL READY
MOV DOUT, #00001100B
ACALL READY
MOV DOUT, #38H
ACALL READY
RET
READY: CLR RS
CLR RW
CLR E
ACALL DELAY
SETB E
RET
DELAY: MOV DOUT, #0FFH
CLR RS
SETB RW
CLR E
NOP
SETB E
JB DOUT.7, DELAY
RET
TAB: DB 43H,5AH,50H,4DH,43H,55H
DB 40H,31H,32H,36H,2EH,63H,6FH,6DH,01H
DB 0FFH
TAB1: DB 54H,45H,4CH,30H,31H,32H,33H,34H,35H
DB 36H,37H,38H,39H,30H,31H
DB 0FFH
END |