📄 rfreceive.asm
字号:
;.data
;I_RF_receive equ P0.0
;RF_Time_step ds 1
;RFflag ds 1
; RF_data_val equ #8
;RF_data_count ds 1
;RF_receivebuf ds 1
;RF_receiveRam ds 1
; RF_pilot_detect_f equ RFflag.0
; RF_receive_start_f equ RFflag.1
; Time2ms_f equ RFflag.2
; RF_receive_data_f equ RFflag.3
; RF_step_ctr equ RFflag.4
; RF_receive_finish equ RFflag.5
;.code
;receive data information
RF_Pilot_detect: ;Note: call at @@main
bts0 RF_receive_start_f
jmp RF_Pilot_detect90
b0bts0 I_RF_receive
jmp RF_Pilot_detect10
bclr RF_pilot_detect_f
mov a,RFflag ;clear flag bit, notice!!!
and a,#00100000b
mov RFflag,a
jmp RF_Pilot_detect90
RF_Pilot_detect10: ;Signal High Level
bts0 RF_pilot_detect_f
jmp RF_Pilot_detect20
bset RF_pilot_detect_f
bset Time2ms_f
mov_ @Sys2msC,@Sys2msStep
bclr @Sys2msIRQ
jmp RF_Pilot_detect90
RF_Pilot_detect20:
bts1 @Sys2msIRQ
jmp RF_Pilot_detect90
bset RF_receive_start_f
bclr RF_pilot_detect_f
Open_P00INT
mov a,RF_data_val
mov RF_data_count,a
; jmp RF_Pilot_detect90
RF_Pilot_detect90:
ret
;--------------------------------------
RF_Falling_detect: ;Note: call at @@int_p00
bts0 RF_receive_data_f
jmp RF_Falling_detect10
bset RF_receive_data_f
bset RF_step_ctr
clr RF_Time_step
clr RF_receivebuf
jmp RF_Falling_detect90
RF_Falling_detect10:
mov a,RF_Time_step
cja a,#11,RF_receive_err
@jmp_a 10
nop ;a=0 |
nop ;a=1 |
jmp RF_receive_err ;a=2 400us
nop ;a=3 |
nop ;a=4 |
nop ;a=5 |
jmp RF_receive_0 ;a=6 1200us
nop ;a=7 |
jmp RF_receive_err ;a=8 1600us
nop ;a=9 |
nop ;a=10 |
jmp RF_receive_1 ;a=11 2200us
RF_receive_0:
b0bclr fc
rrcm RF_receivebuf
jmp RF_receive_process
RF_receive_1:
b0bset fc
rrcm RF_receivebuf
; jmp RF_receive_process
RF_receive_process:
bset RF_step_ctr
clr RF_Time_step
decms RF_data_count
jmp RF_Falling_detect90
clr RFflag
mov a,RF_receivebuf
and a,#11000000b
cmprs a,IDcode
jmp RF_receive_err
mov a,RF_receivebuf
and a,#00111111b
mov RF_receiveRam,a
bset RF_receive_finish
jmp RF_Falling_detect80
RF_receive_err:
; clr RFflag
mov a,RFflag ;clear flag bit, notice
and a,#00100000b
mov RFflag,a
RF_Falling_detect80:
Close_P00INT
RF_Falling_detect90:
jmp RF_Falling_detect_ret
;--------------------------------------------
RF_Timecount_pro: ;Note: call at 200us's Process
bts1 RF_step_ctr
jmp RF_Timecount_pro90
RF_Timecount_pro50:
incms RF_Time_step
nop
; jmp RF_Timecount_pro90
RF_Timecount_pro90:
jmp RF_Timecount_pro_ret
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -