rrc code_recorder2
rrc code_recorder1
inc code_total
clr signal_high
MOV a,@24
xor a,code_total
jbc r3,2
jmp collect_end
input_low:
inc signal_low
MOV a,signal_low ;信号低电平宽度大于800US时滤除
sub a,@40
jbs r3,0
ret
call delay20us
jbs port6,2;3
jmp input_low
jmp collect1
collect_end:
MOV a,code_recorder1 ;校验低字节地址
xor a,@code_address1
jbs r3,2
ret
MOV a,code_recorder2 ;校验高字节地址
xor a,@code_address2
jbs r3,2
ret
jbs KEY_STATUS,check_flag ;是否是第一串收码?
jmp storage_data
bc KEY_STATUS,check_flag
MOV a,com_data_rec
xor a,data_recorder
jbs r3,2
jmp storage_data
MOV a,data_recorder
xor a,@autorun_value ;是启动键?
jbs r3,2
jmp key1
bs KEY_STATUS,autorun_key ;置启动键标志
bs KEY_STATUS,press_flag ;置有键按下标志
clr key_counter ;清除按键间隔计数器
ret
key1:
MOV a,data_recorder
xor a,@open_value ;是解除键?
jbs r3,2
jmp key2
bs KEY_STATUS,open_key
bs KEY_STATUS,press_flag
clr key_counter
ret
key2:
MOV a,data_recorder
and a,@0x0c ;同时有两个键按下时不为0X30
xor a,@lock_value ;是防盗键?
jbs r3,2
jmp key3
bs KEY_STATUS,lock_key
bs KEY_STATUS,press_flag
clr key_counter
key3:
MOV a,data_recorder
and a,@0x30
上一页 [1] [2] [3] 下一页
本文关键字:程序 摩托车 防盗器 PIC单片机,单片机-工控设备 - PIC单片机