;------------------------------------
; RFC Mode
;-------------------------------------
RFC_INIT:
;------------------------------------
; clear RFC CONVERT COUNTER
;------------------------------------
ldi dpl,09h
ldi dpm,06h
ldi dph,04h
LDI INX,00H
ADIM DPL,01H
SBI DPL,0eH
BNZ $-3
RFC_RX1:
;-------------------------------------
; NEXT CHANNEL,打开RFC,使能通道RX1
;-------------------------------------
ldi RFC_CHANNEL_ENABLE,1001b
SETB Mode_Control_Enable,3
LDI IRQ,00H
LDI IE,0100B ;打开TIMER0
halt
ADI F_TIMER,0001B ;150Ms到
BA0 $-1 ;A=1 JMP
ANDIM F_TIMER,1110B ;清150Ms标志
clrb Mode_Control_Enable,3
LDI IE,0000B ;关闭TIMER0
;------save rfc counter-----------------
ldi dpl,09h
ldi dpm,06h
ldi dph,04h
lda inx
sta RSCOUNT1
adim dpl,01h
lda inx
sta RSCOUNT2
adim dpl,01h
lda inx
sta RSCOUNT3
adim dpl,01h
lda inx
sta RSCOUNT4
adim dpl,01h
lda inx
sta RSCOUNT5
;------------------------------------
; clear RFC CONVERT COUNTER
;------------------------------------
ldi dpl,09h
ldi dpm,06h
ldi dph,04h
LDI INX,00H
ADIM DPL,01H
SBI DPL,0eH
BNZ $-3
RFC_RX3:
;-------------------------------------
; 打开RFC,使能通道RX3(RF)
;------------------------------------
ldi RFC_CHANNEL_ENABLE,1100b
ldi dpl,09h
ldi dpm,06h
ldi dph,04h
LDI INX,00H
ADIM DPL,01H
SBI DPL,0eH
BNZ $-3
SETB Mode_Control_Enable,3
LDI IRQ,00H
LDI IE,0100B ;打开TIMER0
halt
ADI F_TIMER,0001B ;150Ms到
BA0 $-1 ;A=1 JMP
ANDIM F_TIMER,1110B ;清150Ms标志
clrb Mode_Control_Enable,3
LDI IE,0000B ;关闭TIMER0
;------save rfc counter-----------------
ldi dpl,09h
ldi dpm,06h
ldi dph,04h
lda inx
sta RFCOUNT1
adim dpl,01h
lda inx
sta RFCOUNT2
adim dpl,01h
lda inx
sta RFCOUNT3
adim dpl,01h
lda inx
sta RFCOUNT4
adim dpl,01h
lda inx
sta RFCOUNT5 |