This UART serial communication with MSP430 microcontroller tutorial shows you how to use the built-in UART hardware of the MSP430G2553 on the MSP430G2 LaunchPad to send and receive data over a serial link using the Energia IDE. Serial communication is how your microcontroller talks to a PC for debugging, how it drives a Bluetooth, GPS, or GSM module, and how it exchanges data with other microcontrollers — it is easily one of the most important peripherals you will ever use on the MSP430.
The MSP430G2553 has one hardware UART module (part of its USCI peripheral), and Energia exposes it through the familiar Serial library — the exact same API Arduino uses. In this guide we cover the UART basics, the MSP430G2 LaunchPad’s UART pin mapping, the Energia Serial functions you need, a complete transmit example that sends data to the PC serial monitor, and a complete receive example that turns an LED on or off based on a character you type. We finish with a troubleshooting section for the problems that trip up most beginners.

If you are new to the MSP430G2 LaunchPad, start with our earlier tutorials in this series before tackling UART:
- MSP430G2 LaunchPad Getting Started Tutorial with Energia IDE
- MSP430G2 LaunchPad GPIO Tutorial – Input/Output Pins
- RGB LED Interfacing with MSP430G2 LaunchPad
- PIR Motion Sensor Interfacing with MSP430G2 LaunchPad
- 16×2 LCD Interfacing with MSP430 LaunchPad
What You Will Learn
- What UART is and how asynchronous serial communication differs from synchronous serial (SPI, I2C)
- The exact pins on the MSP430G2 LaunchPad that carry UART Tx and Rx signals
- The anatomy of a UART data frame: start bit, data bits, parity bit, and stop bit
- How baud rate synchronizes the transmitter and receiver without a shared clock line
- The Energia Serial library functions:
Serial.begin(),Serial.available(),Serial.read(),Serial.print(),Serial.println(), andSerial.write() - A working example that transmits data from the MSP430 to the Energia Serial Monitor
- A working example that receives a character from the PC and uses it to control an LED
- How to use UART to interface with Bluetooth, GPS, GSM, and other serial modules
- Common UART troubleshooting — garbled characters, wrong COM port, baud mismatch, wiring
Prerequisites and Required Components
- MSP430G2 LaunchPad (MSP430G2553)
- USB cable for programming and serial communication (the onboard ST-Link-like bridge doubles as a USB-to-UART converter)
- Energia IDE installed and configured
- 1 × LED and 1 × 220 Ω resistor (for the receive example)
- Breadboard and jumper wires
What is UART Communication?
UART stands for Universal Asynchronous Receiver-Transmitter. As the name suggests, it is a hardware module — not a protocol — that can both send and receive serial data one bit at a time. A UART sits inside your microcontroller; the MSP430G2553 has exactly one. It is a dedicated circuit whose job is to shift bytes in and out over a pair of wires at a programmable rate, without needing a shared clock signal.
UART, SPI, and I2C are all serial communication methods, but they differ in important ways:
- UART is asynchronous — no shared clock line. Uses 2 wires (Tx and Rx) plus a common ground. Point-to-point only.
- SPI is synchronous — a shared clock line (SCK) keeps both sides aligned. Uses 4+ wires. Point-to-multipoint via chip-select lines.
- I2C is synchronous — uses only 2 wires (SDA and SCL) but supports many devices on the same bus by addressing them individually.
Parallel buses can move multiple bits simultaneously (8, 16, even 32 bits at a time) for higher throughput, but they need one wire per bit plus control lines — expensive in pin count. Serial sacrifices speed for simplicity and low pin count, which is why UART is everywhere: two wires and a ground is all you need.
Synchronous vs Asynchronous Serial Communication
- Asynchronous (UART): no shared clock signal is transmitted. The two devices pre-agree on a bit rate (baud rate), and each bit is framed with a start bit and stop bit so the receiver can lock onto the beginning of each byte.
- Synchronous (SPI, I2C, USART in clocked mode): one wire carries an explicit clock signal that the receiver samples on. The transmitter dictates exactly when each bit is valid — simpler electrically, but needs an extra wire.
The MSP430G2553 UART is asynchronous-only in standard mode. Its sibling USART peripheral supports synchronous mode too, but we do not use that here.
UART Pins on the MSP430G2 LaunchPad
On the MSP430G2 LaunchPad, the UART pins are brought out to two of the standard header positions:
- Header pin 3 → P1.1 → UART Rx (MSP430 receives data on this pin)
- Header pin 4 → P1.2 → UART Tx (MSP430 transmits data on this pin)
These two pins route through the LaunchPad’s onboard programmer, which also functions as a USB-to-UART bridge. This means you do not need an external FTDI / CP2102 cable — when you plug the LaunchPad into your PC, the same USB connection that programs the chip also appears as a virtual COM port for Serial communication. Open the Energia Serial Monitor and you are talking to the MSP430 directly.
Important: on Rev 1.5 and later LaunchPads, the J3 jumper block has two TXD/RXD jumpers that must be in the hardware UART orientation (rotated 90° compared to software UART mode) for the MSP430G2553’s hardware UART to reach the onboard USB bridge. If the Serial Monitor shows nothing, check these jumpers first.
How UART Communication Works

