0~99counter仿真原理图如下(proteus仿真工程文件可到本帖附件中下载)
单片机源程序如下:
-
- ORG 0000H
- LJMP START
- ORG 0030H
- START: MOV DPTR,#TABLE
- MOV R0,#00H
- MOV P0,#3FH
- MOV P2,#3FH
- S1: INC R0
- CJNE R0,#100,S2
- MOV R0,#00H
- S2: JB P3.3,$
- LCALL DELAY
- JB P3.3,S2
- S3: MOV A,R0
- MOV B,#10
- DIV AB
- MOVC A,@A+DPTR
- MOV P0,A
- MOV A,B
- MOVC A,@A+DPTR
- MOV P2,A
- JB P3.3,S1
- LJMP S3
- DELAY: MOV R5,#20
- D1: MOV R6,#250
- DJNZ R6,$
- DJNZ R5,D1
- RET
- TABLE: DB 3FH,06H,5BH,4FH,66H
- DB 6DH,7DH,07H,7FH,6FH
- END
复制代码
所有资料51hei提供下载:
0~99counter.rar
(53.19 KB, 下载次数: 25)
|