Search topics...
UARTUART vs RS-485foundational

What is the difference between UART, RS-232, and RS-485? When would you choose RS-485?

0 upvotes
Practice with AISoon
Study the fundamentals first — UART topic page

UART refers to the digital logic block inside the MCU — it handles framing, baud rate generation, and parallel-to-serial conversion. RS-232 and RS-485 are electrical standards that define how UART's logical signals are converted to physical voltages on a cable.

RS-232 uses single-ended signaling with voltage swings of +/- 3V to +/- 15V (inverted logic: negative voltage = logic 1). It supports point-to-point communication over cables up to about 15 meters. A level shifter IC (MAX232, MAX3232) converts between UART TTL levels (0/3.3V) and RS-232 voltages.

RS-485 uses differential signaling on a twisted pair (lines A and B). Because the receiver looks at the voltage difference between A and B rather than the absolute voltage, common-mode noise is rejected. This enables communication over distances up to 1200 meters at lower baud rates, or 100+ meters at 1 Mbps. RS-485 also supports multi-drop configurations with up to 32 (or 256 with enhanced transceivers) devices on a single bus — unlike UART/RS-232, which are strictly point-to-point.

Choose RS-485 for industrial environments (factory floors, building automation, sensor networks) where: (1) cable runs exceed a few meters, (2) electrical noise from motors or power supplies is present, (3) multiple devices must share a single bus, or (4) galvanic isolation is needed (RS-485 transceivers with integrated isolation are common). The MCU's UART peripheral is used unchanged — only the physical transceiver IC differs. Firmware must manage the transceiver's DE (Driver Enable) pin to switch between transmit and receive on the half-duplex bus, typically toggling it in the TX-complete ISR.

Source: UART Q&A