Differences and Connections of RS-232, RS-422, and RS-485

Differences and Connections of RS-232, RS-422, and RS-485

Click on the above blue text to follow us

Serial communication is the most basic communication method faced by electrical engineers, and RS-232 is the simplest among them. Many beginners often struggle to understand the relationship and differences between UART, RS-232, RS-422, and RS-485. This article will discuss these concepts to help clarify their relationships.

If we compare serial communication to traffic, UART is like a station, and a frame of data is like a car. Cars traveling on the road must obey traffic rules. If it’s in the city, the speed limit is usually 30 or 40, while highways can reach 120. The type of road and speed limits depend on how the protocol is defined. Common serial port protocols include RS-232, RS-422, and RS-485. What are the subtle differences between them? Let’s explore together.

1

What is UART

UART stands for Universal Asynchronous Receiver/Transmitter, commonly referred to as UART, is an asynchronous transceiver that is a key module for asynchronous communication between devices. UART handles the serial/parallel and parallel/serial conversion between the data bus and the serial port and specifies the frame format; as long as both parties use the same frame format and baud rate, they can complete the communication process using only two signal lines (Rx and Tx) without sharing a clock signal, thus also known as asynchronous serial communication.

Differences and Connections of RS-232, RS-422, and RS-485

By adding a suitable level converter, such as SP3232E or SP3485, UART can also be used for RS-232 or RS-485 communication, or connect to a computer’s port. UART is widely used in applications such as mobile phones, industrial control, and PCs.

Differences and Connections of RS-232, RS-422, and RS-485

UART uses asynchronous, serial communication.

Serial communication refers to transmitting data one bit at a time over a transmission line. Its characteristics include simple communication lines, which can achieve communication with simple cables, reducing costs, and are suitable for long-distance communication, though at slower speeds.

Asynchronous communication uses a character as the transmission unit, and the time interval between two characters in communication is variable, while the time interval between two adjacent bits in the same character is fixed.

The data transfer rate is expressed in baud rate, i.e., the number of binary bits transmitted per second. For example, if the data transfer rate is 120 characters per second, and each character consists of 10 bits (1 start bit, 7 data bits, 1 parity bit, and 1 stop bit), the baud rate would be 10 × 120 = 1200 characters per second = 1200 baud.

The data communication format is shown in the figure below:

Differences and Connections of RS-232, RS-422, and RS-485

The meanings of each bit are as follows:

Start bit: Sends a logical “0” signal to indicate the start of the transmission character. Data bits: Can be 5 to 8 bits of logical “0” or “1”. For example, ASCII code (7 bits), extended BCD code (8 bits). Parity bit: After adding this bit to the data bits, the number of “1” bits should be even (even parity) or odd (odd parity). Stop bit: It is a character data’s end marker. It can be 1 bit, 1.5 bits, or 2 bits high level. Idle bit: Remains in a logical “1” state, indicating no data transmission on the current line.

Note: Asynchronous communication is character-based. The receiving device can correctly receive data as long as it maintains synchronization with the sending device within the transmission time of one character after receiving the start signal. The arrival of the next character’s start bit recalibrates synchronization (achieved by detecting the start bit to self-synchronize the clocks of the sender and receiver).

Differences and Connections of RS-232, RS-422, and RS-485

2

RS-232 Standard

RS-232 is a serial physical interface standard established by the Electronic Industry Association (EIA) in the United States. RS is an abbreviation for “Recommended Standard”, and 232 is the identification number. RS-232 specifies electrical and physical characteristics that only apply to the data transmission path; it does not specify how data is processed. It should be noted that many people often mistakenly refer to RS-232, RS-422, and RS-485 as communication protocols, which is incorrect; they are merely mechanical and electrical interface standards regarding UART communication (at most, they pertain to the physical layer of network protocols).

This standard specifies the use of a 25-pin DB-25 connector, regulating the signal content of each pin in the connector, as well as specifying the voltage levels of various signals. Later, IBM simplified RS-232 to a DB-9 connector for PC use, which has become the de facto standard today. In industrial control, the RS-232 port generally only uses RXD (2), TXD (3), and GND (5) lines.

