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.

MSP430F5418 UART接收问题

Other Parts Discussed in Thread: MSP430F5418

平台: MSP430F5418, UART0 和电脑的usb转串口相连,串口设置: 波特率38400, 数据位8, 停止位1, 无校验位,无流控制
使用UART0发现 TX内容都能被电脑成功接收到, 但电脑发送的数据5418接收到为错误数据.

没有使用外部晶振, 使用的是DCO, 将P1.6做为SMCLK测量得到频率为15.4750Mhz

UART初始化代码如下:

void vUART1Init(void)     
{
    PC_USART1_SEL;    
    UCA1CTL1 |= UCSWRST;
    UCA1CTL1 = UCSSEL_2;  
    UCA1BR0 = 121;  
    UCA1BR1 = 1;
    UCA1MCTL = UCBRF_0 + UCBRS_5;
    UCA1CTL1 &= ~UCSWRST;
    UCA1IE |= UCRXIE;  
}

中断代码:
#pragma vector=USCI_A1_VECTOR
__interrupt void USCI_A1_ISR(void)

  switch(__even_in_range(UCA1IV,4))
  {
  case 0:break;                             // Vector 0 - no interrupt
  case 2:                                   // Vector 2 - RXIFG
    vUART1ReceiveData(UCA1RXBUF);//接收处理数据,接收一字节
    break;
  case 4:break;                             // Vector 4 - TXIFG
  default: break;
  }
}

问题: 发送没问题, 接收的字符全是错误的,求问是什么原因造成.