Side-by-side comparison
| Parameter | UART | USB |
|---|---|---|
| Protocol Type | Asynchronous serial — no clock, peer-to-peer | Synchronous differential; host-controlled bus with enumeration |
| Max Data Rate | Up to 5 Mbaud (practical); 115200 baud typical | FS: 12 Mbps; HS: 480 Mbps; SS (USB 3): 5 Gbps |
| Wires | 2 (TX, RX) | 4 (VBUS, D+, D−, GND); USB-C: 24 pins |
| Power Delivery | None — external supply required | USB 2.0: 500 mA@5 V; USB-PD: up to 100 W |
| Device Discovery | None — manual baud rate agreement | Enumeration: host queries descriptor, assigns address, loads driver |
| Protocol Stack Complexity | Minimal — baud rate + start/stop bit framing | High — descriptors, endpoints, USB classes (CDC, HID, MSC) |
| Driver on Host PC | Requires USB-UART bridge IC (CH340, CP2102) to appear as COM port | Native driver for CDC-ACM (virtual COM), HID, MSC — no extra IC |
| Cable Distance | Up to 15 m (TTL); RS-232 to 15 m; RS-485 to 1200 m | USB 2.0: 5 m; USB 3: 3 m; extendable with hub |
| Error Detection | Parity bit only | CRC5 and CRC16 on every packet |
| Typical MCU Implementation | Single peripheral, 4 registers (BRR, CR1, DR, SR) | USB OTG peripheral + STM32 USB device library + 3 descriptor files |
Key differences
UART is trivially simple to implement — set BRR register, enable UART, read/write DR — but it requires a USB-UART bridge chip (CH340G, CP2102) to communicate with a PC, adding cost and a proprietary driver dependency. USB CDC-ACM (virtual COM port) in an STM32F4 appears as a COM port without any extra silicon, but it needs ~10 kB of flash for the USB stack and correct descriptor tables. USB delivers up to 500 mA at 5 V on the bus, eliminating external power supplies in many designs. For data rates above 1 Mbps or power delivery or PC plug-and-play (HID, mass storage), USB has no competition; for simple sensor debugging, PCB-to-PCB links, and long cables, UART wins by a large margin.
When to use UART
Use UART for simple inter-board communication, sensor module integration, and debug console output where a USB stack would be disproportionate overhead. Example: a Raspberry Pi communicates with an Arduino Nano via UART at 115200 baud to read sensor data, using four wires and zero protocol overhead.
When to use USB
Use USB when the device must connect to a PC without additional bridge hardware, deliver or consume significant bus power, or transfer data at above 1 Mbps. Example: an STM32F4 Discovery board uses USB FS CDC to present a virtual COM port to Windows 11 at 12 Mbps with no CH340 bridge; the STM32 USB library handles enumeration in under 200 ms.
Recommendation
For any device designed to plug into a PC, choose USB CDC or HID — no bridge chip, native driver, and power delivery make it the right choice. For MCU-to-MCU links on a PCB or RS-485 industrial buses, choose UART. Never add USB to a design that communicates only between two PCBs in the same product; the stack complexity and silicon area cost far more than the minor speed benefit.
Exam tip: Examiners ask students to list the USB enumeration sequence — know the 8 steps: reset, Get Device Descriptor, set address, Get Configuration Descriptor, Set Configuration, device ready — and state what CDC-ACM class does (virtual COM port, no driver on Windows 10+).
Interview tip: An interviewer at a consumer electronics company will ask you to compare USB HID and USB CDC for a keyboard design — answer: HID has a standard OS driver and reports are 8 bytes per interrupt transfer at 125 Hz, while CDC is a serial stream needing a COM port app; HID is always correct for keyboard/mouse.