The wiring between two UART devices is simple but counter-intuitive. The Tx (transmit) pin of one device connects to the Rx (receive) pin of the other, and vice versa — the signals cross over. The grounds of both devices must also be tied together so they share a common voltage reference.

- Device A Tx → Device B Rx
- Device A Rx → Device B Tx
- Device A GND ↔ Device B GND
Without a shared clock, how do the two UARTs stay in sync? Through baud rate and start/stop bits. Both sides are configured for the same baud rate (bits per second) before communication starts. When the transmitter has a byte to send, it pulls the Tx line from its idle HIGH state down to LOW for one bit time — this is the start bit. The receiver sees the falling edge, waits exactly one and a half bit times, then samples in the middle of each subsequent bit at intervals of one bit time. After 8 (or sometimes 7) data bits, an optional parity bit, and a stop bit (line returns HIGH), the transmitter is ready for the next byte.

Baud Rate Explained
Baud rate is the number of symbols (bits, for UART) transmitted per second. Standard values are 1200, 2400, 4800, 9600, 19200, 38400, 57600, and 115200. 9600 is the Arduino/Energia default and works reliably on the MSP430G2553. Both sides of a UART link must be configured for the same baud rate — if you set the MSP430 to 9600 and the PC Serial Monitor to 115200, every byte will appear as garbage on the terminal.
Higher baud rates transfer data faster but are more sensitive to clock drift. For the MSP430G2553 running off its internal 16 MHz DCO, 9600 and 115200 both work reliably without an external crystal.
How to Use UART Communication on the MSP430 with Energia
You do not have to implement the UART frame format yourself — Energia’s built-in Serial library does it for you. You just call a handful of functions and the library handles the start bits, data bits, stop bits, baud rate generation, and buffering.
The MSP430G2553’s hardware UART is accessible through Energia via the standard Serial.* API:
Serial.begin(baud_rate)— initialize the UART at the given baud rateSerial.available()— check whether any bytes have arrived in the receive bufferSerial.read()— read one byte from the receive bufferSerial.print(value)— send a string, number, or character out on Tx (no newline)Serial.println(value)— likeprint(), but appends a carriage return + line feed (rn)Serial.write(value),Serial.write(string),Serial.write(buf, len)— send raw bytes without ASCII formatting
As a reminder from the pin map: the MSP430G2553’s hardware UART is on header pin 3 (P1.1 = Rx) and header pin 4 (P1.2 = Tx). Because these pins are wired through the LaunchPad’s onboard USB bridge, Energia’s Serial Monitor (or any PC terminal) talks directly to them — no extra hardware needed.
Serial Library Function Reference
1. Serial.begin(baud_rate) — initializes the UART peripheral for the desired speed. Call it once inside setup(). Example: Serial.begin(9600); configures UART for 9600 baud, 8 data bits, no parity, 1 stop bit (8N1) — the standard default. Other common rates: 19200, 38400, 57600, 115200.
2. Serial.available() — returns the number of bytes currently waiting in the UART receive buffer. It is a non-blocking check: if the buffer is empty it returns 0 (which evaluates as false), and if there is at least one byte it returns a non-zero value (true). Wrap Serial.read() calls inside if (Serial.available()) { … } to avoid reading when no data is present.
3. Serial.read() — reads one byte from the receive buffer and returns it. If nothing is available, it returns -1. Typically stored in a char or int variable for processing. Example:

