Differences Between RS-232, RS-422, and RS-485

Differences Between RS-232, RS-422, and RS-485

Siemens S7-1500 Project Design and Practice Complete Tutorial!

Siemens Communication Principles and Methods Mastery Tutorial Free Download!

Over 600 CasesElectronic Repair TipsRepair Engineer’s Bible!

Over 600 Common Electrical Circuit Diagrams Pack Download for Free!

Popular Brand PLC Programming Series Books Free Download!

Serial communication is the most basic communication method faced by electrical engineers, with RS-232 being 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 akin to a car. Cars must follow traffic rules on the road. If it’s in the city, the speed limit is usually 30 or 40, while on the highway it can reach 120. The road a car takes and the speed limit depends on the protocol specifications. 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, which 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 communicating parties adopt the same frame format and baud rate, communication can be completed using just two signal lines (Rx and Tx) without sharing a clock signal, hence it is also called asynchronous serial communication.

Differences Between RS-232, RS-422, and RS-485

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

Differences Between RS-232, RS-422, and RS-485

UART utilizes asynchronous serial communication.

Serial communication refers to the sequential transmission of data one bit at a time over a single transmission line. Its characteristics include a simple communication line, which can be implemented with simple cabling, reducing costs, and is suitable for long-distance communication but is slower in transmission speed.

Asynchronous communication uses a character as the unit of transmission, and the time interval between two characters is variable; however, the time interval between two adjacent bits within the same character is fixed.

The data transmission rate is represented by baud rate, which indicates the number of binary bits transmitted per second. For example, if the data transmission 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), then the baud rate is 10 × 120 = 1200 characters/second = 1200 baud.

The data communication format is shown in the figure below:

Differences Between RS-232, RS-422, and RS-485

The meanings of each bit are as follows:

Start bit: A logical “0” signal is sent first 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). Low-end transmission 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: This is a character data end marker. It can be 1, 1.5, or 2 bits of high level. Idle bit: It is in a logical “1” state, indicating that there is 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 realize self-synchronization of the clocks of the sender and receiver).

Differences Between 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 the 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 the data should be handled. 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 are physical layer aspects of network protocols).

This standard specifies the use of a 25-pin DB-25 connector, with regulations on the signal content for each pin of the connector, along with specifications for various signal levels. Later, IBM simplified RS-232 to a DB-9 connector, which has become the de facto standard today. Industrial control RS-232 ports usually only use three lines: RXD (2), TXD (3), and GND (5).

Differences Between RS-232, RS-422, and RS-485

In the early days, since PCs were equipped with RS-232 interfaces, whenever we needed to use UART, we chose RS-232. However, now personal computers, including laptops and desktops, no longer have RS-232 interfaces; everyone notices that there are no DB9 connectors on computer motherboards. Therefore, development boards now typically choose TTL UART or directly implement UART to USB on the development board.

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 form (hardware), while TTL and RS-232 refer to the level standards (electrical signals).

UART has 4 pins (VCC, GND, RX, TX), using TTL levels, where a low level is 0 (0V) and a high level is 1 (3.3V or above).

Differences Between 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 implement networking functionality. Therefore, to solve this problem, a new standard, RS-485, was developed. RS-485 uses differential transmission for data signals, also known as balanced transmission, employing a pair of twisted wires, with one wire defined as A and the other as B.

Typically, the positive level between the sending driver A and B is +2 to +6V, representing one logical state, and the negative level is -2 to -6V, representing another logical state. There is also a signal ground C, and RS-485 includes an “enable” terminal that may or may not be used 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. Because RS-422 separates sending and receiving, it can transmit and receive simultaneously (full duplex). This full duplex requirement for separate channels means RS-422 is suitable for communication between two stations, star networks, and ring networks but cannot be used for bus networks; RS-485, with only 2 signal lines, can only operate in half-duplex mode and is commonly used in bus networks.

Differences Between RS-232, RS-422, and RS-485

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

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

