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.

请教 MSP430F5438A UART通信配置



需用到5438A 的UCA1的UART异步通信,波特率1200,8位数据、奇校验、1位停止位,选用SMCLK和时钟源(3.6864MHz),程序配置如下,

UCA1CTL1 |= UCSWRST;                      // **Put state machine in reset**
  UCA1CTL1 |=UCSSEL_2;                   //UART 时钟源SMCLK-3.6864MHz
 
  UCA1CTL0 |=UCPEN;     //奇\偶校验使能
  UCA1CTL0 &= ~(UCPAR);               //选择 奇校验
  UCA1CTL0 |=UCMSB;                   //高位在前
  UCA1CTL0 &= ~(UC7BIT);               //每字节-8位
  UCA1CTL0 &= ~(UCSPB);                //1位-停止位
  UCA1CTL0 &= 0xF8;                 //UART异步模式
 
  UCA1BR1 =0x0C;                     //晶振3.6864M,波特率1200
  UCA1BR0 =0x00;
  UCA0MCTL = UCBRS_0 + UCBRF_0 + UCOS16;   // Modln UCBRSx=0, UCBRFx=0,
  UCA1STAT =0x00;

  UCA1CTL1 &= ~UCSWRST;                     // **Initialize USCI state machine**
 
  UCA1IE |= UCTXIE + UCRXIE;                // Enable USCI_A0 TX/RX interrupt

 请看看代码存在哪些问题 或给一份详细的配置代码,试验的结果是 UCA1BR1 =0x0C; 时基本收不到数据, UCA1BR1 =0x03; 可以进入中断收取数据,但收到的数据和上位机送的不相同,请指教!大虾们有无QQ群请给一个,俺QQ号:757070425