How to Set Up a UART Terminal on Linux, macOS, and Windows

How to Set Up a UART Terminal on Linux, macOS, and WindowsSerial UART (Universal Asynchronous Receiver/Transmitter) terminals are essential tools for communicating with microcontrollers, routers, embedded boards, and many hardware devices. This guide shows practical, step-by-step instructions for setting up and using a UART terminal on Linux, macOS, and Windows — including choosing the right cable, identifying the serial device, configuring baud rate and other serial parameters, and using common terminal programs. Examples include connecting to an Arduino, Raspberry Pi serial console, or bare-metal microcontroller.


What you need

  • A device with a UART interface (TX, RX, GND — sometimes also VCC).
  • A serial adapter/cable:
    • TTL-level USB-to-UART adapters (e.g., FTDI FT232, CP2102, CH340) for 3.3V/5V boards.
    • USB-to-RS232 adapters for legacy RS-232 devices (less common for hobby embedded boards).
  • A terminal program:
    • Linux: screen, picocom, minicom, cutecom, or gtk-term.
    • macOS: screen, picocom, or third-party apps like CoolTerm, Serial.
    • Windows: PuTTY, Tera Term, RealTerm, or Windows built-in terminal support via Windows Terminal + WSL.
  • Correct wiring and voltage levels — wrong voltage can damage hardware. Most embedded boards use 3.3V TTL; ensure your adapter matches.

Quick checklist before connecting

  • Confirm UART voltage level (3.3V vs 5V).
  • Connect TX of adapter to RX of target, and RX to TX (crossed).
  • Connect ground (GND) between both devices.
  • Optionally avoid connecting VCC unless you need to power the target from the adapter and are sure voltages match.
  • Know the required baud rate and serial settings (commonly 115200, 8N1: 115200 baud, 8 data bits, No parity, 1 stop bit).

Linux

Install tools

Most distributions already include a terminal program. Recommended:

  • screen (simple, usually preinstalled)
  • picocom (lightweight, modern)
  • minicom (full-featured)

Install (Debian/Ubuntu example):

sudo apt update sudo apt install picocom minicom screen 

Identify the device node

Plug in your USB-UART adapter and check kernel messages:

dmesg | tail 

Common device nodes:

  • /dev/ttyUSB0 (FTDI, CH340, CP210x on many distros)
  • /dev/ttyACM0 (CDC ACM devices like Arduino Leonardo/Micro)

You can also list devices:

ls -l /dev/ttyUSB* /dev/ttyACM* 2>/dev/null 

Check permissions: your user must be in the “dialout” or “uucp” group on many systems:

groups sudo usermod -aG dialout $USER   # then log out/in 

Open a terminal (examples)

Picocom:

picocom -b 115200 /dev/ttyUSB0 # Quit: Ctrl-A then Ctrl-X 

Screen:

screen /dev/ttyUSB0 115200 # Quit: Ctrl-A then  then y 

Minicom (interactive configuration):

sudo minicom -s # Configure serial port -> /dev/ttyUSB0, set baud 115200, save as dfl, then Exit 

Tips:

  • If you get garbled text, verify baud, parity, and wiring.
  • Use stty to inspect/configure advanced settings:
    
    stty -F /dev/ttyUSB0 -a 

macOS

Install tools

macOS includes screen. For others, install via Homebrew:

brew install picocom 

Identify the device

Plug in adapter and run:

ls /dev/tty.* /dev/cu.* 2>/dev/null 

Typical macOS device names:

  • /dev/tty.usbserial-XXXX
  • /dev/cu.usbserial-XXXX (use /dev/cu.* for direct connection)

Use system logs:

log stream --predicate 'process == "kernel"' --info 

or check:

ioreg -p IOUSB -l -w 0 

Open a terminal

Screen:

screen /dev/cu.usbserial-XXXX 115200 # Quit: Ctrl-A then  

Picocom:

picocom -b 115200 /dev/cu.usbserial-XXXX # Quit: Ctrl-A then Ctrl-X 

Tips:

  • macOS may auto-load drivers for common adapters (CP210x, FTDI). If not, download drivers from manufacturer.
  • Prefer /dev/cu.* for initiating connections; /dev/tty.* is for incoming.

Windows

