11
MOV P2,#CRA
MOV A,#00000101B ; ENABLE TXER AND RXER
MOVX @R1,A
MOV P2,#CRB
MOVX @R1,A ; SAME FOR B
RET
The following input and output routines are simpler, as you can see.
;
; Serial port A input
;
SERINA:
MOV P2,#SRA
SERINA1: MOVX A,@R1
JNB ACC.0,SERINA1 ; LOOP TILL RXrdy
MOV P2,#RHRA ; READ DATA PORT
MOVX A,@R1
RET
;
; Serial port B input
;
SERINB:
MOV P2,#SRB
SERINB1: MOVX A,@R1
JNB ACC.0,SERINB1 ; LOOP TILL RXrdy
MOV P2,#RHRB ; READ DATA PORT
MOVX A,@R1
RET
;
;Serial port A output
;
SEROUTA:
MOV P2,#SRA
PUSH ACC ; SAVE CHAR
SOUTA1: MOVX A,@R1
JNB ACC.2,SOUTA1 ; LOOP TILL TXrdy
POP ACC
MOV P2,#THRA ; SEND IT OUT
MOVX @R1,A
RET
;
;Serial port B output
;
SEROUTB:
MOV P2,#SRB
PUSH ACC ; SAVE CHAR
SOUTB1: MOVX A,@R1
JNB ACC.2,SOUTB1 ; LOOP TILL TXrdy
POP ACC
MOV P2,#THRB ; SEND IT OUT
MOVX @R1,A
RET
For more details, see the SC26C92 data sheets.
Содержание MicroPac 535
Страница 22: ...APPENDIX D MicroPac 535 Schematics...
Страница 23: ......
Страница 24: ......
Страница 25: ......
Страница 26: ......