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

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

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

Serial communication is one of the most basic communication methods faced by electronic engineers, and RS-232 is the simplest among them. However, many beginners often cannot clearly understand the relationship and differences between UART and RS-232, RS-422, and RS-485. This article will discuss these concepts to help clarify their relationships.

Communication issues, like traffic problems, can have various situations such as high speed, low speed, congestion, and interruption. If we compare serial communication to traffic, UART can be likened to a station, while a frame of data is like a car. Cars must obey traffic rules while on the road. In urban areas, the speed limit is generally 30 or 40, while on highways, it can reach 120. The speed limit and the path taken by the car depend on the protocol specifications. Common serial 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 is the Universal Asynchronous Receiver/Transmitter, commonly referred to as UART. It 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, communication can be completed using only two signal lines (Rx and Tx) without sharing a clock signal, thus it is also called asynchronous serial communication.

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

If an appropriate level converter, such as SP3232E or SP3485, is added, UART can also be used for RS-232 or RS-485 communication, or to connect 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 uses asynchronous serial communication.

Serial communication refers to the sequential transmission of data one bit at a time over a single transmission line. The characteristics include a simple communication line that can be implemented with simple cabling, reducing costs, and is suitable for long-distance communication, though it is slow.

Asynchronous communication uses a character as the transmission unit, and the time interval between two characters is not fixed, but the time interval between adjacent bits within the same character is fixed.

The data transmission rate is expressed in baud rate, which is 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 would be 10×120=1200 characters per second=1200 baud.

The data communication format is as follows:

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, indicating 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: This bit is added to make the number of “1” bits even (even parity) or odd (odd parity). Stop bit: It is a character data end flag and can be 1, 1.5, or 2 bits of high level. Idle bit: It is in 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 can stay synchronized with the sending device within the transmission time of a character after receiving the start signal. The arrival of the next character’s start bit recalibrates the synchronization (achieved by detecting the start bit to realize the 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 stands for “Recommended Standard,” and 232 is the identification number. RS-232 specifies the electrical and physical characteristics that apply only to the data transmission path and does not include the data processing methods. 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 at the physical layer of network protocols).

This standard specifies the use of a 25-pin DB-25 connector, defining the signal content for each pin, and also specifies the voltage levels for various signals. Later, IBM simplified RS-232 to a DB-9 connector for its PC, which became the de facto standard today. The RS-232 port used in industrial control generally only uses three lines: RXD (2), TXD (3), and GND (5).

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

In the early days, since PCs came with RS-232 interfaces, we chose RS-232 whenever we needed to use UART. However, today personal computers, including laptops and desktops, no longer come with RS-232 interfaces, and you may not see 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 and the relationships with RS-232, TTL, etc. In fact, UART and COM refer to the physical interface form (hardware), while TTL and RS-232 refer to the voltage standards (electrical signals).

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

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

3. RS-485/RS-422 Standards
While the RS-232 interface can achieve point-to-point communication, it does not support networking capabilities. To address this issue, a new standard, RS-485, was developed. The RS-485 data signal uses differential transmission, also known as balanced transmission, utilizing a pair of twisted wires, with one wire defined as A and the other as B.

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

The electrical performance of RS-422 is identical to that of RS-485. The main difference lies in that RS-422 has 4 signal lines: two for transmission and two for reception. Since RS-422 separates receiving and transmitting, it can send and receive simultaneously (full-duplex). Because full-duplex requires separate channels for sending and receiving, RS-422 is suitable for communication between two stations, star networks, and ring networks, but cannot be used in bus networks; RS-485 has only 2 signal lines, so it can only operate in half-duplex mode, commonly used in bus networks.

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

The electrical characteristics of RS-485 indicate that a logical “1” is represented by a voltage difference of +(2~6)V between the two wires, while a logical “0” is represented by a voltage difference of -(2~6)V. The signal voltage levels of RS-485 are lower than those of RS-232-C, making it less likely to damage the interface circuit chips, and this level is compatible with TTL levels, making it convenient to connect with TTL circuits.

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

The RS-485 interface employs a combination of balanced drivers and differential receivers, enhancing immunity to common-mode interference, i.e., good noise resistance.

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 should be added. The RS-485 bus generally supports a maximum of 32 nodes, and if special 485 chips are used, it can reach 128 or 256 nodes, with a maximum of 400 nodes supported.

1. RS-423 Unbalanced Serial Communication Interface

Structure, signal levels, transmission distance, transmission rate, interface chips

2. RS-422 Balanced Serial Communication Interface

Structure, signal levels, interface chips, MC3486, MC3487, SN75154, SN75155

