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.

CCS/MSP430F249: uart0 + uart1

Part Number: MSP430F249


Tool/software: Code Composer Studio

Hii,

I'm working on the uart for the f249 board, I need to receive in UCA0 pin 3.5 and transmit in UCA1 pin 3.6, how can i do that ? I'm trying to change the settings but each one of them has its own settings and it didn't work to but'em together

any advice ??

I took the settings from the TI uart examples, my board isn't working on UCA0, don't know what it's problem !

TI examples :

dev.ti.com/.../

thank you 

  • Part Number: MSP430F249

    Tool/software: Code Composer Studio

    Hello,

    I tried this uart uca0 code from the Ti examples and it won't work I don't know why!! the uca1 worked, but I need to work on uca0

    the code I tried:

    #include <msp430.h>

    int main(void)
    {
    WDTCTL = WDTPW + WDTHOLD; // Stop WDT
    P1DIR = 0xFF; // All P1.x outputs
    P1OUT = 0; // All P1.x reset
    P2DIR = 0xFF; // All P2.x outputs
    P2OUT = 0; // All P2.x reset
    P3SEL = 0x30; // P3.4,5 = USCI_A0 TXD/RXD
    P3DIR = 0xFF; // All P3.x outputs
    P3OUT = 0; // All P3.x reset
    P4DIR = 0xFF; // All P4.x outputs
    P4OUT = 0; // All P4.x reset
    P5DIR = 0xFF; // All P5.x outputs
    P5OUT = 0; // All P5.x reset
    P6DIR = 0xFF; // All P6.x outputs
    P6OUT = 0; // All P6.x reset

    UCA0CTL1 |= UCSSEL_1; // CLK = ACLK
    UCA0BR0 = 0x03; // 32kHz/9600 = 3.41
    UCA0BR1 = 0x00; //
    UCA0MCTL = UCBRS1 + UCBRS0; // Modulation UCBRSx = 3
    UCA0CTL1 &= ~UCSWRST; // **Initialize USCI state machine**
    IE2 |= UCA0RXIE; // Enable USCI_A0 RX interrupt

    __bis_SR_register(LPM3_bits + GIE); // Enter LPM3, interrupts enabled
    }

    // Echo back RXed character, confirm TX buffer is ready first
    #if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__)
    #pragma vector=USCIAB0RX_VECTOR
    __interrupt void USCI0RX_ISR(void)
    #elif defined(__GNUC__)
    void __attribute__ ((interrupt(USCIAB0RX_VECTOR))) USCI0RX_ISR (void)
    #else
    #error Compiler not supported!
    #endif
    {
    while (!(IFG2&UCA0TXIFG)); // USCI_A0 TX buffer ready?
    UCA0TXBUF = UCA0RXBUF; // TX -> RXed character
    }

    thanks alot

  • Hi Rena, 

    Rena A said:
    I need to receive in UCA0 pin 3.5 and transmit in UCA1 pin 3.6

    You're trying to use a different USCI module for transmit and receive? This is an uncommon use of the USCI modules. Typically, you would just use one module for both TX and RX. Can you not use P3.5 as RX and P3.4 as TX?

    I also recommend reading the UART and General sections of Solutions to Common eUSCI and USCI Serial Communication Issues on MSP430 MCUs.

    Best regards, 
    Caleb Overbay

  • Hi Caleb,

    the board wouldn't work on pins 3.4/5, also the main board I'll use is defined to be Tx on p3.6 and Tr on p3.5, 

    I saw that it's possible on other boards families, I just don't know if it's possible in the msp430f249 !

  • Hi Rena,

    Can you describe your setup in more detail. UART communication is possible on the MSP430F249 board. If you're designing the board, I strongly recommend against using pins 3.6 and 3.5. for UART communication. As I stated in my previous post, this requires using two separate UART modules instead of just one. I recommend using P2.4 and P3.5 as your UART pins.

    Can you describe the behavior you're seeing on the UART lines when attempting to use pins 3.4/3.5? What is connected to these lines? Have you tried loading the example linked below with no changes?
    dev.ti.com/.../

    Best regards,
    Caleb Overbay

**Attention** This is a public forum