一位显示电瓶车充电定时器说明书
一、插座功能:上电后,显示“F”,表示插座电源关闭。
用调整键调整等待通电时间,从0到E可调,(0-9,A、b、C、d、E、F),其中10-14,分别用A-E,用F表示不充电,等待时间调到0是表示立即开始充电。
二、充电时间默认9小时,等待期间显示已等待时间,开始充电后改为显示已充电时间(小时)。充电完毕显示“F”。短按调整键后显示F,长按调整键会修改等待时间,从0开始逐步增加,若要马上充电,调整为0,若想停电,调整为F。
三、该插座接市电(220V50HZ),用秒点闪烁表示定时器工作,秒点停闪,表示定时器不工作。
;程序名称:等5充9电瓶充电插座
电路及程序设计:浙江缙云职业中专:周长洪
;汇编程序:
DATA50MS EQU 30H
SECONDS DATA 31H
MINUTES DATA 32H
HOURS DATA 33H
TO5S DATA 34H
DATE DATA 35H
TO
WEEK DATA 37H
MONTH DATA 38H
SIZEA DATA 39H
YEARS DATA 3AH
LOWT DATA 3BH
THL DATA 3CH
ON_H DATA 3DH
ON_M DATA 3EH
OF_H DATA 3FH
OF_M DATA 50H
FLAG1 DATA51H
LL DATA 52H
HH DATA 53H
FLAG BIT 25H.2
LEYE BIT 25H.3
SIZE01 BIT 25H.6
POINT BIT P1.6
MENU BIT P1.3
KEYADD BIT P3.7
LED0 BIT P3.3
OUT BIT P3.0
TEST BIT P3.4
ORG 0000H
LJMP START
ORG 000BH
LJMP CLOCK
ORG 0030H
START:MOV R0,#30H
MOV R1,#16
CCC:MOV @R0,#0
INC R0
DJNZ R1,CCC
MOV R0,#50H
MOV R1,#16
C50:MOV @R0,#0
INC R0
DJNZ R1,C50
MOV P3,#0FFH
SETB 25H.0
SETB 25H.1
SETB 25H.2
SETB 25H.3
SETB 25H.5
SETB 25H.6
SETB 25H.7
SETB POINT
SETB MENU
SETB KEYADD
SETB FLAG
MOV OF_H,#9
MOV DATE,#15H
MOV WEEK,#3
MOV YEARS,#15H
MOV LOWT,#5H
MOV MONTH,#6
MOV TMOD,#01H
MOV TH0,#3CH
MOV TL0,#
MOV THL,TL0
SETB ET0
SETB TR0
SETB EA
MAIN0:CLR ET0
CLR TR0
CLR EA
MOV SECONDS,#0
MOV ON_H,#15
SETB 25H.1
MOV R0,#ON_H
ACALL DIS
SETB KEYADD
JB KEYADD,MAIN0
MAIN:ACALL TOADJ
ACALL H_M_S
MOV R0,#HOURS
ACALL DIS
ACALL TINF
LJMP
TOADJ:SETB KEYADD
JB KEYADD,EXITADJ
ACALL DEL20MS
SETB KEYADD
JB KEYADD,EXITADJ
AJMP H0ADJ
EXITADJ:RET
ADJDEL:MOV R3,#8
H01:MOV R2,#21H
H00:ACALL DIS
ACALL DEL20MS
DJNZ R2,H00
SETB KEYADD
JNB KEYADD,EXITA
DJNZ R3,H01
EXITA:RET
H0ADJ:MOV R0,#ON_H
ACALL ADJDEL
SETB KEYADD
JB KEYADD,EXITH0
ADJ: MOV A,ON_H
ADD A,#1
CJNE A,#16,DEPH0
MOV A,#0
DEPH0:MOV ON_H,A
MOV R0,#ON_H
DISX:ACALL ADJDEL
SETB KEYADD
JNB KEYADD,ADJ
MOV HOURS,#0
MOV MINUTES,#0
MOV SECONDS,#0
SETB ET0
SETB TR0
SETB EA
SETB OUT
CLR FLAG
EXITH0:RET
H_M_S:MOV A,DATA50MS
CJNE A,#0AH,NEXT
SETB 25H.0
NEXT: CJNE A,#14H,EXIT
CLR 25H.0
MOV DATA50MS,#0
MOV A,SECONDS
ADD A,#1
MOV SECONDS,A
CJNE A,#16,EXIT
MOV SECONDS,#0
INC TO
MOV A,MINUTES
ADD A,#1
MOV MINUTES,A
CJNE A,#60,EXIT
MOV MINUTES,#0
MOV A,HOURS
ADD A,#1
MOV HOURS,A
NEXT1:CJNE A,#60,EXIT
MOV HOURS,#0
EXIT: ;MOV HOURS,MINUTES
;MOV HOURS,SECONDS
RET
DIS:MOV A,@R0
MOV DPTR,#TAB
MOVCA,@A+DPTR
MOVP1,A
JB25H.0,D1
SETBPOINT
ACALLDEL1MS
D1: CLR LED0
ACALL DEL1MS
CLR POINT
RET
TINF:JB FLAG,TIOF
MOV A,ON_H
CJNE A,#15,NEXTT
AJMP OF0
NEXTT:MOV B,A
MOV A,HOURS
CJNE A,B,EXITNF;TIOF
OF1: CLR OUT
MOV HOURS,#0
MOV MINUTES,#0
MOV SECONDS,#0
SETB FLAG
TIOF:MOV A,HOURS
MOV B,OF_H
CJNE A,B,EXITNF
OF0: SETB OUT
CLR EA
CLR TR0
CLR ET0
CLR POINT
SETB FLAG
AJMP MAIN0
EXITNF:RET
CLOCK:PUSH ACC
PUSH PSW
CLR EA
INC DATA50MS
MOV A,DATA50MS
CJNE A,#20,EXIT0
MOV R4,LOWT
DJNZ R4,$
EXIT0:MOV TL0,THL
MOV TH0,#3CH
POP PSW
POP ACC
SETB EA
RETI
DEL1MS:MOV R6,#0
DJNZ R6,$
DJNZ R6,$
RET
DEL20MS:MOV R6,#35
D20:MOV R7,#0FFH
ACALL H_M_S
DJNZ R7,$
DJNZR6,D20
RET;
DEL1S: MOV R5,#0FFH
ACALLDIS
D1S: DJNZR5,D1S
RET
TAB:DB0B7H,82H,3BH,0ABH,8EH,0ADH,0BDH,83H,0BFH,0AFH
DB 9FH,0BCH,35H,0BAH,3DH,1DH
;其中;数码管在P1口的对应位置如下:
;c/h/d/e/g/f/b/a=P1.7/1.6/1.5/1.4/1.3/1.2/1.1/1.0=
;
;DB
;DB 77H,0D6H,
;DB73H,37H,0D5H,97H
;TAB:DB
;DB 77H,0D6H,
;其它常用字符:"H"76H**"0."0FDH**"1."0DH**
;"2."0DBH**"A."
;"F."
;"U"0D5H**"U."0DDH**"P"73H**“y"97H
;数码管在P1口的对应位置如下:
;d/e/a/f/h/c/g/b=P1.7/1.6/1.5/1.4/1.3/1.2/1.1/1.0
;TAB:DB3FH,06H,5BH,4FH,66H,6DH,7DH,07H,7FH,6FH
;DB 77H,7CH,39H,5EH,79H,71H
;*********************************
;TAB1:DB3FH,06H,5BH,4FH,66H,6DH,7DH,07H,7FH,6FH
; DB
END
联系客服