Transmission rate, transmission distance

3. RS-485 Serial Communication Bus

Structure, signal levels, interface chip MAX485

Transmission rate, transmission distance, application examples

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

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

(2) The transmission rate is relatively low; in asynchronous transmission, the baud rate is 20Kbps. Now, with the adoption of 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 to form a common-ground transmission method, which is prone to common-mode interference, thus having weak noise immunity;

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

(5) RS-232 only allows one-to-one communication and does not consider forming a serial bus. (This is very important; in many control scenarios, it is one control to many, and if the master device needs to communicate point-to-point with the slave devices, the site wiring would become a spider web).

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

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

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

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 resistance and longer transmission distances. In industrial environments, better noise immunity and longer transmission distances are significant advantages.

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

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

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

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

4. Comparison of RS-232 and RS-485

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

2. Transmission distance: The maximum transmission distance for the RS-485 interface is 1200 meters (at 9600bps), practically reaching 3000 meters. RS-232 has limited transmission distance, with a maximum standard value of 50 meters, but it can only be used effectively 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 easily establish a device network using a single RS-485 interface. RS-232 only permits point-to-point 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 for RS-485 is 10Mbps.

5. Signal lines: A half-duplex network formed by the RS-485 interface generally requires only two signal lines. The RS-232 port typically uses RXD, TXD, and GND lines.

6. Electrical voltage levels: RS-485 represents logical “1” with a voltage difference of + (2-6) V between the two wires; logical “0” with a voltage difference of – (2-6) V. In RS-232-C, the voltage on any signal line is in a negative logical relationship: logical “1” is -5 to -15V, and logical “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 transmission (Y, Z) and two for reception (A, B). Since RS-422 separates receiving and transmitting, it can send and receive simultaneously (full-duplex).

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

The RS-485 standard employs balanced sending and differential receiving data transceivers to drive the bus, with specific specifications:

The receiver’s input resistance RIN ≥ 12kΩ.

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

The input capacitance ≤ 50pF.

With 32 nodes and a 120Ω termination resistor, the driver can still output a voltage of at least 1.5V (the size of the termination resistor depends on the parameters of the twisted pair used).