3. The RS-485 interface uses a combination of balanced drivers and differential receivers, enhancing its ability to resist common-mode interference, meaning it has good noise immunity.

4. The maximum communication distance of RS-485 is approximately 1219M, with the 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, but with special 485 chips, it can reach 128 or 256 nodes, and up to 400 nodes at most.

Due to the early emergence of the RS-232 interface standard, it inevitably has some shortcomings, mainly including the following points:

(1) The signal level of the interface is relatively high, which can easily damage the interface circuit chip. Additionally, since the 232 level is not compatible with TTL levels, a level conversion circuit is needed to connect with TTL circuits;

(2) The transmission rate is relatively low, with a baud rate of 20Kbps during asynchronous transmission. Nowadays, new UART chips have been adopted, reaching baud rates of 115.2Kbps (1.832M/16);

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

(4) The transmission distance is limited, with the maximum standard transmission distance being 50 meters, but in practice, it can only be used at around 15 meters;

(5) RS-232 only allows for one-to-one communication, without considering the formation of a serial bus. (This is very important; in many control scenarios, it is one control to many. If the main device needs to communicate point-to-point with each slave device, the field wiring becomes a spider web.)

Differences Between RS-232, RS-422, and RS-485

Unbalanced serial communication interfaces RS-423, RS-449

Differences Between RS-232, RS-422, and RS-485Differences Between RS-232, RS-422, and RS-485

Balanced serial communication interface RS-422

RS-422 (EIA RS-422-A Standard) is the serial 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, and compared to RS-232, it has better noise immunity and longer transmission distances. In industrial environments, better noise resistance and longer transmission distances are significant advantages.

Differences Between RS-232, RS-422, and RS-485Differences Between RS-232, RS-422, and RS-485Differences Between RS-232, RS-422, and RS-485Differences Between RS-232, RS-422, and RS-485

4. Comparison Between RS-232 and RS-485

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

2. Transmission distance: The maximum standard transmission distance for RS-485 is 1200 meters (at 9600bps), while in practice, it can reach 3000 meters. RS-232 has a limited transmission distance, with a maximum standard transmission distance of 50 meters, but in practice, it can only be used at around 15 meters.

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

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

5. Signal lines: RS-485 interfaces generally only require two signal lines to form a half-duplex network, while RS-232 typically uses three lines: RXD, TXD, and GND.

6. Electrical level values: In RS-485, a logic “1” is represented by a voltage difference of + (2-6)V between the two wires; a logic “0” is represented by a voltage difference of – (2-6)V. In RS-232-C, the voltage of any signal line is in a negative logic relationship, that is: logic “1” is -5 to -15V; logic “0” is +5 to +15V.

5. Comparison Between 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 sending and receiving, it can transmit and receive simultaneously (full duplex).

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

The RS-485 standard uses balanced transmission and differential reception to drive the bus, with specific specifications required:

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 a configuration of 120Ω termination resistance, the driver should still output at least 1.5V (the size of the termination resistance depends on the parameters of the twisted pair used).

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

Differences Between RS-232, RS-422, and RS-485

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

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

(2) The maximum data transmission rate of RS-485 is 10Mbps. However, since RS-485 often needs to communicate with the RS-232 port of a PC, the actual maximum is generally 115.2Kbps. Higher 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, providing good resistance to noise interference;

(4) The maximum transmission distance of the RS-485 interface is 1200 meters (at 9600bps), but in practice, it can reach 3000 meters. The RS-485 interface allows for the connection of up to 128 transceivers on the bus, enabling users to conveniently establish a network using a single RS-485 interface. Since RS-485 interfaces form half-duplex networks, they generally only require two signal lines, so RS-485 interfaces typically use twisted pair transmission. The international standard for RS-485 does not specify a standard for the connector, so terminal blocks or DB-9, DB-25 connectors can be used.

