我的程序:
osc:11.0596
b:9600
;----------------------------------------------
UART2_INI:
NOP
MOV S2CON,#40H ;只发送,不接收,接收为#050
MOV BRT,#0FDH
MOV AUXRB,#011H
MOV IE2,#01H ;允许2串口中断
SETB EA
NOP
RET
NOP
NOP
;----------------------------
;中断2入口-------------------------------------
RCINT2:
NOP
PUSH ACC
MOV A,S2CON
ANL A,#0FDH
MOV S2CON,A
NOP
NOP
POP ACC
NOP
RETI
NOP
NOP
;进程 -----------------------------------------------------------------
MOV A,S2CON
ANL A,#0FDH
MOV S2CON,A
NOP
MOV A,#0FFH
MOV S2BUF,A
NOP
TO_SEND_C1:
MOV A,S2CON
ANL A,#00000010B
CJNE A,#00000010B,TO_SEND_C1 ;<-------程序就死在这里!!!
NOP
MOV A,S2CON
ANL A,#0FDH
MOV S2CON,A
NOP
MOV A,#0C2H
MOV S2BUF,A
NOP
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
哪位仁兄过的,指正下! |