Differences and Connections of RS-232, RS-422, and RS-485

In the early days, as PCs were equipped with RS-232 interfaces, we chose RS-232 when we needed to use UART. However, now personal computers, including laptops and desktops, no longer have RS-232 interfaces; you may notice that there is no DB9 connector on the computer motherboard. Therefore, development boards now typically use TTL UART or directly integrate UART to USB on the development boards.

In embedded systems, the serial port usually refers to the UART port, but we often confuse it with the COM port, as well as the relationships between RS-232, TTL, etc. In fact, UART and COM refer to the physical interface forms (hardware), while TTL and RS-232 refer to the voltage standards (electrical signals).

UART has 4 pins (VCC, GND, RX, TX) and uses TTL levels, with low level as 0 (0V) and high level as 1 (3.3V or above).

Differences and Connections of RS-232, RS-422, and RS-485

3

RS-485 / RS-422 Standards

The RS-232 interface can achieve point-to-point communication, but this method cannot realize networking. To solve this problem, a new standard, RS-485, was developed. The data signal of RS-485 uses differential transmission, also known as balanced transmission, using a pair of twisted pairs, one line defined as A and the other as B.

Under normal circumstances, the positive voltage level between the sending driver A and B is +2 to +6V, indicating one logical state, while the negative voltage level is -2 to -6V, indicating another logical state. There’s also a signal ground C, and RS-485 has an “enable” terminal, which is optional in RS-422.

RS-422 has the same electrical performance as RS-485. The main difference is that RS-422 has 4 signal lines: two for sending and two for receiving. Since RS-422 separates the sending and receiving, it can transmit and receive simultaneously (full-duplex), and because of this full-duplex requirement, RS-422 is suitable for communication between two stations, star networks, and ring networks, but not for bus networks; RS-485 only has 2 signal lines, so it can only work in half-duplex mode, commonly used in bus networks.

Differences and Connections of RS-232, RS-422, and RS-485

1. RS-485’s electrical characteristics: Logic “1” is represented by the voltage difference between the two lines as +(2~6)V; logic “0” is represented by the voltage difference as -(2~6)V. The interface signal level is lower than that of RS-232-C, making it less likely to damage the interface circuit chips, and this level is compatible with TTL levels, facilitating connections with TTL circuits.

2. The maximum data transmission rate for RS-485 is 10Mbps.

3. The RS-485 interface uses a combination of balanced drivers and differential receivers, enhancing the ability to withstand common-mode interference, i.e., it has good noise resistance.

4. The maximum communication distance for RS-485 is approximately 1219M, with a maximum transmission rate of 10Mb/S. The transmission rate is inversely proportional to the transmission distance; at a transmission rate of 100Kb/S, the maximum communication distance can be achieved. If longer distances are needed, RS-485 repeaters must be added. The RS-485 bus generally supports a maximum of 32 nodes; with special 485 chips, it can reach 128 or 256 nodes, and the maximum can support up to 400 nodes.

Due to the early emergence of the RS-232 interface standard, it inevitably has some shortcomings, mainly as follows:

(1) The signal voltage levels of the interface are relatively high, making it easy to damage interface circuit chips. Furthermore, as the 232 level is not compatible with TTL levels, level conversion circuits are needed to connect with TTL circuits;

(2) The transmission rate is relatively low; during asynchronous transmission, the baud rate is 20Kbps. Now, due to new UART chips, the baud rate has reached 115.2Kbps (1.832M/16);

(3) The interface uses one signal line and one signal return line, forming a common ground transmission form, which is prone to common-mode interference, thus having weak noise resistance;

(4) The transmission distance is limited, with a maximum standard transmission distance of 50 meters; in reality, it can only be used at around 15 meters;

(5) RS-232 only allows one-to-one communication and does not consider forming a serial bus. (This point is crucial; in many control scenarios, one controls multiple devices. If the main device needs to communicate point-to-point with each slave device, the field wiring becomes a spider web.)

Differences and Connections of RS-232, RS-422, and RS-485

Unbalanced serial communication interfaces RS-423, RS-449

