MOV A,R2
JNB ACC.3,EXIT
RL A
MOV R2,A
AJMP LINE0
EXIT: MOV DPTR,#PORTA ;恢复B口输出低电平
MOV A,#00H
MOVX @DPTR,A
POP DPL
POP DPH
POP B
POP ACC
POP PSW
RETI ;没有按
TRYK: ADD A,R3
MOV 3AH,A
LETK: MOV DPTR,#PORTC
MOVX A,@DPTR
XRL A,3BH
JZ LETK
MOV DPTR,#PORTA ;恢复B口输出低电平
MOV A,#00H
MOVX @DPTR,A
POP DPL
POP DPH
POP B
POP ACC
POP PSW
RETI
;*******************电流设置****************
SETONE:
SETB RS0
SETB RS1
;SETB 01H ;置显示闪烁位
SETONE1: MOV A,3AH
CJNE A,#10,L1
L1: JNC SETONE1
JB 00H,L3
CJNE A,#2,L2 ;2000MA
MOV DISP0,#2
MOV DISP1,#0
MOV DISP2,#0
MOV DISP3,#0
;CLR 01H
CLR RS0
CLR RS1
PUSH PSW
SETB RS1
ACALL BCDHEX ;十辣位BCD变十辣进制
ACALL SUBBV ;*2再送DA
POP PSW
CLR A
RET
L2: MOV 3AH,#0FFH
JNC SETONE1
SETB 00H
L3: MOV @R1,A ;即时刷新显示缓冲区
INC R1
MOV 3AH,#0FFH
www.751com.cn
;CLR 01H
CLR RS0
CLR RS1
PUSH PSW
SETB RS1
ACALL BCDHEX ;16字节BCD变二进制
ACALL SUBBV ;*5/8
POP PSW
CLR A
RET
;**********加电流
JIA: MOV 3AH,#0FFH
MOV A,DISP3
INC A
MOV DISP3,A
CJNE A,#10,OUT
MOV DISP3,#0
MOV A,DISP2
INC A
MOV DISP2,A
CJNE A,#10,OUT
MOV DISP2,#0
MOV A,DISP1
INC A
MOV DISP1,A
CJNE A,#10,OUT
MOV DISP1,#0
MOV A,DISP0
上一页 [1] [2] [3] [4] [5] [6] [7] [8] 下一页