D0 BIT P0.0
D1 BIT P0.1
D2 BIT P0.2
D3 BIT P0.3
DV8870 BIT P0.4
;+++++++++++++++++++++ 双音频解码到TONE ++++++++++++++++++
DTMF_HEX: ORL P0, #1FH
MOV WDT_CONTR, #00111111B ;清看门狗
DTMF_WT1: JNB DV8870, $
LCALL Y10M
LCALL Y10M
JNB DV8870, DTMF_WT1
MOV A, P0 ;P0低四位接解码器
ANL A, #0FH ;屏蔽高位
SWAP A
CJNE A, #0A0H, TONE1
MOV A, #0
TONE1: MOV TONE, A
DTMF_WT2: JB DV8870, $
LCALL Y10M
LCALL Y10M
JB DV8870, DTMF_WT2
MOV WDT_CONTR, #00111111B ;清看门狗
DTMF_HH: ORL P0, #1FH
DTMF_WT3: JNB DV8870, $
LCALL Y10M
LCALL Y10M
JNB DV8870, DTMF_WT3
MOV A, P0
ANL A, #0FH
CJNE A, #0AH, TONE2
MOV A, #0
TONE2: ORL A, TONE
MOV TONE, A
DTMF_WT4: JB DV8870, $
LCALL Y10M
LCALL Y10M
JB DV8870, DTMF_WT4
RET |