Recently, I have gained new insights into RS232, RS422, and RS485, and I would like to summarize them here.
Before summarizing, let me add a knowledge point: the OSI seven-layer network model, which defines the seven layers as follows:
| Layer 7: Application Layer | Provides network service interfaces forapplications, such as HTTP and FTP. |
| Layer 6: Presentation Layer | Responsible for dataformat conversion, such as encryption, decryption, and compression. |
| Layer 5: Session Layer | Responsible for establishing, managing, and terminatingsessions between two applications. |
| Layer 4: Transport Layer | Responsible forend-to-end complete data transmission, providing reliable (TCP) or unreliable (UDP) services. |
| Layer 3: Network Layer | Responsible forrouting and forwarding data packets between different networks, usingIP addresses. |
| Layer 2: Data Link Layer | Ensures reliable transmission ofdata frames between directly connected nodes, usingMAC addresses. |
| Layer 1: Physical Layer | Responsible for transmittingraw bit streams over physical media (cables, fiber optics), defining voltage, interfaces, etc. |
Here, we focus on the first and second layers!
Next, it is essential to clarify a core concept: RS232, RS422, and RS485 are not communication protocols; they are fundamentally physical layer voltage standards. RS232, RS422, and RS485 belong entirely to the physical layer, while the UART protocol primarily implements functions of the data link layer, with a small portion related to the physical layer (e.g., timing specifications).
Therefore, there is no necessary connection between RS232, RS422, RS485 and the UART protocol!
UART is like the Android system, which establishes the core rules and framework for software and data interaction. RS232, RS422, and RS485 are like the hardware platforms of Xiaomi, OPPO, and VIVO smartphones, determining the physical form, communication interfaces, and electrical characteristics of devices. Just as the Android system can be installed on different brands of smartphones, this set of “core systems” can also be configured with different “hardware drivers.” By combining with RS232, RS422, or RS485 as these “hardware platforms,” a complete communication system can be built to adapt to different scenarios.
So why is RS232 often mixed up with UART?
This is because during the glorious 20-30 years of personal computers, the standard DB9 interface on the motherboard was officially referred to as the “serial port” or “COM port,” and its physical electrical standard is RS232. Therefore, for an entire generation of technicians, what they saw was: the “serial port” on the computer = DB9 physical interface = RS232 voltage, so this saying has persisted to this day. However, technology has evolved, and the serial ports commonly used in microcontrollers, ARM, and other embedded cores are no longer RS232 levels but TTL levels. Meanwhile, the serial port on the computer still uses the RS232 voltage standard, so microcontrollers often use level conversion chips when communicating with the computer side.
What are the differences between the three voltage standards RS232, RS422, and RS485?
RS232 is the simplest and most basic of the three standards. It uses single-ended transmission and push-pull output to achieve full-duplex point-to-point communication. Its voltage standard explicitly states:
Logic “1”: -3V to -15V;
Logic “0”: +3V to +15V;
-3V to +3V is the invalid range and should be avoided.
The design intent of RS-232 is to provide a connection between computers and peripherals. It uses higher communication levels, partly due to the historical technological path and partly because high levels can provide greater noise immunity, thus having stronger anti-interference capability over short distances.
However, due to the physical characteristics of its single-ended signal, RS-232 is typically used only for point-to-point communication, with the standard-recommended reliable communication distance generally not exceeding 15 meters.
Note: In practical engineering use, the actual communication distance can be much greater than 15 meters.
To address the long-distance transmission limitations of RS232, RS422 was developed.
RS422 employs differential transmission technology, giving it strong common-mode interference immunity, allowing transmission distances to exceed 1000m. RS-422 also uses push-pull output, supporting full-duplex communication, and can achieve point-to-point as well as one-to-multiple topologies. The logic state is determined by the voltage difference between two signal lines (V_A – V_B):
Logic ‘1’: V_A – V_B < -200mV;
Logic ‘0’: V_A – V_B > +200mV;
The driver must produce a differential output voltage of ±2V to ±6V on a 100Ω load.
Additionally, RS422 receivers have a common-mode voltage reception range of -7V to +7V.
However, it is essential to note that the operating mode of RS-422 varies with the topology.
In point-to-point communication, RS-422 can fully utilize its full-duplex capability for simultaneous two-way communication; (essentially an upgraded version of RS232 for long-distance transmission)
In a one-to-multiple topology, the communication mode of RS-422 becomes unidirectional broadcasting, only sending and not receiving, and can support at most one transmitter and ten receivers.
This is because the push-pull output structure of RS-422 dictates that there can only be one main driver in a bus topology, while the other devices must be receiving slaves. If two or more drivers attempt to drive the same bus simultaneously, it will lead to signal short circuits and communication chaos due to output stage conflicts, severely affecting system stability.
RS485 was developed to solve the issue of RS422’s inability to communicate bidirectionally in a bus topology.
The voltage standard of RS485 is also based on differential signals, with the logic state determined by the voltage difference between the two lines (V_A – V_B):
Logic ‘1’: V_A – V_B < -200mV;
Logic ‘0’: V_A – V_B > +200mV;
The driver must produce a differential output voltage of ±1.5V to ±5V on a 54Ω load.
RS485 receivers have a wider common-mode voltage reception range of -7V to +12V, providing stronger anti-interference capability.
The reason RS422 can only communicate unidirectionally in a bus is that only one driver is allowed in the network. To address this, RS485 fundamentally changes the approach: all network nodes act as transceivers, allowing any device to send and receive, with a maximum of 32 transceivers on the same bus.
RS485 allows all nodes to be transceivers without causing bus conflicts, the core reason being that RS485 uses a different push-pull output method than RS232 and RS422, employing tri-state output.
Note:The tri-state output of RS485 is central to its function as a multipoint bus topology; without tri-state output, there would be no RS485.
When RS485 transceivers are not actively sending data, they will set their output to a high-impedance state, effectively disconnecting from the bus and not interfering with other devices’ communication. This mechanism strictly ensures that only one driver is actively driving the bus at any given time, perfectly avoiding the signal short circuits and bus conflicts that inevitably arise from multiple drivers operating simultaneously in RS422.
However, this high-impedance mechanism introduces a new problem: when all drivers on the bus are in a high-impedance state, the differential lines will present a high-impedance floating state, which is prone to picking up environmental noise, causing the voltage levels to fall into an uncertain range, leading to communication misjudgments.
This is precisely why RS485 buses must introduce bias resistors. By setting pull-up and pull-down resistors at both ends of the bus, a definite voltage level (usually logic “1”) can be established when all drivers are idle, effectively preventing miscommunication caused by bus floating and ensuring system stability.
Note: Only one pair of bias resistors needs to be added across the entire bus.
However, in terms of circuit design, RS422 does not require bias resistors because there is always one driver driving the bus, keeping it at a definite voltage level. In practice, RS422 often has bias resistors added.
This is to prevent the driver from suddenly disconnecting from the bus due to failure, power loss, or hot-swapping. In such failure scenarios, the bias resistors can immediately take over, providing a definite idle voltage level for the bus, allowing the system to safely enter a preset fault mode rather than random chaos.
| Characteristics | RS232 | RS422 | RS485 |
| Signal Type | Single-ended | Differential | Differential |
| Logic Level | ±3V~±15V | ±200mV | ±200mV |
| Topology | Point-to-point | One-to-multiple | Multipoint |
| Max Devices | 1 Transmitter, 1 Receiver | 1 Transmitter, 10 Receivers | 32 Transceivers |
| Output Method | Push-pull output | Push-pull output | Tri-state output |
| Communication Mode | Full-duplex | Full-duplex | Half-duplex |
| Applicable Scenarios |
Short distance, point-to-point, simple debugging |
Long distance, one host sending, multiple hosts receiving |
Need to build a multi-device, bidirectional communication network |
Let’s take a break here; this summary of the three standards concludes for now. However, the discussion on these three standards is far from over, and I will reserve the following three key questions for the next update:
1. Why do RS422 and RS485 have minimum driver load requirements?
2. How to calculate the bias resistors for RS485?
3. How should the termination resistors for RS422 and RS485 be added?