仿真原理图如下(proteus仿真工程文件可到本帖附件中下载)
单片机汇编语言源程序如下:
org 0000h
jmp Start
;====================================================================
; CODE SEGMENT
;====================================================================
Start:
MOV R2 ,#00
MOV R3 ,#04
MOV DPTR ,#TAB
MOV R7 ,#01
LP0: MOV A ,R2
MOVC A ,@A+DPTR
LP: MOV SBUF ,A
JNB TI ,$
CLR TI
DJNZ R3 ,LP
INC R2
MOV R3 ,#04
ACALL DEL05
CJNE R2 ,#10 ,LP0
MOV R3 ,#04
MOV R2 ,#00
DEC R7
CJNE R7 ,#00 ,LP0
ACALL DEL05
MOV 30H ,#00100100B
MOV R0 ,30H
MOV A ,R0
ANL A ,#0FH
MOVC A ,@A+DPTR
MOV SBUF ,A
JNB TI ,$
CLR TI
ACALL DEL05
MOV A ,R0
ANL A ,#0F0H
SWAP A
MOVC A ,@A+DPTR
MOV SBUF ,A
JNB TI ,$
CLR TI
ACALL DEL05
MOV 31H ,#01000110B
MOV R0 ,31H
MOV A ,R0
ANL A ,#0FH
MOVC A ,@A+DPTR
MOV SBUF ,A
JNB TI ,$
CLR TI
ACALL DEL05
MOV A ,R0
ANL A ,#0F0H
SWAP A
MOVC A ,@A+DPTR
MOV SBUF ,A
JNB TI ,$
CLR TI
ACALL DEL05
RET
TAB: DB 03H,9FH,25H,0DH,99H
DB 49H,41H,1FH,01H, 09H
DEL05: MOV R4,#50
DEL0: MOV R5,#91
DEL1: MOV R6,#100
DJNZ R6,$
DJNZ R5,DEL1
DJNZ R4,DEL0
RET
;====================================================================
END
用的Proteus自带的编译器编译的程序
上图Proteus8.8仿真pdsprj文件下载:
动态显示.zip
(21.94 KB, 下载次数: 6)
|