📄 hl-1000a.asm
字号:
BTFSs STATUS,0
goto d_v30_32a
btfss currentrun
goto city4a
movlw 113
movwf r2
call mmlt0a0
movfw l_bytea
goto city4a1
city4a:
movlw 113
city4a1:
SUBwf sum,0 ;30%*162=48 ;50%*162=48
BTFSs STATUS,0
goto d_v32_34a
btfss currentrun
goto city5a
movlw 153
movwf r2
call mmlt0a0
movfw l_bytea
goto city5a1
city5a:
movlw 153
city5a1:
SUBwf sum,0 ;30%*162=48 ;50%*162=48
BTFSs STATUS,0
goto d_v34_36a
btfss currentrun
goto city6a
movlw 155
movwf r2
call mmlt0a0
movfw l_bytea
goto city6a1
city6a:
movlw 155
city6a1:
SUBwf sum,0 ;30%*162=48 ;50%*162=48
BTFSs STATUS,0
goto d_v36_38a
BTFSs lightzl,5
goto dv40x1a
decfsz lightcl
goto lzza
goto dv40x2a
dv40x1a: clrf lightzl
movlw 10
movwf lightcl
bsf lightzl,5
goto lzza
dv40x2a: movlw 10
movwf lightcl
bcf light,3
bcf light,4
bcf light,5
bcf light,6
bcf light,2
goto lzza
d_v30xa:
BTFSs lightzl,0
goto dv30x1a
decfsz lightcl
goto lzza
goto dv30x2a
dv30x1a: clrf lightzl
movlw 10
movwf lightcl
bsf lightzl,0
goto lzza
dv30x2a: movlw 10
movwf lightcl
bsf light,3
bsf light,4
bsf light,5 ;0-30%
bcf light,6
bsf light,2
goto lzza
d_v30_32a:
BTFSs lightzl,1
goto dv32x1a
decfsz lightcl
goto lzza
goto dv32x2a
dv32x1a: clrf lightzl
movlw 10
movwf lightcl
bsf lightzl,1
goto lzza
dv32x2a: movlw 10
movwf lightcl
bcf light,6
bsf light,3
bsf light,4 ;31-50%
bcf light,5
bsf light,2
goto lzza
;bcf light,4
d_v32_34a:
BTFSs lightzl,2
goto dv34x1a
decfsz lightcl
goto lzza
goto dv34x2a
dv34x1a: clrf lightzl
movlw 10
movwf lightcl
bsf lightzl,2
goto lzza
dv34x2a: movlw 10
movwf lightcl
bcf light,5
bcf light,6
bsf light,3 ;51-70%
bcf light,4
bsf light,2
goto lzza
d_v34_36a:
BTFSs lightzl,3
goto dv36x1a
decfsz lightcl
goto lzza
goto dv36x2a
dv36x1a: clrf lightzl
movlw 10
movwf lightcl
bsf lightzl,3
goto lzza
dv36x2a: movlw 10
movwf lightcl
bcf light,6
bcf light,4 ;71-95%
bcf light,5
bcf light,3
bsf light,2
goto lzza
;bcf light,4
d_v36_38a:
BTFSs lightzl,4
goto dv38x1a
decfsz lightcl
goto lzza
goto dv38x2a
dv38x1a: clrf lightzl
movlw 10
movwf lightcl
bsf lightzl,4
goto lzza
dv38x2a: movlw 10
movwf lightcl
bcf light,3
bcf light,4 ;96%
bcf light,5
bcf light,6
bcf light,2 ;负载指示
lzza: movfw sum
; BCF STATUS,0
SUBwf rating1,0 ;110%的过载
BTFSs STATUS,0
goto currentover
btfsc overc
goto currentyy1 ;没过载保护清记数
movlw 45
movwf current_time2
bcf currentoverz ;
goto alarm
currentyy1:
decfsz current_time1 ;
goto alarm
decfsz current_time2
goto alarm
movlw 45
movwf current_time2
bcf overc
btfss closeaz
goto closepp1
goto alarm
;*********************************************
;*********************************************过流指示
currentover:
btfss overc
goto currentover1
movlw 20
movwf current_time2
goto alarm
currentover1:
decfsz current_time1 ;
goto currenta
bsf currentoverz
decfsz current_time2
goto currenta
movlw 20
movwf current_time2
btfsc batteryz
;nop
goto close1
btfsc cityz
bsf inphasez
bsf overc ;过流标志
currenta:
movfw sum
SUBWf rating2,0
BTFSC STATUS,0
goto alarm
btfsc batteryz
goto close
btfsc cityz
bsf inphasez
bsf overc ;过流标志
movfw sum
SUBlW 250
BTFSC STATUS,0
goto alarm
goto close
;*********************************************
;;******************************************报警控制
alarm:
;*****************************************显示灯控制
bsf showz
movlw 8
movwf r1
movfw light
movwf r2
show:
bcf sclk
nop
nop
nop
BTFSc r2,0
goto show1
bcf ser
goto show2
show1:
nop
nop
bsf ser
show2:
rrf r2
nop
nop
bsf sclk
decfsz r1
goto show
bcf rclk
nop
nop
bsf rclk
bcf showz
bcf pc,5
bcf pb,3
;**********************************************
;goto startrun
btfsc overc
goto alarmstart
btfsc currentoverz
goto alarmstart
btfsc batterylowz
goto alarmstart
btfsc batteryz
goto alarmstart0
bcf bz1 ;不鸣控制时间
bcf bz1z
goto alarm4 ;有报警信号就跳到关机
alarmstart0:
btfss batteryaz
goto alarm3a
alarmstart:
btfss bz1z ;鸣时状态
goto alarm2
decfsz timer6 ;鸣的时间
goto alarm3
decfsz timer7
goto alarm3
bcf bz1 ;不鸣控制时间
bcf bz1z
btfss overc ;过流傍路报警时间
goto alarmstart1
movlw 20
movwf timer7
bcf light,2
goto alarm4
alarmstart1:
btfss currentoverz
goto alarmstart2
movlw 5
movwf timer7
bsf light,2
goto alarm4
alarmstart2:
btfss batterylowz
goto alarmstart3
movlw 10
movwf timer7
bsf cn10
btfsc batteryaz
goto alarm4
alarmstart3:
movlw 45
movwf timer7
btfsc batteryaz
goto alarm3
alarm2: decfsz timer6 ;不鸣的时间
goto alarm4
decfsz timer7
goto alarm4
bsf bz1z
bsf bz1
btfss overc ;过流傍路报警时间
goto alarmstart1a
movlw 5
movwf timer7
bsf light,2
goto alarm4
alarmstart1a:
btfss currentoverz
goto alarmstart2a
movlw 4
movwf timer7
bcf light,2
goto alarm4
alarmstart2a:
btfss batterylowz
goto alarmstart3a
movlw 10
movwf timer7
bcf cn10
goto alarm4
alarmstart3a:
movlw 5
movwf timer7
btfsc batteryaz
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -