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.

USCI to implement UART

Other Parts Discussed in Thread: MSP430G2553, MSP-EXP430FR5739

Hello,

I'm looking for sample code/library to send and receive data between an msp430G2553 and PC with usb on launchpad.  If anyone could point me in the right direction I'd really appreciate it.

  • Roberto,

    as for MSP430 software you could look into the MSP430G2xx3 code example archive located at http://www.ti.com/lit/zip/slac485.  There are several examples of configuring the USCI module for UART mode that you could use.

    As for the PC side; the LaunchPad-integrated emulator provides a virtual COM port (VCP) that you can open on the PC and work with like any other COM port. Since there is a challenge to find the right COM port # without looking at the Windows device manager I've written a small utility that you can use to auto-identify the LaunchPad's COM port. If you download the MSP-EXP430FR5739 Experimenter's Board SW from http://www.ti.com/litv/zip/slac492 this code is located at /FRAM_GUI_Source/FindAppUART/FindAppUART.cpp.

    Also, in order you can establish the proper connections on the LaunchPad between the emulator and the MSP430F2553 you will need to swap the RX and TX signals.

    Regards,
    Andreas

  • Is there a feasible software way to switch RX and TX that would still enable me to utilize USCI?

  • Roberto Mancera said:
    Is there a feasible software way to switch RX and TX that would still enable me to utilize USCI?

    What do you mean with 'switch'?
    TX is outgoing data and RX is incoming data. If you want it the other way, just connect the external device to the opposite pins. Or have you twisted the two pins in layout accidentally? If so, no, teh 2x sereis doesn't support a port mapping mechanism.
    On some of the 5x/6x devices, you can select for some of the hardware which internal signal shall appear on which pin. Here you can swap RX and TX through the port mapping controller. However, RX still is incoming and TX still outgoing, so the external hardware needs to match this.

    If you have abus where the signal goes into two directions half-duplex on one line (e.g. RS485), then you can tie both pins together and software-activate one or the other depending on whether you want to send or receive. (RS485, hoever, works with differential signal line, so you'll need a driver anyway, and the driver will normally also split the two signals again.)

  • Thanks for the reply, I decided to implement UART using timerA.  You saved me a lot of time by noting that the pins were switched :)

**Attention** This is a public forum