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.

MSP430F5419 Clock for UART 38400

Hi,

I am trying to get a UART connection working with the F5419.  I am getting out the wrong characters.  If my code is right then I am running at 1MHz and have a UART baud rate of 38400.  Thanks for your help.  Any suggestions would be appreciated.

 

void main(void)
{
  WDTCTL = WDTPW+WDTHOLD;                   // Stop watchdog timer
  P3SEL |= BIT4 + BIT5;                       // P3.4,5 UART option select
  P3DIR &= ~(BIT5);                            // P3.5 is 0 for RX
  P3REN = ~(BIT4 + BIT5);


  UCA0CTL1 |= UCSWRST;                      // **Put state machine in reset**
  UCA0CTL1 |= UCSSEL_2;                     // CLK = SMCLK
  UCA0BR0 = 0x26;                           // 1MHz 38400
  UCA0BR1 = 0x00;                           //
  UCA0MCTL = 0x06;                          // Modulation
  UCA0CTL1 &= ~UCSWRST;                     // **Initialize USCI state machine**
  UCA0IE |= UCTXIE + UCRXIE;                // Enable USCI_A0 TX/RX interrupt


  __bis_SR_register(LPM3_bits + GIE);       // Enter LPM3 w/ interrupts enabled
  __no_operation();                         // For debugger
}//end of void main(void)

 

**Attention** This is a public forum