Drivers and adapter detection

  • Many USB-UART chips require drivers: CH340, CP2102, FTDI. Newer Windows versions may auto-install.
  • Check Device Manager -> Ports (COM & LPT) to find the COM port number (e.g., COM3).

Terminal programs

  • PuTTY — lightweight and popular.
  • Tera Term — older but feature-rich.
  • RealTerm — useful for binary transfers and logging.
  • Windows ⁄11: you can use WSL and Linux tools, but native GUI apps are often simpler.

PuTTY example

  1. Open PuTTY.
  2. Select “Serial”.
  3. Set “Serial line” to COMx (from Device Manager) and “Speed” to 115200.
  4. Click Open.

Close with the window’s close button or disconnect from the session menu.

Tera Term

  1. Open Tera Term; select Serial and COMx.
  2. Configure → Serial port → set baud, data bits, parity, stop bits.

PowerShell and mode.exe

For quick access via command line, Windows 10+ supports the mode command:

mode COM3: BAUD=115200 PARITY=N DATA=8 STOP=1 

Note: mode sets parameters but does not provide an interactive terminal.


Common issues and troubleshooting

  • No device shown:

    • Check cable and connection. Try another USB port.
    • Verify drivers are installed (Windows/macOS).
    • On Linux, ensure you’re in dialout group and permissions allow access.
  • Garbage or odd characters:

    • Wrong baud rate, parity, or incorrect voltage levels. Match settings on both ends.
  • Nothing appears (device silent):

    • Device might not boot, might require flow control signals (RTS/CTS) or a specific boot pin held.
    • Verify that TX/RX are crossed and GND is connected.
    • Some boards require pressing a reset button to get bootloader output.
  • Device resets unexpectedly:

    • DTR or RTS lines from USB adapters can toggle reset lines on some boards (Arduino auto-reset). Use an adapter or terminal settings that leave DTR/RTS unchanged.
  • Permission denied (Linux/macOS):

    • Add your user to dialout/tty group or use sudo for testing.

Useful advanced tips

  • Logging: Most terminals can save session logs. In PuTTY use Session → Logging. In picocom use -l logfile.
  • Scripting and automation: Use expect, socat, or Python’s pySerial for automated interaction.
  • Binary transfers: Use XMODEM/YMODEM/ZMODEM supported by many terminal programs (e.g., lrzsz in Linux, Tera Term on Windows).
  • Flow control: Most simple setups don’t require hardware flow control; leave it off unless specified.
  • USB-to-UART adapter selection: Prefer well-supported chips (FTDI or CP210x) for driver stability.

Example: Connect to a Raspberry Pi serial console

  1. On Raspberry Pi, enable serial console in raspi-config or ensure /boot/cmdline.txt includes console=serial0,115200.
  2. Connect adapter: adapter TX → Pi RX (GPIO15), adapter RX → Pi TX (GPIO14), and GND → GND. Do NOT connect 5V.
  3. On host:
    • Linux/macOS: screen /dev/ttyUSB0 115200
    • Windows: PuTTY → COMx at 115200
  4. Press Enter; you should see the login prompt.

Example: Simple Python serial monitor (cross-platform)

Save as serial_monitor.py:

import sys import serial import time if len(sys.argv) != 3:     print("Usage: python serial_monitor.py <port> <baud>")     sys.exit(1) port, baud = sys.argv[1], int(sys.argv[2]) with serial.Serial(port, baud, timeout=0.1) as s:     print(f"Connected to {port} @ {baud}")     try:         while True:             data = s.read(1024)             if data:                 print(data.decode('utf-8', errors='replace'), end='')             time.sleep(0.01)     except KeyboardInterrupt:         pass 

Run:

python3 -m pip install pyserial python3 serial_monitor.py /dev/ttyUSB0 115200 

Summary

  • Confirm voltage levels and wire TX↔RX, GND↔GND.
  • Common default serial settings: 115200 8N1.
  • On Linux use /dev/ttyUSB* or /dev/ttyACM* with picocom/screen/minicom.
  • On macOS use /dev/cu.* devices and screen/picocom or GUI apps.
  • On Windows use PuTTY/Tera Term and the COMx port from Device Manager.

With the right cable, correct wiring, and matching serial settings, connecting to a UART terminal is straightforward and a vital skill for debugging and interacting with embedded hardware.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *