;************************************************
;************** INT_CTRL
; SETB ie0 ;
; SETB EX0 ;
; SETb ex1 ;
setB ET0 ;
SETB ET1 ;
; SETB IT0 ;
; setb IT1 ;
MOV TMOD,#00010001b ;
MOV TH1,#tih
mov tl1,#til
mov th0,#00h
mov tl0,#00h
;***********RS_CTRL
; MOV SCON,#00H ;
;*****************
; MINI_Pragram
;*****************
mov timers,#tis
mov sec,#00d
;mov al1_hour_t ,al1_hour
;mov al1_min_t ,al1_min
;mov al2_hour_t ,al2_hour
;mov al2_min_t ,al2_min
;mov al3_min_t ,al3_min
;mov al3_hour_t,al3_hour
mov timer_no,#ti_no
mov del4,#00h
;mov beep_timer,#8d
mov del1,#00d
mov del2,#00d
mov del3,#00d
mov del4,#00d
mov key_power,#01d
setb al_out_f
setb tr1
setb ea
setb timer_50ms
STAR_BI:
; setb flash_f
acall led_jmp_1;led_times
aCALL KEY_1
acall al_out_way
acall delay
sjmp star_bi
;;;;;;;;;;;;;;;;;
delay:
inc del3
mov a,del3
cjne a,#0ffh,del_1
mov del3,#00h
inc del4
mov a,del4
cjne a,#040h,del_1
mov del4,#00h
clr flash_f
clr set_f
del_1:
ret
;****************************
; key_pragm
;****************************
KEY_1:
mov p1,#00h
mov p3,#0ffh
clr key_f
mov a,p3
setb key_f
anl a ,#10000011b
cjne a,#10000011b,you_key_1
key_e:
mov p3,#0ffh
setb key_f
mov key_data,#00h
key_1_end:
ret
you_key_1:
mov del3,#0feh
mov del4,#0feh
setb key_f
mov b,#20h
lll_1:
push b
lcall led
pop b
djnz b ,lll_1
mov p1,#00h
mov p3,#0ffh
clr key_f
mov a,p3
setb key_f
anl a ,#10000011b
cjne a,#10000011b,you_key_2
sjmp key_e
you_key_2: jb acc.0 ,key_set
mov key_data,#01h
sjmp you_key_33
key_set: jb acc.1 ,you_key_3
mov key_data,#02h
sjmp you_key_33
you_key_3:
jb acc.7 ,you_key_33
mov key_data,#03h
sjmp you_key_33
you_key_33:
setb key_f
acall led
inc del1
mov a,del1
cjne a,#0ffh ,jhg_1
mov del1,#00h
inc del2
mov a,del2
cjne a,#08h ,jhg_1
mov del2,#00h
setb flash_f
setb set_f
; mov key_power,#01h
; mov key_data,#00h
jhg_1:
mov p1,#00h
mov p3,#0ffh
clr key_f
mov a,p3
anl a ,#10000011b
cjne a,#10000011b,you_key_33
setb key_f
mov p3,#0ffh
mov del1,#00h
mov del2,#00h
; acall beep
mov r6,#040h
bb_1:
;!!!!!!!!!!!!!!!!!!!!!!!!!!
clr ha
setb key_f
acall led
acall led
djnz r6 ,bb_1
setb ha
;******************************************
mov dptr,#key_ord_1
mov a,key_data
mov b,#03h;!!!!!!!!!!!!!!!
mul ab
jmp @a+dptr
key_ord_1: ljmp key_k0_0
ljmp key_k1_0
ljmp key_k2_0
ljmp key_k3_0
key_k0_0: ;no key
ajmp key_1_end
key_k1_0: ; key_3
acall key_3
ajmp key_1_end
key_k2_0: ; key_2
acall key_2
ajmp key_1_end
key_k3_0: ; key_1
inc key_power
mov a,key_power
cjne a,#08h ,io_1
mov key_power,#01h
io_1:
ajmp key_1_end
;**************************************
proc key_3
key_3:
mov dptr,#led_ord_3
mov a,key_power ;data
mov b,#02h
mul ab
jmp @a+dptr