Software UART example for MSP430 using mps430-gcc on Linux
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Software UART example for MSP430 using mps430-gcc on Linux

The original code is taken form Nicholas J. Conn example:

Origial Description from Nicholas:

Half Duplex Software UART on the LaunchPad

Description: This code provides a simple Bi-Directional Half Duplex Software UART. The timing is dependant on SMCLK, which is set to 1MHz. The transmit function is based off of the example code provided by TI with the LaunchPad.  This code was originally created for "NJC's MSP430 LaunchPad Blog".

Includes also improvements from Joby Taffey and fixes from Colin Funnell as posted here:


This example shows how to use software UART on the TI Launchpad with a MSP430G2231 MCU (which does NOT have a hardware UART). With the code from Nicholas J. Conn, Joby Taffey and Colin Funnell I was able to create a half-way-decent software UART. Thanks Nicholas, Joby and Colin! So basically my job only was puzzeling things togehter and wrap them in a msp460-gcc project.

I am not going into detail about how it works, since Nicholas already did a great job doing that :-):


Note: This project is written for msp430-gcc on Linux (I used v4.5.3 which is available as package on ubuntu). For flashing the "mspdebug" tool was used (also from the Ubuntu package).

To compile the source just issue a:


This builds the firmware in the "bin" subdirectory in various formats.

Doxygen Docs

If you installed doxygen on your system, you could generate the HTML-based documentation by calling:

make gen-docs

This will create the documentation under "doc/gen/html".


To flash the firmware to your Launchpad you could use the "flash-target" make target:

make flash-target


Connecting your Launchpad should give you a new serial device "/dev/ttyACM0". Connect to this port at 9600 bauds - e.g. by using screen:

screen /dev/ttyACM0 9600

Every character you type will be echoed then, surrounded by square brackets.