Code:
ORG 00H
MAIN:
LCALL SCANMT
SJMP MAIN
SCANMT:
MOV R1,#0
SPEED:
MOV R5,#10
CH:
MOV R0,#00H
START:
MOV A,R0
MOV DPTR,#COT
MOVC A,@A+DPTR
MOV P2,A
MOV A,R0
ADD A,R1
MOV DPTR,#HANG
MOVC A,@A+DPTR
MOV P3,A
ACALL DELAY
INC R0
CJNE R0,#8,START
DJNZ R5,CH
INC R1
CJNE R1,#40,SPEED
RET
DELAY:
MOV TMOD,#01H
NAP:
MOV TH0,#0FCH
MOV TL0,#18H
SETB TR0
WAIT_OVER:
JNB TF0,WAIT_OVER
CLR TR0
CLR TF0
RET
COT: DB 01H,02H,04H,08H,10H,20H,40H,80H
HANG:
DB 7EH,81H,81H,81H,81H,0H,0H,0H ;C
DB 0H,0FFH,18H,18H,18H,18H,0FFH,0H ;H
DB 0H,82H,0FEH,0FEH,82H,0H,0H,0H ;I
DB 0H,0H,0FFH,11H,11H,11H,0EH,0H ;P
END
( File Mô Phỏng + Code + Phần mềm)
Nguồn: EchipKool - Chia sẻ kiến thức - Kết nối đam mê điện tử
Đăng nhận xét