- UID
- 1023166
- 性别
- 男
- 来自
- 燕山大学
|
ORG 00H
RS bit p2.5;定义写数据不是命令接口
RW bit P2.6
E bit P2.7
org 0000h
main:
MOV P0,#01H
ACALL ENABLE
MOV P0,#38H
ACALL ENABLE
MOV P0,#0cH
ACALL ENABLE
MOV P0,#06H
ACALL ENABLE
MOV P0,#0d0H
ACALL ENABLE
LOOP:
MOV P0,#41H
ACALL WRITE
ACALL DELAY1
LJMP LOOP
ENABLE:CLR RS
CLR RW
CLR E
ACALL DELAY1
SETB E
RET
WRITE:setb rs
clr rw
clr e
call delay1
setb e
ret
DELAY1:mov r7,#255
d1:mov r6,#255
d2:djnz r6,d2
djnz r7,d1
ret
DELAY: MOV R5,#08H
L7: MOV R4,#0FAH
L8: DJNZ R4,L8
DJNZ R5,L7
RET |
|