ORG 0000H
AJMP MAIN
:
:
;********************
;* 8880 初始化 *
;********************
MAIN: MOV A, #90H
MOV P0, A ; 写 8880CRA
MOV P0, A ; 写 8880CRA
MOV A, #98H
MOV P0, A ; 写 8880CRA
MOV A, #90H
MOV P0, A ; 写 8880CRB
MOV A, #94H
MOV P0, A ; 写 8880CRA,8880 形式 1 为 DTMF ,IRQ
:
:
;****************
;* 接纳程序 *
;****************
MOV R1, #0
MOV R0, #10H
LOOP1: MOV A, #0FFH
MOV P0, A
SETB P0.7
SETB P0.4
CLR P0.5
SETB P0.6
MOV A, P0 ; 读 8880 状况寄存器
JNB ACC.2, LOOP1
CLR P0.4
MOV A, P0 ; 读 8880 接纳数据寄存器
ANL A, #0FH ; 屏蔽高四位
MOV @R0, A
INC R0
INC R1
CJNE R1, #07H, LOOP1
:
:
;****************
;* 发码程序 *
;****************
MOV R0, #10H
MOV R1, #7
MOV A, #9DH ; 写 8880CRA
MOV P0, A
MOV A, #90H
MOV P0, A ; 写 8880CRB,8880 形式 2 为 TONE, DTMF ,IRQ,BURST
LOOP2: MOV A, @R0
ORL A, #0F0H
ANL A, #8FH
MOV P0, A ; 发送数据
MOV A, #0FFH
MOV P0, A
SETB P0.7
SETB P0.4
CLR P0.5
SETB P0.6