Differences and Connections of RS-232, RS-422, and RS-485
Differences and Connections of RS-232, RS-422, and RS-485

Balanced serial communication interface RS-422

RS-422 (EIA RS-422-A Standard) is the serial port connection standard for Apple’s Macintosh computers. RS-422 uses differential signals while RS-232 uses unbalanced reference ground signals. Differential transmission uses two wires to send and receive signals. Compared to RS-232, it has better noise immunity and longer transmission distances. In industrial environments, better noise immunity and longer transmission distances are significant advantages.

Differences and Connections of RS-232, RS-422, and RS-485
Differences and Connections of RS-232, RS-422, and RS-485
Differences and Connections of RS-232, RS-422, and RS-485
Differences and Connections of RS-232, RS-422, and RS-485

4

Comparison of RS-232 and RS-485

1. Noise resistance: The RS-485 interface uses a combination of balanced drivers and differential receivers, providing good resistance to noise interference. The RS-232 interface uses one signal line and one signal return line, forming a common ground transmission that is prone to common-mode interference.

2. Transmission distance: The maximum standard transmission distance for the RS-485 interface is 1200 meters (at 9600bps), and it can actually reach up to 3000 meters. RS-232 has limited transmission distances, with a maximum standard transmission distance of 50 meters, and in reality, it can only be used at around 15 meters.

3. Communication capability: The RS-485 interface allows for connection of up to 128 transceivers on the bus, enabling users to easily establish a device network using a single RS-485 interface. RS-232 only allows one-to-one communication.

4. Transmission rate: RS-232 has a relatively low transmission rate, with a baud rate of 20Kbps during asynchronous transmission. The maximum data transmission rate of RS-485 is 10Mbps.

5. Signal lines: The RS-485 interface forms a half-duplex network, generally requiring only two signal lines. The RS-232 port typically uses RXD, TXD, and GND lines.

6. Electrical voltage levels: The logic “1” of RS-485 is represented by the voltage difference between the two lines as +(2-6)V; the logic “0” is represented as -(2-6)V. In RS-232-C, the voltage of any signal line is in a negative logic relationship, i.e., logic “1” is -5 to -15V; logic “0” is +5 to +15V.

5

Comparison of RS-422 and RS-485

The electrical performance of RS-485 is identical to that of RS-422. The main differences are:

1. RS-422 has 4 signal lines: two for sending (Y, Z) and two for receiving (A, B). Since RS-422 separates the sending and receiving, it can transmit and receive simultaneously (full-duplex).

2. RS-485 only has two data lines: sending and receiving are both A and B. Since RS-485 shares two lines for sending and receiving, it cannot transmit and receive simultaneously (half-duplex).

RS-485 standard uses a balanced sending and differential receiving transceiver to drive the bus. The specific specifications require:

The input resistance of the receiver RIN ≥ 12kΩ

The driver can output a common-mode voltage of ±7V

The input capacitance ≤ 50pF

In the case of 32 nodes and configured with 120Ω termination resistance, the driver can still output a voltage of at least 1.5V (the size of the termination resistance relates to the parameters of the twisted pair used).

The input sensitivity of the receiver is 200mV (i.e., (V+) – (V-) ≥ 0.2V indicates signal “0”; (V+) – (V-) ≤ -0.2V indicates signal “1”).

Differences and Connections of RS-232, RS-422, and RS-485

Due to the long-distance, multi-node (32 nodes), and low transmission line cost characteristics of RS-485, the EIA RS-485 has become the preferred standard for data transmission in industrial applications.

(1) The electrical characteristics of RS-485: The sending end represents logic “0” as the voltage difference between the two lines as + (2 ~6)V; logic “1” is represented as the voltage difference as – (2 ~6)V. The receiving end: A is considered logic “0” if it is more than 200mV higher than B, and A is considered logic “1” if it is more than 200mV lower than B;

(2) The maximum data transmission rate of RS-485 is 10Mbps. However, since RS-485 often communicates with the RS-232 port of a PC, the actual maximum is generally 115.2Kbps. Additionally, higher transmission rates can reduce the transmission distance of RS-485, so it is often around or below 9600bps;

