-
LIN的自动波特率问题
大神们好!按照PIC16F18系列自动波特率的时序,在LIN_RX_IDLE里面,ABD使能,在LIN_RX_SYNC里面,读一次RC1REG将RCIF置0,波特率自动填充SP1BRG里面。现在在LIN_RX_SYNC里面,SPIBRG的值读出是对的,但是程序跳到LIN_RX_PID里面,读出PID报错,数据为0。请大神们指点,谢谢!caseLIN_RX_IDLE:if(EUSART1_is_rx_ready()>0){//StartTimerLIN_startTimer(READ_TIMEOUT);LIN_rxInProgress=true;LIN_rxState=LIN_RX_BREAK;BAUD1CONbits.ABDEN=1;//setautobauddetection}break;caseLIN_RX_BREAK:if(EUSART1_is_rx_ready()>0){if(LIN_breakCheck()==true){//ReadBreakLIN_rxState=LIN_RX_SYNC;}else{LIN_rxState=LIN_RX_ERROR;}}break;caseLIN_RX_SYNC:if(EUSART1_is_rx_ready()>0){while(BAUDCONbits.ABDEN==1){if(BAUDCONbits.ABDOVF==1){BAUDCONbits.ABDEN=0;//abortautobaudBAUDCONbits.ABDOVF=0;//startautobaudBAUDCONbits.ABDEN=1;//restartautobaud}}index=EUSART1_Read();RC1REG_DATA=RC1REG;if((SP1BRGL+(SP1BRGH
2022-03-21 0