The pattern above is the canonical way to receive data on the MSP430 — check Serial.available() first, read only when there’s something to read, and store the byte in a char variable.
4. Serial.print(value) — sends data from the MSP430’s Tx pin to the connected device. Accepts characters, strings, integers, and floats. No newline is appended. Use Serial.println() instead when you want each value on its own line in the Serial Monitor.
MSP430 UART Transmit Example — Sending Data to the PC
The first example sends text from the MSP430G2 LaunchPad to the Energia Serial Monitor. This is the printf() equivalent on embedded platforms — the bread-and-butter of debugging any microcontroller project.
int counter = 0;
void setup() {
Serial.begin(9600); // initialize UART at 9600 baud
Serial.println("MSP430G2 UART ready");
}
void loop() {
Serial.print("Counter value: ");
Serial.println(counter); // sends counter + newline
counter++;
delay(1000); // send one message per second
}Upload the sketch, then open the Serial Monitor in Energia (magnifying-glass icon, top-right). Set the baud rate dropdown at the bottom of the Serial Monitor to 9600 to match Serial.begin(9600). You should see:
MSP430G2 UART ready Counter value: 0 Counter value: 1 Counter value: 2 ...
If the Serial Monitor shows garbled characters instead of readable text, the baud rate does not match — select 9600 in the Serial Monitor dropdown. If it shows nothing at all, the wrong COM port is selected (Tools → Serial Port) or the J3 jumpers are in software-UART position.
MSP430 UART Receive Example — Control an LED from the PC
The second example receives data from the PC and uses it to control an LED. Type A in the Serial Monitor and the LED turns on; type anything else and it turns off. This is the simplest possible “remote control” over UART — and the same exact pattern scales to Bluetooth, GSM, or any other UART-based module.
Wire an LED in series with a 220 Ω current-limiting resistor between header pin 2 (P1.0) of the LaunchPad and GND. (The red onboard LED on P1.0 also works if you prefer no external wiring.) Then upload this sketch:
int led = 2; // header pin 2 (P1.0)
char data;
void setup() {
pinMode(led, OUTPUT);
Serial.begin(9600);
}
void loop() {
if (Serial.available()) {
data = Serial.read();
}
if (data == 'A') {
digitalWrite(led, HIGH);
Serial.println("LED is ON");
} else {
digitalWrite(led, LOW);
Serial.println("LED is OFF");
}
}How the Receive Code Works
int led = 2;declares header pin 2 as the LED pin.- Inside
setup(),pinMode(led, OUTPUT)configures the pin as a digital output andSerial.begin(9600)initializes UART at 9600 baud. - Inside
loop(),Serial.available()checks whether any byte has arrived on Rx. If yes,Serial.read()pulls the byte out of the buffer and stores it in thedatavariable. - An
if (data == 'A')comparison decides what to do: if the received byte is the characterA, drive the LED high and print “LED is ON”; otherwise drive the LED low and print “LED is OFF”.
Open the Energia Serial Monitor, type A in the input box at the top, and press Enter — the LED lights up and “LED is ON” prints back. Type any other character and the LED turns off. That’s complete two-way UART communication on the MSP430 in 20 lines of code.
Real-World UART Applications for the MSP430
Once you can send and receive bytes over UART, an enormous range of hardware opens up. Nearly every “smart” module for hobbyist electronics communicates over UART because it’s cheap and universal:
- Bluetooth: HC-05 and HC-06 modules talk UART at 9600 baud by default. Pair with a phone, receive characters from a Bluetooth terminal app, and you have wireless remote control of the MSP430.
- GPS: NEO-6M, u-blox modules, and almost every consumer GPS stream NMEA sentences over UART continuously. Parse
$GPRMClines to extract latitude and longitude. - GSM / cellular: SIM800L, SIM900, SIM300 modules accept AT commands over UART. Send
AT+CMGSto send an SMS,AT+CIPSTARTto open a TCP connection. - WiFi: ESP8266 and ESP-01 modules expose AT-command UART interfaces so a small MCU like the MSP430G2553 can go online without running an IP stack itself.
- Sensor breakouts: air-quality sensors (PMS5003), fingerprint readers, LIDARs, and barcode scanners often use UART as their primary interface.
- MCU-to-MCU: a simple 3-wire UART link is the easiest way to pass data between an MSP430 and an Arduino, STM32, ESP32, or another MSP430.
Troubleshooting MSP430 UART Issues
- Serial Monitor shows garbage characters (e.g., “x!%?&###”). Baud rate mismatch — the rate in
Serial.begin()must match the dropdown at the bottom of the Serial Monitor. If your sketch uses 9600, set the monitor to 9600. - Serial Monitor shows nothing at all. Wrong COM port under Tools → Serial Port, or the J3 jumpers are in software-UART position on Rev 1.5 hardware. Move the TXD/RXD jumpers on J3 to hardware-UART orientation (rotated 90°) and verify the COM port assignment in Windows Device Manager.
- Only the first character is received reliably. You forgot to call
Serial.available()beforeSerial.read(), soread()returns -1 when the buffer is empty. Always checkSerial.available()first. - Characters arrive with missing bytes at high baud rates. The MSP430G2553 runs its default clock from an internal DCO which drifts with temperature. For reliable 115200 baud communication, lower to 9600 or 38400, or add an external 32 kHz crystal on P2.6/P2.7 for accurate clock calibration.
- Two MSP430s cannot talk to each other. Either Tx/Rx are not crossed (Tx-to-Rx and Rx-to-Tx), ground is not shared between them, or the baud rates don’t match.
- UART works while USB is connected but breaks when the LaunchPad is battery-powered. Expected — when you disconnect USB, the onboard programmer powers down, so the virtual COM port disappears. Use an external FTDI or CP2102 adapter connected directly to P1.1/P1.2 for standalone serial.
- Random characters at power-up. The first byte out of any UART on boot is sometimes junk (line levels stabilizing). Ignore the first character, or send a known sync byte first and discard everything before it.
Frequently Asked Questions
Which pins are the UART Tx and Rx pins on the MSP430G2 LaunchPad?
On the MSP430G2 LaunchPad, the hardware UART pins are header pin 3 (P1.1 = Rx) and header pin 4 (P1.2 = Tx). These are routed through the onboard USB bridge so the Energia Serial Monitor can communicate with the MSP430 directly over the same USB cable used for programming.
What baud rates does the MSP430G2553 support?
The MSP430G2553’s hardware UART (USCI_A0) supports the standard baud rates: 1200, 2400, 4800, 9600, 19200, 38400, 57600, and 115200. At 16 MHz DCO with oversampling by 16, rates up to 115200 work reliably. For the absolute lowest error rates at high baud, add a 32 kHz external crystal on P2.6/P2.7.
Do I need an external FTDI cable for the MSP430G2 LaunchPad?
No — the LaunchPad’s onboard programmer (the eZ-FET or eZ430) also acts as a USB-to-UART bridge. Plug the LaunchPad into your PC and a virtual COM port appears automatically. Energia’s Serial Monitor speaks to that COM port. You only need an external FTDI cable if you remove the MSP430G2553 from its socket and run it standalone, or if you want to talk to P1.1/P1.2 from a PC that isn’t directly running the programmer.
What is the difference between Serial.print, Serial.println, and Serial.write?
Serial.print(value) sends the value as human-readable ASCII text (the number 65 is sent as the characters “6” and “5”). Serial.println(value) does the same and appends rn so each print appears on its own line in the Serial Monitor. Serial.write(value) sends the raw byte (the number 65 is sent as a single byte with value 65, which displays as the character “A”). Use write when talking to binary protocols; use print/println for human-readable output.
Can I use UART and the onboard push button at the same time?
Yes. The hardware UART uses P1.1 and P1.2, while the onboard push button S2 is on P1.3. They don’t overlap, and you can read the button with digitalRead(5) (header pin 5 = P1.3) in the same sketch that is running Serial.print() calls.
How do I connect a Bluetooth module like the HC-05 to the MSP430G2553 UART?
The HC-05 has its own Tx and Rx pins. Wire HC-05 Tx to MSP430 Rx (header pin 3, P1.1) and HC-05 Rx to MSP430 Tx (header pin 4, P1.2) — remember Tx and Rx cross over. Connect HC-05 VCC to the LaunchPad’s TP1 (5 V rail) and HC-05 GND to the LaunchPad GND. By default the HC-05 is at 9600 baud, which matches Serial.begin(9600).
Conclusion
You now have a complete UART serial communication setup with the MSP430 microcontroller. You learned how asynchronous serial communication works, where the Tx and Rx pins are on the MSP430G2 LaunchPad, the full Energia Serial API, and two working examples — transmitting counter values to the Serial Monitor, and receiving a character from the PC to control an LED. From here you can plug in any UART peripheral on the market — Bluetooth, GPS, GSM, WiFi, fingerprint sensor, LIDAR — and communicate with it using exactly the same Serial.begin / available / read / print pattern. Next up in this series we look at the ADC, so you can read real analog signals on the MSP430.
Related MSP430G2 LaunchPad Tutorials
- MSP430G2 LaunchPad Getting Started Tutorial with Energia IDE
- MSP430G2 LaunchPad GPIO Tutorial – Input/Output Pins
- RGB LED Interfacing with MSP430G2 LaunchPad
- PIR Motion Sensor Interfacing with MSP430G2 LaunchPad
- 16×2 LCD Interfacing with MSP430 LaunchPad
- Scrolling Text on LCD using MSP430 Microcontroller
- How to Use ADC of MSP430 Microcontroller
- Pulse Width Modulation using MSP430 LaunchPad
Thanks for the info.. Simple to understand.. Efficient content