(3) The RS-485 interface uses a combination of balanced drivers and differential receivers, enhancing resistance to noise interference;

(4) The maximum transmission distance for RS-485 is 1200 meters (at 9600bps), and it can actually reach up to 3000 meters. The RS-485 interface allows for connection of up to 128 transceivers on the bus, allowing users to easily establish a network using a single RS-485 interface. Because the RS-485 interface forms a half-duplex network, it generally requires only two signal lines, so RS-485 interfaces use twisted pair transmission. The international standard for RS-485 does not specify a connector standard for RS-485 interfaces, so terminal blocks or DB-9, DB-25 connectors can be used.

When using the RS-485 interface, for a specific transmission line gauge, the maximum allowable cable length for data signal transmission from generator to load is a function of data signal rate, which is mainly limited by signal distortion and noise. The relationship between maximum cable length and signal rate is based on the use of 24AWG copper twisted pair telephone cables (gauge of 0.51mm), with inter-line bypass capacitance of 52.5PF/M and terminal load resistance of 100 ohms (cited from GB11014-89 Appendix A). When the data signal rate drops below 90Kbit/S, assuming a maximum allowable signal loss of 6dBV, the cable length is limited to 1200m. In practice, it is entirely possible to achieve longer cable lengths than this. When using different gauge cables, the maximum cable length achieved will vary. For example, when the data signal rate is 600Kbit/S using 24AWG cable, the maximum cable length is 200m; if using 19AWG cable (gauge of 0.91mm), the cable length can exceed 200m; if using 28AWG cable (gauge of 0.32mm), the cable length will be less than 200m.

It is recommended to use shielded cables for long-distance communication with RS-485 and to connect the shield layer as the ground.

6

Three Factors Affecting RS-485 Bus Communication Speed and Reliability

1. Signal Reflection in Communication Cable

During communication, two factors can cause signal reflection: impedance discontinuities and impedance mismatches.

Impedance discontinuity occurs when the signal suddenly encounters a cable impedance that is very low or even nonexistent at the end of the transmission line, causing reflection at that point. This principle of signal reflection is similar to light reflecting when it enters another medium. To eliminate this reflection, a termination resistor matching the characteristic impedance of the cable must be connected at the end of the cable to maintain impedance continuity. Since the signal transmission on the cable is bidirectional, a termination resistor of the same size can also be connected at the other end of the communication cable.

Differences and Connections of RS-232, RS-422, and RS-485

Theoretically, as long as a termination resistor matching the characteristic impedance of the cable is connected at the end of the transmission cable, signal reflection should not occur. However, in practical applications, because the characteristic impedance of the transmission cable is related to the communication baud rate and other environmental factors, the characteristic impedance cannot be perfectly equal to the termination resistor, so some signal reflection will still exist.

Another cause of signal reflection is the impedance mismatch between the data transceiver and the transmission cable. This type of reflection mainly manifests when the communication line is idle, leading to data confusion across the network.

The impact of signal reflection on data transmission ultimately arises because reflected signals trigger the comparator at the receiver’s input, causing the receiver to receive erroneous signals, resulting in CRC errors or entire data frame errors.

In signal analysis, the parameter used to measure the strength of reflected signals is RAF (Reflection Attenuation Factor). Its calculation formula is as follows:

RAF=20lg(Vref/Vinc) (1)

Where: Vref—voltage magnitude of the reflected signal; Vinc—voltage magnitude of the incident signal at the connection point between the cable and the transceiver or termination resistor.

Specific measurement methods are illustrated in the figure. For example, if the peak-to-peak value of a 2.5MHz incident signal sine wave is +5V and the peak-to-peak value of the reflected signal is +0.297V, the reflection attenuation factor of this communication cable at a communication rate of 2.5MHz is:

RAF=20lg(0.297/2.5)=-24.52dB

Differences and Connections of RS-232, RS-422, and RS-485

To mitigate the impact of reflected signals on communication lines, noise suppression and bias resistor methods are typically employed. In practical applications, for relatively small reflected signals, the bias resistor method is often used for simplicity. This principle explains how to improve communication reliability through the addition of bias resistors in communication lines.

