sonix單片機做的消毒柜
main00:
b0bts1 F_KEY
jmp Main
b0bclr F_KEY
b0bts0 KPOWER
jmp Poweractive
b0bts0 KLIGHT
jmp Lightactive
b0bts0 KHOUR
jmp Houractive
b0bts0 KMINUTE
jmp Minuteactive
b0bts1 F_ON_OFF
jmp Main
b0bts0 KSTER90
jmp Ster90active
b0bts0 KSTER45
jmp Ster45active
b0bts0 KDRY30
jmp Dry30active
b0bts1 KDRY60
jmp Main
;\\\\\\\\\\\\\
Dry60active:
b0bts0 F_STER
jmp Dry60active02
Dry60active01:
clr flag2
b0bset F_DRY60
call Clrstatus01
MOV a,#60
jmp Dry30active02
Dry60active02:
b0bts0 F_DISPLAY_FLASH60
jmp Dry60active04
b0bset F_DISPLAY_FLASH60
b0bclr F_DISPLAY_FLASH30
b0bset F_DISPLAY_FLASH
b0bclr F_MINUTE
b0 MOV a,Dminute_dry
sub a,#60
b0bts0 FC
jmp Dry60active03
MOV a,#60
b0 MOV Dminute_dry,a
Dry60active03:
MOV a,#10
b0 MOV delaybuffer,a
b0bset F_DELAY
jmp Keyactive01
Dry60active04:
clr flag4
b0bts1 F_MINUTE
jmp Dry60active01
b0bclr F_MINUTE
jmp Keyactive01
;\\\\\\\\\\\\\
;********************
Poweractive:
b0bts1 F_ON_OFF
jmp Poweractive01
call Clrstatus
clr flag4
jmp Keyactive01
Poweractive01:
b0bset F_ON_OFF
jmp Ster90active
;***********
Dry30active:
b0bts0 F_STER
jmp Dry30active03
Dry30active01:
clr flag2
b0bset F_DRY30
call Clrstatus01
MOV a,#30
b0bset FAN
b0bset F_FAN
Dry30active02:
b0bset F_DRY
b0bset DRY
;\\\\\\\\\\\\\
Keyactive:
b0 MOV Dminute,a
clr Dsecond
Keyactive01:
clr flashtime
b0bset F_FLASH1
b0bts0 F_NO_TONE
jmp Main
b0bset TONE_ENABLE
clr tonetime
jmp Main
;*******************
Dry30active03:
b0bts0 F_DISPLAY_FLASH30
jmp Dry30active04
b0bset F_DISPLAY_FLASH30
b0bclr F_DISPLAY_FLASH60
b0bset F_DISPLAY_FLASH
b0bclr F_MINUTE
b0 MOV a,Dminute_dry
sub a,#60
b0bts1 FC
jmp Dry60active03
MOV a,#30
b0 MOV Dminute_dry,a
jmp Dry60active03
Dry30active04:
clr flag4
b0bts1 F_MINUTE
jmp Dry30active01
b0bclr F_MINUTE
jmp Keyactive01
;\\\\\\\\\\\\\
Lightactive:
b0bts0 F_LIGHT
jmp Lightactive01
b0bset F_LIGHT
b0bset LIGHT
jmp Keyactive01
Lightactive01:
b0bclr F_LIGHT
b0bclr LIGHT
jmp Keyactive01
;\\\\\\\\\\\\\
Houractive:
clr flag4
b0bts0 F_ON_OFF
jmp Houractive02
Houractive01:
incms hour
nop
b0 MOV a,hour
sub a,#12
b0bts0 FC
clr hour
jmp Keyactive01
Houractive02:
MOV a,#0x05
b0 MOV delaybuffer,a
b0bts0 F_DELAY
jmp Houractive01
b0bset F_DELAY
jmp Keyactive01
;\\\\\\\\\\\\\
Minuteactive:
b0bts0 F_ON_OFF
jmp Minuteactive02
Minuteactive01:
incms minute
nop
b0 MOV a,minute
sub a,#60
b0bts0 FC
clr minute
jmp Keyactive01
Minuteactive02:
b0bts0 F_DISPLAY_FLASH30
jmp Dry30_time_ster
b0bts0 F_DISPLAY_FLASH60
jmp Dry60_time_ster
incms Dminute
nop
b0bts0 F_STER90
jmp Ster90_time
b0bts0 F_STER45
jmp Ster45_time
b0bts0 F_DRY60
jmp Dry60_time
b0bts0 F_DRY30
jmp Dry30_time
b0bts0 F_DELAY
jmp Minuteactive01
jmp Main
Dry30_time:
b0 MOV a,Dminute
sub a,#60
b0bts1 FC
jmp Keyactive01
MOV a,#30
jmp Keyactive
Dry60_time:
b0 MOV a,Dminute
sub a,#121
b0bts1 FC
jmp Keyactive01
MOV a,#60
jmp Keyactive
Ster45_time:
b0 MOV a,Dminute
sub a,#90
b0bts1 FC
jmp Keyactive01
MOV a,#45
jmp Keyactive
Ster90_time:
b0 MOV a,Dminute
sub a,#241
b0bts1 FC
jmp Keyactive01
MOV a,#90
jmp Keyactive
;\\\\\\\\\\\\\
Dry30_time_ster:
incms Dminute_dry
nop
b0 MOV a,Dminute_dry
sub a,#60
b0bts1 FC
jmp Dry60_time_ster01
MOV a,#30
b0 MOV Dminute_dry,a
jmp Dry60_time_ster01
Dry60_time_ster:
incms Dminute_dry
nop
b0 MOV a,Dminute_dry
sub a,#121
b0bts1 FC
jmp Dry60_time_ster01
MOV a,#60
b0 MOV Dminute_dry,a
Dry60_time_ster01:
MOV a,#15
b0 MOV delaybuffer,a
b0bset F_DELAY
b0bset F_MINUTE
b0bclr F_FLASH
clr timer
jmp Keyactive01
;\\\\\\\\\\\\\
Ster90active:
MOV a,#60
b0 MOV Dminute_Dry,a
clr flag2
b0bset F_STER90
call Clrstatus01
MOV a,#90
jmp Ster45active01
;\\\\\\\\\\\\\
Ster45active:
MOV a,#60
b0 MOV Dminute_Dry,a
clr flag2
b0bset F_STER45
call Clrstatus01
MOV a,#45
Ster45active01:
clr flag4
b0bset F_STER
b0bset STER
jmp Keyactive
;\\\\\\
AdjDisplay:
b0bts1 F_STER90
jmp AdjDisplay01
MOV a,Dminute
sub a,#45
b0bts0 FC
ret
b0bclr F_STER90
b0bset F_STER45
ret
AdjDisplay01:
b0bts1 F_DRY60
ret
MOV a,Dminute
sub a,#30
b0bts0 FC
ret
b0bclr F_DRY60
b0bset F_Dry30
ret
Segtable:
; ; afbgcxed
dw 0xffeb ;b’11101011’ ;0
dw 0xff28 ;b’00101000’ ;1
dw 0xffb3 ;b’10110011’ ;2
dw 0xffb9 ;b’10111001’ ;3
dw 0xff78 ;b’01111000’ ;4
dw 0xffd9 ;b’11011001’ ;5
dw 0xffdb ;b’11011011’ ;6
dw 0xffe8 ;b’11101000’ ;7
dw 0xfffb ;b’11111011’ ;8
dw 0xfff9 ;b’11111001’ ;9
endp
評論