When using the RS-485 interface, the maximum cable length allowed for data signal transmission from the generator to the load is a function of the signal rate, which is mainly limited by signal distortion and noise. The maximum cable length and signal rate relationship curve is obtained using 24AWG copper core twisted telephone cable (with a diameter of 0.51mm), with inter-wire 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 the maximum allowable signal loss is 6dBV, the cable length is limited to 1200m. In practice, it is entirely possible to achieve greater cable lengths than this. When using cables of different diameters, 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 (with a diameter of 0.91mm), the cable length can exceed 200m; if using 28AWG cable (with a diameter of 0.32mm), the cable length can only be less than 200m.

For long-distance communication with RS-485, it is recommended to use shielded cables and connect the shield layer to the ground.

6. Three Factors Affecting RS-485 Bus Communication Speed and Reliability

1. Signal Reflections in Communication Cables

During communication, two signal factors cause signal reflections: impedance discontinuity and impedance mismatch.

Impedance discontinuity occurs when the signal encounters a very low or even no impedance at the end of the transmission line, causing the signal to reflect at that point, as illustrated. This principle of signal reflection is similar to light reflecting when entering a different medium. To eliminate such reflections, a termination resistor that matches the characteristic impedance of the cable must be connected at the end of the cable to ensure impedance continuity. Since signals are transmitted bidirectionally on the cable, a matching termination resistor can also be connected at the other end of the communication cable.

Differences Between RS-232, RS-422, and RS-485

Theoretically, as long as a termination resistor matching the cable’s characteristic impedance is connected at the end of the transmission cable, signal reflection should no longer occur. However, in practical applications, since the characteristic impedance of the transmission cable may not exactly match the termination resistor due to communication baud rates and other application environments, some degree of signal reflection may still occur.

Another cause of signal reflection is the impedance mismatch between the data transceiver and the transmission cable. This type of reflection is primarily observed when the communication line is idle, leading to data confusion on the entire network.

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

In signal analysis, the parameter used to measure the intensity of reflected signals is the 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.

The specific measurement method is illustrated in the figure. For example, if the peak-to-peak value of the incident sine wave signal at 2.5MHz is +5V, and the peak-to-peak value of the reflected signal is +0.297V, then 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 Between RS-232, RS-422, and RS-485

To reduce the impact of reflected signals on communication lines, noise suppression and bias resistor methods are typically employed. In practical applications, for relatively small reflection signals, the bias resistor method is often used for convenience. The principle of how to improve communication reliability by adding bias resistors in communication lines is as follows.

2. Signal Attenuation in Communication Cables

The second factor affecting signal transmission is signal attenuation during transmission through the cable. A transmission cable can be viewed as an equivalent circuit composed of distributed capacitance, distributed inductance, and resistance, as illustrated.

Differences Between 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 resistance of the conductors has a negligible effect on the signal and can be ignored. Signal loss is primarily due to the LC low-pass filter formed by the distributed capacitance and distributed inductance of the cable. The attenuation coefficients of the LAN standard two-core cables used by PROFIBUS (the standard cable selected by Siemens for the DP bus) at different baud rates are shown in Table 1.

Attenuation Coefficient of the CableDifferences Between RS-232, RS-422, and RS-485

3. Pure Resistive Load in Communication Cables

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

Differences Between RS-232, RS-422, and RS-485

When describing the EIA RS-485 specification, it was mentioned that the RS-485 driver can output at least 1.5V of differential voltage when 32 nodes are connected and a 150Ω termination resistor is configured. The input resistance of one receiver is 12kΩ, and the equivalent circuit of the entire network is illustrated. 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 RS-485 drivers 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 a maximum number of nodes far exceeding 32.

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

Differences Between RS-232, RS-422, and RS-485

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

Termination resistor 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 due to the reflected signal on the termination resistor ≤0.15/(120||120)=2.5mA. The hysteresis value of a typical RS-485 transceiver (including SN75176) is 50mV, that is:

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

Thus, the bias current generated by the bias resistor Ibias≥3.33mA

+5V=Ibias(Rpull-up+Rpull-down+(Rt1||Rt2)) (2)

