This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSP430FR6043: MSP430FR6043C串口接收中断总是触发错误UCRXERR

Part Number: MSP430FR6043
Other Parts Discussed in Thread: MSP430FR6041, , MSP430FR5043, MSP430FR5041, EVM430-FR6043

MSP430FR6043C串口接收有时中断,我连续发送十次,也许只会正确接收一次。使用的外部晶振8M的,发送的数据是完全没有问题的。请问是哪儿没有配置上吗?

//UART1
// GPIO Configuration for UART mode
P1SEL0 |= (BIT2 | BIT3);
P1SEL1 &= ~(BIT2 | BIT3);

// Configure USCI_A1 for UART mode, 8-bit data, 1 stop bit
UCA1CTLW0 = UCSWRST; // Put eUSCI in reset
UCA1CTLW0 |= UCSSEL__SMCLK + UCRXEIE; // CLK = SMCLK

// For BRCLK = SMCLK = 8MHz, and Baud rate = 115200 (See UG)
UCA1BRW = 4;
// UCBRSx (bits 7-4) = 0x55, UCBRFx (bits 3-1) = 5, UCOS16 (bit 0) = 1
UCA1MCTLW = 0x5551;

UCA1CTLW0 &= ~UCSWRST; // release from reset

UCA1IE |= UCRXIE; //enable Receive interrupt

接收中断中

__interrupt void hal_uart_ISR(void)
{
  switch(__even_in_range(UCA1IV,18))
  {
    case USCI_NONE:
      break;
    case USCI_UART_UCRXIFG:

      if((UCA1STATW&UCRXERR)==UCRXERR)
      {//出现错误且该错误非溢出引起

           。。。。。
      }
     else
     {//串口未出错

     }
      break;
    case USCI_UART_UCTXIFG:
      break;
    case USCI_UART_UCSTTIFG:
      break;
    case USCI_UART_UCTXCPTIFG:
    break;
  }
}