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.

MSP430f5529 UART over USB to realterm on PC

Other Parts Discussed in Thread: MSP430F5529

Hello,

Ive been trying to run the sample codes provided by ti, which echoes the Recieved bytes, using the UART device on my msp430f5529LP rev1.5. However when ever I run the code on the device my usb virtual com (MSP APPLICATION UART1 ) does not show echoed bytes through realterm. after runing the debugger i can see that the TXBUF register is loaded with the data that i want to send however nothing shows up on realterm. 

Im pretty sure the code works, but can figure out why i cant get the echoes. Im thinking maybe im not using the right pins; and ive tried both P4SEL = BIT5+BIT4; and P3SEL = BIT3+BIT4;combinations to no avail. is there a head pin that i have to disable?

the code


#include <msp430.h>

int main(void)
{
WDTCTL = WDTPW + WDTHOLD; // Stop WDT
P3SEL = BIT3+BIT4; // P3.4,5 = USCI_A0 TXD/RXD
UCA0CTL1 |= UCSWRST; // **Put state machine in reset**
UCA0CTL1 |= UCSSEL_2; // SMCLK
UCA0BR0 = 6; // 1MHz 9600 (see User's Guide)
UCA0BR1 = 0; // 1MHz 9600
UCA0MCTL = UCBRS_0 + UCBRF_13 + UCOS16; // Modln UCBRSx=0, UCBRFx=0,
// over sampling
UCA0CTL1 &= ~UCSWRST; // **Initialize USCI state machine**
UCA0IE |= UCRXIE; // Enable USCI_A0 RX interrupt

__bis_SR_register(LPM0_bits + GIE); // Enter LPM0, interrupts enabled
__no_operation(); // For debugger
}

// Echo back RXed character, confirm TX buffer is ready first
#if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__)
#pragma vector=USCI_A0_VECTOR
__interrupt void USCI_A0_ISR(void)
#elif defined(__GNUC__)
void __attribute__ ((interrupt(USCI_A0_VECTOR))) USCI_A0_ISR (void)
#else
#error Compiler not supported!
#endif
{
switch(__even_in_range(UCA0IV,4))
{
case 0:break; // Vector 0 - no interrupt
case 2: // Vector 2 - RXIFG
while (!(UCA0IFG&UCTXIFG)); // USCI_A0 TX buffer ready?
UCA0TXBUF = UCA0RXBUF; // TX -> RXed character
break;
case 4:break; // Vector 4 - TXIFG
default: break;
}
}

  • On the MSP-EXP430F5229LP board, the first UART (UCA0, P3.3, P3.4) is connected to the LaunchPad header, and the second one (UCA1, P4.4, P4.5) is connected to the ezFET.

    To use the ezFET's virtual COM port, you must use UCA1.
    (Or remove the RXD/TXD jumpers, and use jumper wires to connect P3.3/4 to them.)

  • thank you so much for clarifying that, i must have missed that like 5 times i read over the guide.
  • Hello Gideon,

    I just came across your post. Did you manage to get the echo back via an external terminal (I am using HyperTerminal) after making the required changes?


    Because I tried out the solution provided which was changing the UCA0xxxx to UCA1xxxx as well as the P3SEL |= BIT3+BIT4 to P4SEL |= BIT4+BIT5 in the same program, yet I still didn't get the echo when I try to send something. I get returned with such boxes:

    Is there something else I might be missing? If I were to guess, the code is missing a part that initiates the USB side of communication, since the program that was provided only addressed the UART Communication...

    Thanks and i hope you see this!

  • Zhek W. said:
    If I were to guess, the code is missing a part that initiates the USB side of communication, since the program that was provided only addressed the UART Communication...

    No. OP was trying to use the PC virtual com port (provided by the ezFET) with a USCI uart on the 5529 target device. He was not trying to use the 5529 in USB mode as a UART.

    For that you need the examples in the MSP430 USB Developers Kit.

  • Hey Brian!

    Thank you for your answer.

    I've since tried out the Echo Back to Host Example under CDC Virtual COM Port. And it works!

    If I may, I'd like to follow up with a question, which is : To include a UART Interface to the project, can I just add the UART RXBUF & TXBUF Configuration to the main along with the Pin Configuration in the main?

    Details:
    I'd like to send something from MSP430f5529_1(Send & Receive Program) to MSP430f5529_2(Echo Program) via RS485 (full duplex) with UART, hence when MSP1 receives the data back, it should be displayed on HyperTerminal.

    Ps. If I need to create a new post for this, please let me know. Thanks!

**Attention** This is a public forum