2. Signal Attenuation in Communication Cable

The second factor affecting signal transmission is signal attenuation during transmission through the cable. A transmission cable can be viewed as an equivalent circuit formed by distributed capacitance, distributed inductance, and resistance, as shown in the figure.

Differences and Connections of RS-232, RS-422, and RS-485

The distributed capacitance C of the cable is mainly generated by the two parallel conductors of the twisted pair. The conductor’s resistance has a negligible effect on the signal. The signal loss is primarily due to the LC low-pass filter formed by the distributed capacitance and inductance of the cable. The attenuation coefficients of standard LAN-type two-core cables used in PROFIBUS (the standard cable selected for Siemens DP bus) at different baud rates are shown in Table 1.

The cable’s attenuation coefficient

Differences and Connections of RS-232, RS-422, and RS-485

3. Pure Resistive Load in Communication Cable

The third factor affecting communication performance is the size of the pure resistive load (also called DC load). Here, the pure resistive load mainly consists of termination resistors, bias resistors, and RS-485 transceivers.

Differences and Connections of RS-232, RS-422, and RS-485

When discussing the EIA RS-485 specification, it was mentioned that the RS-485 driver, when connected to 32 nodes with 150Ω termination resistors, can output at least 1.5V of differential voltage. The input resistance of a receiver is 12kΩ, and the entire network’s equivalent circuit is shown in the figure. According to this calculation, the load capacity of the RS-485 driver is:

RL=32 input resistors in parallel + 2 termination resistors = ((12000/32) × (150/2)) / ((12000/32) + (150/2)) ≈ 51.7Ω

Currently, commonly used RS-485 drivers include MAX485, DS3695, MAX1488/1489, and SN75176A/D used by Holley, among others, some of which can achieve load capacities of up to 20Ω. Without considering many other factors, based on the relationship between driving capacity and load, a driver can support significantly more nodes than 32.

When the communication baud rate is relatively high, bias resistors are essential in the line. The connection method for bias resistors is illustrated in the figure. Their role is to pull the voltage level away from 0 when there is no data on the bus (idle state), as shown in the figure. This way, even if small reflected signals or interference occur in the line, the data receivers connected to the bus will not misinterpret these signals.

Differences and Connections of RS-232, RS-422, and RS-485

Through the following example, the size of the bias resistors can be calculated:

Termination resistors Rt1=Rr2=120Ω;

Assuming the maximum peak-to-peak value of the reflected signal Vref≤0.3Vp-p, then the negative half-cycle voltage Vref≤0.15V; the reflected current Iref caused by the reflected signal on the termination resistors ≤0.15/(120||120)=2.5mA. Generally, the hysteresis voltage value of RS-485 transceivers (including SN75176) is 50mV, i.e.,

(Ibias-Iref) × (Rt1||Rt2) ≥ 50mV

Thus, the bias current Ibias ≥ 3.33mA can be calculated.

+5V=Ibias(Rup + Rdown + (Rt1||Rt2)) (2)

Using equation (2), it can be calculated that Rup=Rdown=720Ω

In practical applications, there are two methods for adding bias resistors to the RS-485 bus:

(1) Distributing bias resistors evenly to each transceiver on the bus. This method adds bias resistors to each transceiver connected to the RS-485 bus, providing a bias voltage to each transceiver.

(2) Using a pair of bias resistors on a segment of the bus. This method is particularly effective for large reflected signals or interference signals on the bus. It is worth noting that the addition of bias resistors increases the load on the bus.

7

The Relationship Between RS-485 Bus Load Capacity and Communication Cable Length

When designing the network configuration (bus length and load count) for the RS-485 bus, three parameters should be considered: pure resistive load, signal attenuation, and noise margin. The pure resistive load and signal attenuation parameters have been discussed earlier; now we will discuss noise margin. The noise margin of RS-485 bus receivers should be at least greater than 200mV. The previous discussions assumed a noise margin of 0. In practical applications, to enhance the bus’s anti-interference capability, the noise margin of the system is generally expected to be better than what is specified in the EIA RS-485 standard. The following formula illustrates the relationship between the number of loads on the bus and the length of the communication cable:

