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.

Using the back-channel UART on the MSP430FR6989

Other Parts Discussed in Thread: MSP430FR6989

Apparently, TI-BIOS is not yet available for the FR6989. In the mean time I would like to use DriverLib to write some code that uses the USB back-channel UART for sending/receiving text to and from a serial port on a PC? I can't seem to find any examples or guidance. The user guide for the LaunchPad mentions that it can be used for that purpose but it doesn't give any direction. Is there any example code, or app notes to help me get started?


Thanks for any help.

  • The MSP430FR6989 has two UARTs, USCI_A0 and USCI_A1. The first one is connected to the BoosterPack connector, the second one to the backchannel of the emulator.

    The examples typically use USCI_A0. Just change them to use USCI_A1 (and the corresponding pins) instead.

  • There's another similar E2E forum post that you may want to reference: 

    Communication with LaunchPad through Terminal (Non-CCS and Non-Energia)

    Scott

  • Hi,

    I have change USCI_A0 to USCI_A1 for uart loopback test. But Still I am not getting output on terminal.

    Below is my code that i am using.

    WDTCTL = WDTPW | WDTHOLD; // Stop Watchdog

    // Configure GPIO
    P2SEL0 |= BIT0 | BIT1; // USCI_A1 UART operation
    P2SEL1 &= ~(BIT0 | BIT1);
    PJSEL0 |= BIT4 | BIT5; // For XT1

    // Disable the GPIO power-on default high-impedance mode to activate
    PM5CTL0 &= ~LOCKLPM5;

    // XT1 Setup
    CSCTL0_H = CSKEY >> 8; // Unlock CS registers
    CSCTL2 = SELA__LFXTCLK | SELS__DCOCLK | SELM__DCOCLK;
    CSCTL3 = DIVA__1 | DIVS__1 | DIVM__1; // Set all dividers
    CSCTL4 &= ~LFXTOFF;
    do
    {
    CSCTL5 &= ~LFXTOFFG; // Clear XT1 fault flag
    SFRIFG1 &= ~OFIFG;
    }while (SFRIFG1&OFIFG); // Test oscillator fault flag
    CSCTL0_H = 0; // Lock CS registers

    // Configure USCI_A1 for UART mode
    UCA1CTLW0 = UCSWRST; // Put eUSCI in reset
    UCA1CTLW0 |= UCSSEL__ACLK; // CLK = ACLK
    UCA1BR0 = 3; // 9600 baud
    UCA1MCTLW |= 0x5300; // 32768/9600 - INT(32768/9600)=0.41
    // UCBRSx value = 0x53 (See UG)
    UCA1BR1 = 0;
    UCA1CTL1 &= ~UCSWRST; // Initialize eUSCI
    UCA1IE |= UCRXIE; // Enable USCI_A0 RX interrupt

    __bis_SR_register(LPM3_bits | GIE); // Enter LPM3, interrupts enabled
    __no_operation();


    Thanks,
    Hinesh
  • To insert code, use the "Insert Code" button.

    P2SEL0 |= BIT0 | BIT1; // USCI_A1 UART operation
    P2SEL1 &= ~(BIT0 | BIT1);
    

    It is not enough to change only the comment. USCI_A0 and USCI_A1 use different pins. (See the datasheet.)

  • Hi Clemens,

    Thanks for pointing out. It's my mistake.

    I have changed my configuration (I am using MSP430FR6989 EVM Board Also checked in data sheet that they are wired with port 3.4 and 3.5 for Tx and Rx respectively).

    And selected to port 4 (Pins 3 for Rx and 2 for Tx)
    But the problem remains same.

    I am trying loopback from my MSP430 EVM to my pc (using usb-to-serial).


    Thanks,
    Hinesh

  • Oops! On the FR6989 LaunchPad, the backchannel UART is actually connected to USCI_A0 (and P2.0/P2.1).
  • Hi ,

    I am trying with UART communication with my MSP430FR6989 EVM module with pc (Usign serial converter).

    Now I am able to send the desired data over UART to my PC and I am able to verify that data over PC terminal.

    Now I am trying transmitting data from terminal to MSP430 and after data is received the controller should send other desired data.

    Here I am stuck with the receiving part. (I have checked the connection , they are fine). data is sent to Controller is not received by controller.

    My code is
    while (1)
    {
    while(!(UCA0IFG & UCTXIFG));
    UCA0TXBUF = TXData; // Load data onto buffer

    __bis_SR_register(LPM0_bits | GIE); // Enter LPM0, interrupts enabled
    }

    RXData = UCA0RXBUF; // Read buffer
    if(RXData != TXData) // Check value
    {
    // checking code..
    }
    TXData++; // increment data byte

    If further more clarification needed please tell me.


    Thanks,
    Hinesh
  • To insert code, use the "Insert Code" button.

    The "while (1)" loop never exits, so the "RXData = UCA0RXBUF;" line is never executed.

  • Hi Clemens,

    I have removed while(1) condition , Still not able to get the result.

    Thanks,
    Hinesh
  • Can you use the UART and  SPI on eUSCI at the same time if you use different pins for each interface?

  • Hi Ronald,

    I Think , It may not work, As Till I have seen that, When I configure a Register For SPI It's not available for the UART.
    How ever You can Always use Different register for that.

    Can you Elaborate bit more How you wanted to Use or your Requirement.?

    Thanks,
    Hinesh
  • Thanks Hinesh,


    My project uses a 6989 as the main processor and a secondary processor that it needs to communicate with.  The 6989 will be communicating with a PC, and a chip that uses an AT command set (2 standard serial ports using both of the available UARTS). I was hoping to be able to use SPI to talk to the other processor but it looks like you can't use both  the UART and the SPI at the same time on either of the the eUSCIs. Is that the case? If so are there any other options on the 6989 for communicating with another processor?


    Thanks,

    Ron

  • Yes Ron, As per my findings , We can not use same eUSCI Module for both SPI as well as UART at same time.

    You can Use USCI_A0 for SPI to talk with one processor and for other USCI_A1 for UART to talk with another processor(I am using this UART for my Project to talk with another processor.).

    BR,
    Hinesh
  • Thanks for your response Hinesh,


    If I understand you correctly, I should be able to use EUSCI_A for both UARTs (channel 0 and channel 1). And use EUSCI_B for the SPI.

    Is this correct?

    Thanks,

    Ron

     

  • Hi Ronald,

    Yes As per data Sheet, You can do that as EUSCI_A0 and EUSCI_A1 both have their different control register set.

    As it supports 2 UART with as well as Either 2 I2C or SPI or one of each.

    Thanks,

    Hinesh

**Attention** This is a public forum