2个51MCU的串口通信,有时会在这走不出来(软件设置完好的)
走不出来时停在 JNB RI,$
SERIAL:
PUSH A
PUSH PSW
;..........................
JNB RI,$
CLR RI
MOV A,SBUF
MOV MEM_MIMA,A
;..............................
JNB RI,$
CLR RI
MOV A,SBUF
MOV MEM_SW,A
;..............................
JNB RI,$
CLR RI
MOV A,SBUF
MOV MEM_WD,A
;...............................
MOV A,MEM_MIMA
CJNE A,#SYNC_CODE,RET_SER
SETB PSW_RXD
RET_SER:
;.........................................
POP PSW
POP A
RETI |