The receiver’s input sensitivity is 200mV (i.e., (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 long distance, multi-node (32 nodes), and low cost of transmission lines, 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 logical “0” with a voltage difference of + (2 ~6)V between the two wires; logical “1” with a voltage difference of – (2 ~6)V. At the receiving end, if A is more than 200mV higher than B, it is considered logical “0”; if A is more than 200mV lower than B, it is considered logical “1”.

(2) The maximum data transmission rate for 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. Because higher speeds will reduce the transmission distance of RS-485, 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 for the RS-485 interface is 1200 meters (at 9600bps), practically reaching 3000 meters. The RS-485 interface allows for the connection of up to 128 transceivers on the bus, enabling users to establish networks easily with a single RS-485 interface. Since the RS-485 interface forms a half-duplex network, it generally requires only two signal lines, and RS-485 interfaces are usually transmitted using twisted pairs. The international standard for RS-485 does not specify a standard connector for RS-485 interfaces, so terminal blocks or DB-9, DB-25 connectors can be used.

When using RS-485 interfaces, the maximum allowable cable length for data signal transmission from the generator to the load depends on the specific transmission line diameter and is a function of signal distortion and noise. The maximum cable length and signal speed relationship curve is derived using a 24AWG copper core twisted telephone cable (with a diameter of 0.51mm), a line-to-line bypass capacitance of 52.5PF/M, and a terminal load resistance of 100Ω (from GB11014-89 Appendix A). When the data signal speed 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 cable lengths greater than this. When using cables of different diameters, the maximum cable length will vary. For example, when the data signal speed 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 be greater than 200m; if using 28AWG cable (with a diameter of 0.32mm), the cable length can only be less than 200m.

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

6. Three Factors Affecting RS-485 Bus Communication Speed and Reliability
1. Signal Reflection in Communication Cables

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

Impedance discontinuity occurs when the signal suddenly encounters a very low or no impedance at the end of the transmission line, causing reflection at that point, similar to how light reflects when entering another medium. To eliminate this reflection, a termination resistor matching the cable’s characteristic impedance must be connected at the end of the cable, ensuring impedance continuity. Since signals on the cable are transmitted bidirectionally, a termination resistor of the same size can also be connected to the other end of the communication cable.

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

Theoretically, if 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, due to the relationship between the transmission cable’s characteristic impedance and the communication baud rate, the characteristic impedance cannot be completely equal to the termination resistance, so some degree of 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 confusion in the entire network data.

Signal reflection affects data transmission because the reflected signal triggers the comparator at the receiver’s input, causing the receiver to receive incorrect signals, leading to CRC errors or errors in the entire data frame.

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 is the voltage level of the reflected signal; Vinc is the voltage level of the incident signal at the connection point between the cable and the transceiver or termination resistance.

The specific measurement method is 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, then at a communication rate of 2.5MHz, the reflection attenuation factor of this communication cable 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 adding bias resistors are commonly used methods. In practical applications, for relatively small reflected 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.

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.

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 minimal effect on the signal and can be ignored. Signal loss primarily results from the LC low-pass filter created by the distributed capacitance and inductance of the cable. The attenuation coefficients of the LAN standard type two-core cable used in PROFIBUS (the standard cable selected by Siemens for the DP bus) at different baud rates are shown in the table.

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

The attenuation coefficients of the cable

3. Pure Resistive Load in Communication Cables

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

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

When discussing the EIA RS-485 specification, it was mentioned that the RS-485 driver can output a differential voltage of at least 1.5V when carrying 32 nodes and configured with a 150Ω termination resistor. The input resistance of a receiver is 12kΩ, and the entire network’s equivalent circuit is shown in the figure. Based on 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Ω

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

When the communication baud rate is relatively high, it is necessary to use bias resistors on the line. The connection method of bias resistors is shown in the figure. Their function is to pull the voltage on the bus away from 0 volts when there is no data (in idle mode), as shown in the figure. This way, even if smaller reflected signals or interference occur in the line, the data receivers connected to the bus will not malfunction due to these signals.

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

The following example can be used to calculate the size of the bias resistor:

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 resistor is ≤0.15/(120||120)=2.5mA. The typical hysteresis voltage value of common RS-485 transceivers (including SN75176) is 50mV, i.e.:

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

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

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

Through formula (2), we can calculate that Rpull-up=Rpull-down=720Ω

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

(1) Distributing the bias resistors evenly among each transceiver on the bus. This method adds bias resistors to each transceiver on 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 important to note that adding bias resistors increases the load on the bus.

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

When designing the network configuration composed of 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 previously; 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, it is always preferred that the system’s noise margin be 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 can be seen from 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. When the number of loads is between 5 and 35, Vdriver=2.4V; when the number of loads is less than 5, Vdriver=2.5V; when the number of loads exceeds 35, Vdriver≤2.3V); Vloss is the signal loss during transmission in the bus (which depends on the specifications and length of the communication cable), as provided by the standard cable’s attenuation coefficient, calculated using the formula b=20lg(Vout/Vin); Vloss can be calculated as Vin-Vout=0.6V (Note: When the communication baud rate is increased, Vloss will also increase); Vnoise is the noise margin, specified as 0.1V during standard measurements; Vbias is the bias voltage provided by the bias resistors (typical value is 0.4V).

The multiplication by 0.8 in formula (3) is to ensure that the communication cable does not enter a fully loaded state. From formula (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 on the type of driver used. Therefore, once the RS-495 driver is selected, under a constant communication baud rate, the number of loads on the bus is directly related to the maximum distance the signal can be transmitted. The specific relationship is: within the allowable range of the bus, the more loads there are, the shorter the signal can be transmitted; the fewer loads there are, the farther the signal can be transmitted.

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 distributed capacitance between the conductors and the 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, expressed only as “1” and “0”. In special bytes, for example, 0x01, the signal “0” allows enough time for the distributed capacitance to charge, while when the signal “1” arrives, the charge in the distributed capacitance does not discharge in time, resulting in (Vin+) – (Vin-) remaining greater than 200mV, causing the receiver to mistakenly interpret it as “0”, ultimately leading to CRC errors and errors in the entire data frame transmission. The specific process is illustrated in the figure.

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

Due to the distributed effects on the bus, data transmission errors occur, reducing the overall network performance. Two methods can be used to address this issue:

(1) Reduce the data transmission baud rate;

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

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 under certain conditions but poses potential risks to the system. The RS-485 interface transmits signals differentially and does not require a reference point to detect the signal system; it only needs to detect the potential difference between the two wires. However, it should be noted that the transceiver will only function properly if 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 and even damage the interface. For example, when transmitter A sends data to receiver B, the output common-mode voltage of transmitter A is VOS. Due to the existence of ground potential difference 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 significantly (dozens of volts), potentially accompanied by strong interference signals, causing the receiver’s common-mode input VCM to exceed the normal range, resulting in interference currents on the signal line that affect normal communication or damage the equipment.

9. Conclusion:

The serial port is a very versatile device interface, 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 for many engineers.

END

(来源:网络

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

Leave a Comment