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.

USCIA1 UART issue on MSP430F2419

Other Parts Discussed in Thread: MSP430F2419, TUSB3410

Hi,

Does anyone know if there is a difference between USCI0 and USCI1 on MSP430F2419 UART mode? 

My problem is that I have a code for treating received characters via a TUSB3410 converter and it works when I connect the converter to USCI0 but not on USCI1.

 

The working code is (from MSP430 examples):

 

  P3SEL = 0x30;                             // P3.4,5 = USCI_A0 TXD/RXD

  UCA0CTL1 |= UCSSEL_2;                     // SMCLK

  UCA0BR0 = 8;                              // 1MHz 115200

  UCA0BR1 = 0;                              // 1MHz 115200

  UCA0MCTL = UCBRS2 + UCBRS0;               // Modulation UCBRSx = 5

  UCA0CTL1 &= ~UCSWRST;                     // **Initialize USCI state machine**

   IE2 |= UCA0RXIE;                          // Enable USCI_A0 RX interrupt

__bis_SR_register(GIE);                   // interrupts enabled

 

 

It has the following interrupt routine:

 

#pragma vector=USCIAB0RX_VECTOR

__interrupt void USCI0RX_ISR(void)

{

  receiveflag = 1;

  receiveBuffer = UCA0RXBUF;

}

I tried to adapt it to use USCI1 but it does not work. The only difference I found in the datasheet was the name of the registers that control the interrupt enabling:

  P3SEL = 0xC0;                             // P3.6,7 = USCI_A1 TXD/RXD

  UCA1CTL1 |= UCSSEL_2;                     // SMCLK

  UCA1BR0 = 8;                              // 1MHz 115200

  UCA1BR1 = 0;                              // 1MHz 115200

  UCA1MCTL = UCBRS2 + UCBRS0;               // Modulation UCBRSx = 5

  UCA1CTL1 &= ~UCSWRST;                     // **Initialize USCI state machine**

  UC1IE |= UCA1RXIE;  

__bis_SR_register(GIE);                   // interrupts enabled

 

#pragma vector=USCIAB1RX_VECTOR

__interrupt void USCI1RX_ISR(void)

{

  receiveflag = 1;

  receiveBuffer = UCA1RXBUF;

}

Thanks in advance

 

  • There is no difference in how USCI0 or USCI1 UART works. I recommend the following:
    1. Use the code example "msp430x261x_uscia1_uart_02.c" in the following zip file:
    http://www.ti.com/lit/zip/slac151

    Tie the TX to RX in the above example and see if it works as a starting point. The above example also requires a 32k crystal.

  • I don't have 32 kHz crystals, I'm just using the internal DCO. That's why I tried an equivalent code as the one supplied by TI for USCI0.

    The only other difference I found in the code is the fact it enters LPM3 mode after configuring the USCI. But I just want my platform to answer some commands issued via USB, I don't think it changes anything. Are you sure it is not necessary to set any other bit?

**Attention** This is a public forum