Using equation (2), it can be calculated that Rpull-up=Rpull-down=720Ω

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

(1) Distributing bias resistors evenly across each transceiver on the bus. This method adds a bias resistor 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 effective for large reflected signals or interference signals present on the bus. It is worth noting that adding bias resistors increases the load on the bus.

7. The Relationship Between the Load Capacity of the RS-485 Bus and the Length of Communication Cables

When designing the network configuration of the RS-485 bus (bus length and number of loads), three parameters should be considered: pure resistive load, signal attenuation, and noise margin. The pure resistive load and signal attenuation have been discussed earlier; now we will discuss noise margin. The noise margin of the RS-485 bus receiver 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 capabilities, it is always desired that the system’s noise margin is better than that specified in the EIA RS-485 standard. The relationship between the number of loads on the bus and the length of communication cables is shown in the following formula:

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

Where: Vend is the signal voltage at the end of the bus, which is specified as 0.2V during standard measurements; Vdriver is the output voltage of the driver (which depends on the number of loads. For 5 to 35 loads, Vdriver=2.4V; for fewer than 5 loads, Vdriver=2.5V; for more than 35 loads, Vdriver≤2.3V); Vloss is the loss of signal during transmission in the bus (which is related to the specifications and length of the communication cable), calculated using the standard cable’s attenuation coefficient provided in Table 1, where the attenuation coefficient b=20lg(Vout/Vin), which can calculate Vloss=Vin-Vout=0.6V (note: if the communication baud rate increases, Vloss will correspondingly increase); Vnoise is the noise margin, specified as 0.1V during standard measurements; Vbias is the bias voltage provided by the bias resistor (typical value is 0.4V).

Equation (3) multiplies by 0.8 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, while the size of Vloss is inversely proportional to the length of the bus; the other parameters depend only on the type of driver used. Therefore, once the RS-495 driver is selected, the relationship between the number of loads and the maximum distance the signal can transmit is directly related. Specifically, within the allowable range of the bus, the more loads are connected, the shorter the signal can be transmitted; conversely, fewer loads allow for longer transmission distances.

8. The Impact of Distributed Capacitance on RS-485 Bus Transmission Performance

The distributed capacitance of the cable is primarily generated by the two parallel conductors of the twisted pair. Additionally, there is also distributed capacitance between the conductors and ground, though small, it should not be ignored in analysis. The impact of distributed capacitance on bus transmission performance mainly arises because the signals transmitted on the bus are baseband signals, expressed only as “1” and “0”. In specific 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 may not discharge in time, leading to (Vin+) – (Vin-) still being greater than 200mV, resulting in the receiver mistakenly interpreting it as “0”, ultimately causing CRC check errors and errors in the entire data frame transmission. The specific process is illustrated.

Differences Between RS-232, RS-422, and RS-485

Due to the effects of distribution on the bus, data transmission errors can occur, leading to reduced overall network performance. Two methods can solve this problem:

(1) Reducing the baud rate of data transmission;

(2) Using cables with lower distributed capacitance to improve the quality of transmission lines.

Simply connecting the A and B ends of each interface using a pair of twisted wires without grounding the signal of the RS-485 communication link can work in certain cases, but it poses risks to the system. The RS-485 interface transmits signals using a differential method, which 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 can only operate normally when the common-mode voltage does not exceed a certain range (-7V to +12V). When the common-mode voltage exceeds this range, it can disrupt communication reliability or even damage the interface. As illustrated, when transmitter A sends data to receiver B, the common-mode voltage output VOS of transmitter A, due to the independent grounding systems of both systems, results in a ground potential difference VGPD, causing the common-mode voltage at the receiver’s input to reach VCM=VOS+VGPD. The RS-485 standard specifies VOS≤3V, but VGPD could be significantly large (tens of volts), possibly accompanied by strong interference signals, causing the receiver’s common-mode input VCM to exceed the normal range, generating interference currents on the signal line, disrupting normal communication, or damaging the device.

Conclusion:

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

Leave a Comment