LED_0 EQU 30H
LED_1 EQU 31H
LED_2 EQU 32H
ADC EQU 35H
CLOCK BIT P2.4
ST BIT P2.5
EOC BIT P2.6
OE BIT P2.7
ORG 00H
SJMP START
ORG 0BH
LJMP INT_T0
START: MOV LED_0, #00H
MOV LED_1, #00H
MOV LED_2, #00H
MOV DPTR, #TABLE
MOV TMOD, #02H
MOV TH0, #4CH
MOV TL0, #00H
MOV IE, #82H
SETB TR0
WAIT: CLR ST
SETB ST
CLR ST
JNB EOC, $
SETB OE
MOV ADC, P1
CLR OE
MOV A,ADC
MOV B,#100
DIV AB
MOV LED_2, A
MOV A, B
MOV B, #10
DIV AB
MOV LED_1, A
MOV LED_0, B
LCALL DISP
SJMP WAIT
INT_T0: CPL CLOCK
RE
ti
DISP: MOV A, LED_0
MOVC A, @A+DPTR
CLR P2.3
MOV P0, A
LCALL DELAY
SETB P2.3
MOV A, LED_1
MOVC A,@A+DPTR
CLR P2.2
MOV P0, A
LCALL DELAY
SETB P2.2
MOV A, LED_2
MOVC A, @A+DPTR
CLR P2.1
MOV P0, A
LCALL DELAY
SETB P2.1
RET
DELAY: MOV R6, #10
D1: MOV R7, #250
DJNZ R7, $
DJNZ R6, D1
RET
TABLE: DB 3FH, 06H, 5BH, 4FH, 66H
DB 6DH, 7DH, 07H, 7FH, 6FH
DB 40H
END
大家帮忙看看,这是我的电压表的图跟程序代码,为什么用
proteus运行出来之后是乱码呢?在线求教育。。。
-
-
程序.txt
下载积分: 积分 -1 分
1.38 KB, 下载次数: 14, 下载积分: 积分 -1 分
一周热门 更多>