Vend=0.8(Vdriver-Vloss-Vnoise-Vbias)(3)

Where: Vend is the signal voltage at the end of the bus, which is set to 0.2V during standard measurement; Vdriver is the output voltage of the driver (which is related to the number of loads. For 5-35 loads, Vdriver = 2.4V; for fewer than 5 loads, Vdriver = 2.5V; for more than 35 loads, Vdriver ≤ 2.3V); Vloss is the signal loss during transmission in the bus (related to the specifications and length of the communication cable), calculated based on the standard cable attenuation coefficient provided in Table 1 according to the formula attenuation coefficient b = 20lg(Vout/Vin); Vnoise is the noise margin, which is set to 0.1V during standard measurement; Vbias is the bias voltage provided by the bias resistors (typical value is 0.4V).

The multiplication by 0.8 in equation (3) is to prevent the communication cable from entering a fully loaded state. From equation (3), it can be seen that the size of Vdriver is inversely proportional to the number of loads on the bus, and the size of Vloss is inversely proportional to the length of the bus; the other parameters are only related to the type of driver used. Therefore, with a selected RS-485 driver on the bus, under a fixed communication baud rate, the number of loads on the bus is directly related to the maximum distance signals can be transmitted. The specific relationship is: within the allowable range of the bus, the more loads there are, the shorter the signal transmission distance; the fewer loads there are, the longer the signal transmission distance.

8

Impact of Distributed Capacitance on RS-485 Bus Transmission Performance

The distributed capacitance of the cable is mainly generated by the two parallel conductors of the twisted pair. Additionally, there is also distributed capacitance between the conductors and ground, which, while small, cannot be ignored in analysis. The impact of distributed capacitance on bus transmission performance mainly arises because the signal transmitted on the bus is a fundamental wave signal, and the signal can only be expressed as “1” and “0”. In special bytes, for example, 0x01, the signal “0” allows sufficient charging time for the distributed capacitance, while when the signal “1” arrives, the charge in the distributed capacitance cannot discharge in time, resulting in (Vin+) – (Vin-) still being greater than 200mV, leading the receiver to misinterpret it as “0”, ultimately causing CRC errors and incorrect transmission of the entire data frame. The specific process is illustrated in the figure.

Differences and Connections of RS-232, RS-422, and RS-485

Due to the influence of distributed capacitance on the bus, errors in data transmission occur, thereby degrading the overall performance of the network. Two methods can solve this problem:

(1) Reduce the data transmission baud rate;

(2) Use cables with low distributed capacitance to improve the quality of the transmission line.

Simply connecting the A and B ends of various interfaces using a pair of twisted wires without grounding the RS-485 communication link’s signals may work in some cases, but it poses potential risks to the system. The RS-485 interface transmits signals differentially and does not require a reference point for signal detection; it only needs to detect the potential difference between the two wires. However, it should be noted that the transceiver only works properly when the common-mode voltage does not exceed a certain range (-7V to +12V). When the common-mode voltage exceeds this range, it can affect communication reliability or even damage the interface. For instance, when transmitter A sends data to receiver B, the common-mode voltage at transmitter A’s output is VOS. Due to the existence of ground potential differences VGPD between the two systems, the common-mode voltage at the receiver’s input can reach VCM = VOS + VGPD. The RS-485 standard specifies that VOS ≤ 3V, but VGPD can vary widely (dozens of volts), potentially accompanied by strong interference signals, causing the receiver’s common-mode input VCM to exceed normal ranges, leading to interference currents on the signal line that disrupt normal communication or damage devices.

Summary:

The serial port is a very common device interface, frequently used in instruments and equipment for communication, commonly used for remote data collection or remote control. The development of serial ports is relatively simple, making them one of the favorite interfaces for many engineers.

Differences and Connections of RS-232, RS-422, and RS-485
Differences and Connections of RS-232, RS-422, and RS-485

← Scan to add customer service friend

Reply “group chat” to enter the WeChat group

Click Read Original to learn about knowledge such as “Electricians, PLC, Servo, Robots” for free

Great article! Must like it

Leave a Comment