Still don’t understand RS485? 18 questions and answers to thoroughly understand RS485

The half-duplex network composed of RS485 interface is generally a two-wire system, and mostly uses shielded twisted pair transmission. This wiring method is a bus topology structure and can connect up to 32 nodes on the same bus. We know that the initial data is a simple process quantity of analog signal output. Later, the instrument interface is an RS232 interface. This interface can realize point-to-point communication, but this method cannot realize the networking function. The subsequent RS485 solves this problem. For this reason, this article introduces the RS485 interface in detail in the form of question and answer.

The half-duplex network composed of RS485 interface is generally a two-wire system, and mostly uses shielded twisted pair transmission. This wiring method is a bus topology structure and can connect up to 32 nodes on the same bus. We know that the initial data is a simple process quantity of analog signal output. Later, the instrument interface is an RS232 interface. This interface can realize point-to-point communication, but this method cannot realize the networking function. The subsequent RS485 solves this problem. For this reason, this article introduces the RS485 interface in detail in the form of question and answer.

What is the RS-485 interface? Compared with the RS-232-C interface, what are the characteristics?

Answer: Since the RS-232-C interface standard appeared earlier, it is inevitable that there are deficiencies, mainly in the following four points:
(1) The signal level value of the interface is high, which is easy to damage the chip of the interface circuit, and because it is incompatible with the TTL level, a level conversion circuit is needed to connect with the TTL circuit.
(2) The transmission rate is low. In asynchronous transmission, the baud rate is 20Kbps.
(3) The interface uses a signal line and a signal return line to form a common ground transmission form. This common ground transmission is prone to common mode interference, so the anti-noise interference is weak.
(4) The transmission distance is limited. The standard value of the maximum transmission distance is 50 feet. In fact, it can only be used at about 50 meters. In view of the shortcomings of RS-232-C, some new interface standards continue to appear. RS-485 is one of them. It has the following characteristics:

Still don’t understand RS485? 18 questions and answers to thoroughly understand RS485

1) Electrical characteristics of RS-485: Logic “1” is represented by the voltage difference between the two wires as +(2-6)V; Logic “0” is represented by the voltage difference between the two wires as -(2-6)V . The interface signal level is lower than RS-232-C, it is not easy to damage the chip of the interface circuit, and the level is compatible with the TTL level, and it is convenient to connect with the TTL circuit.
2) The highest data transmission rate of RS-485 is 10Mbps
3) The RS-485 interface is a combination of balanced drivers and differential receivers, with enhanced anti-common-mode interference capability, that is, good anti-noise interference.
4) The standard value of the maximum transmission distance of the RS-485 interface is 4000 feet, which can actually reach 3000 meters. In addition, the RS-232-C interface allows only one transceiver to be connected on the bus, that is, single station capability. The RS-485 interface allows up to 128 transceivers to be connected on the bus. That is, it has multi-station capability, so that users can use a single RS-485 interface to easily establish a device network.
5) Because the RS-485 interface has good anti-noise interference, long transmission distance and multi-station capability, the above advantages make it the preferred serial interface. Because the half-duplex network composed of RS485 interface generally only needs two wires, the RS485 interface adopts shielded twisted pair transmission. The RS485 interface connector adopts a 9-pin plug socket of DB-9, the RS485 interface with the intelligent terminal adopts DB-9 (hole), and the keyboard interface RS485 connected with the keyboard adopts DB-9 (pin).

RS-422 and RS-485 serial interface standards
1. Balanced transmission

RS-422, RS-485 and RS-232 are different. The data signal adopts a differential transmission method, also called balanced transmission. It uses a pair of twisted pairs, one of which is defined as A and the other is defined as B
Normally, the positive level between the sending driver A and B is +2~+6V, which is a logic state, and the negative level is -2~6V, which is another logic state. There is another signal ground C, and there is an “enable” end in RS-485, which is available or not in RS-422. The “enable” terminal is used to control the disconnection and connection of the sending driver and the transmission line. When the “enable” terminal works, the sending driver is in a high-impedance state, called the “third state”, that is, it is the third state different from logic “1” and “0”.
The receiver also makes provisions relative to the sending end. The receiving and sending ends connect AA and BB through a balanced twisted pair. When there is a level greater than +200mV between the receiving end AB, the output is a positive logic level, which is less than -200mV When, output a negative logic level. The level range of the receiver’s receiving balance line is usually between 200mV and 6V.

2. RS-422 electrical regulations

The full name of the RS-422 standard is “Electrical Characteristics of Balanced Voltage Digital Interface Circuit”, which defines the characteristics of the interface circuit. Figure 2 is a typical RS-422 four-wire interface. There is actually a signal ground wire, a total of 5 wires. Figure 1 is its DB9 connector pin definition. Because the receiver adopts high input impedance and the transmission driver has stronger driving capability than RS232, it is allowed to connect multiple receiving nodes on the same transmission line, up to 10 nodes can be connected. That is, a master device (Master), and the rest are slave devices (Salve). The slave devices cannot communicate, so RS-422 supports point-to-many two-way communication. The receiver input impedance is 4k, so the maximum load capacity of the transmitter is 10×4k+100Ω (terminating resistance). The RS-422 four-wire interface adopts separate sending and receiving channels, so there is no need to control the data direction. Any necessary signal exchanges between devices can be done in software (XON/XOFF handshake) or hardware (a pair of separate double Stranded wire) to achieve. The maximum transmission distance of RS-422 is 4000 feet (about 1219 meters), and the maximum transmission rate is 10Mb/s. The length of the balanced twisted pair is inversely proportional to the transmission rate, and the maximum transmission distance is only possible when the rate is below 100kb/s. Only in a short distance can the highest rate of transmission be obtained. Generally, the maximum transmission rate that can be obtained on a 100-meter-long twisted pair cable is only 1Mb/s.

RS-422 requires a terminating resistor, and its resistance is required to be approximately equal to the characteristic impedance of the transmission cable. There is no need for terminating resistors during moment distance transmission, that is, no terminating resistors are generally required for distances below 300 meters. The terminating resistor is connected to the far end of the transmission cable.

3. RS-485 electrical regulations

Since RS-485 is developed on the basis of RS-422, many electrical regulations of RS-485 are similar to RS-422. If all adopt the balanced transmission mode, all need to connect the terminating resistance on the transmission line, etc. RS-485 can adopt two-wire and four-wire mode, and the two-wire system can realize true multi-point two-way communication.

When using four-wire connection, it can only achieve point-to-many communication like RS-422, that is, there can only be one master (Master) device, and the rest are slave devices, but it is an improvement over RS-422, regardless of whether it is four-wire or Up to 32 devices can be connected to the two-wire connection bus.

The difference between RS-485 and RS-422 is that its common-mode output voltage is different. RS-485 is between -7V and +12V, while RS-422 is between -7V and +7V. RS-485 receiver The minimum input impedance is 12k, and S-422 is 4k; S-485 meets all RS-422 specifications, so RS-485 drivers can be used in RS-422 network applications.

RS-485 is the same as RS-422, its maximum transmission distance is about 1219 meters, and the maximum transmission rate is 10Mb/s. The length of the balanced twisted pair is inversely proportional to the transmission rate. Only when the rate is below 100kb/s can the longest cable length be used. Only in a short distance can the highest rate of transmission be obtained. Generally, the maximum transmission rate of a 100-meter-long twisted pair is only 1Mb/s.

RS-485 requires 2 termination resistors, the resistance of which is required to be equal to the characteristic impedance of the transmission cable. There is no need for terminating resistors during moment distance transmission, that is, no terminating resistors are generally required for distances below 300 meters. The terminating resistor is connected to both ends of the transmission bus.

Points for Attention in Network Installation of RS-422 and RS-485

RS-422 can support 10 nodes, RS-485 supports 32 nodes, so multiple nodes form a network. The network topology generally adopts a terminal-matched bus-type structure, and does not support ring or star networks. When building a network, you should pay attention to the following points:

Still don’t understand RS485? 18 questions and answers to thoroughly understand RS485

1. Use a twisted pair cable as the bus to connect each node in series. The length of the lead wire from the bus to each node should be as short as possible to minimize the influence of the reflected signal in the lead wire on the bus signal. Shown are some common wrong connection methods (a, c, e) and correct connection methods (b, d, f) in practical applications. Although the three network connections of a, c, and e are incorrect, they may still work normally at short distances and at low speeds. However, as the communication distance increases or the communication speed increases, their adverse effects will become more and more serious. The main reason is The signal is superimposed with the original signal after being reflected at the end of each branch, which will cause the signal quality to decrease.

2. Pay attention to the continuity of the characteristic impedance of the bus. Signal reflections will occur at the point where the impedance is discontinuous. The following situations are prone to this discontinuity: different sections of the bus use different cables, or there are too many transceivers installed close to each other on a certain section of the bus, and the excessively long branch line leads to the bus.

In short, a single, continuous signal channel should be provided as a bus.

Some explanations on the matching of RS-422 and RS-485 transmission lines

For RS-422 and RS-485 bus networks, termination resistors are generally used for matching. However, it is not necessary to consider terminal matching at short distances and low speeds. So under what circumstances should you not consider matching? Theoretically, when sampling at the midpoint of each received data signal, as long as the reflected signal attenuates sufficiently low at the beginning of sampling, matching can be ignored. But this is difficult to grasp in practice. An article from MAXIM in the United States mentioned an empirical principle that can be used to determine what data rate and cable length need to be matched: when the signal transition time (rise or fall time) When it exceeds 3 times the time required for the one-way transmission of the electrical signal along the bus, no matching can be added. For example, the RS-485 interface MAX483 output signal with limited slope characteristics has a minimum rise or fall time of 250ns, and the signal transmission rate on a typical twisted pair is about 0.2m/ns (24AWGPVC cable), so as long as the data rate is 250kb/s If the cable length is not more than 16 meters, and the MAX483 is used as the RS-485 interface, it can be matched without a terminal.

Generally, termination resistors are used for terminal matching. As mentioned earlier, RS-422 should be connected in parallel at the far end of the bus cable, while RS-485 should be connected in parallel at the beginning and end of the bus cable. The terminating resistance is generally 100Ω in the RS-422 network and 120Ω in the RS-485 network. The resistance equivalent to the characteristic impedance of the cable, because the characteristic impedance of most twisted-pair cables is about 100-120Ω. This kind of matching method is simple and effective, but it has a shortcoming. The matching resistor consumes a lot of power, which is not suitable for systems with stricter power consumption restrictions.

Another power-saving matching method is RC matching. Using a capacitor C to block the DC component can save most of the power. However, the value of the capacitor C is a difficult point, and a compromise must be made between power consumption and matching quality.

There is also a matching method using diodes. Although this scheme does not achieve true “matching”, it uses the clamping effect of diodes to quickly weaken the reflected signal and achieve the purpose of improving signal quality. The energy saving effect is remarkable.

RS-422 and RS-485 grounding problem

Electronic system grounding is very important, but it is often overlooked. Improper grounding treatment will often cause the electronic system to not work stably and even endanger the safety of the system. The grounding of RS-422 and RS-485 transmission networks is also very important, because the unreasonable grounding system will affect the stability of the entire network, especially when the working environment is harsh and the transmission distance is long, the grounding requirements are More stringent. Otherwise, the interface damage rate is high. In many cases, when connecting RS-422 and RS-485 communication links, simply use a pair of twisted pairs to connect the “A” and “B” ends of each interface. The signal ground connection is ignored. This connection method works normally in many occasions, but it lays down a lot of hidden dangers. There are two reasons for this:

1. Common mode interference problem: As mentioned above, both RS-422 and RS-485 interfaces adopt differential signal transmission mode, and there is no need to detect the signal relative to a certain reference point. The system only needs to detect the signal between the two wires. The potential difference is fine. However, people often overlook that transceivers have a certain common-mode voltage range. For example, the common-mode voltage range of RS-422 is -7~+7V, while the common-mode voltage range of RS-485 transceiver is -7~+12V. Conditions, the entire network can work normally. When the common mode voltage in the network line exceeds this range, it will affect the stability and reliability of the communication, and even damage the interface. Taking Figure 1 as an example, when sending driver A sends data to receiver B, the output common-mode voltage of sending driver A is VOS. Since the two systems have their own independent grounding systems, there is a ground potential difference VGPD. Then, the common mode voltage VCM at the input of the receiver will reach VCM=VOS+VGPD. Both RS-422 and RS-485 standards stipulate that VOS≤3V, but VGPD may have a large amplitude (ten volts or even tens of volts), and may be accompanied by strong interference signals, causing the common mode input VCM of the receiver to exceed the normal range , And produce interference current on the transmission line, which affects normal communication at a slight degree, and damages the communication interface circuit.

2. (EMI) problem: The common mode part of the output signal of the sending driver needs a return path. If there is no return channel (signal ground) with low resistance, it will return to the source end in the form of radiation, and the entire bus will be like one The huge antenna radiates electromagnetic waves outward.

For the above reasons, although RS-422 and RS-485 use differential balanced transmission, there must be a low-impedance signal ground for the entire RS-422 or RS-485 network. A low-resistance signal ground connects the working grounds of the two interfaces, so that the common-mode interference voltage VGPD is short-circuited.

This signal ground can be an extra wire (unshielded twisted pair) or the shielding layer of a shielded twisted pair. This is the most common grounding method.

It is worth noting that this approach is only effective for high-impedance common-mode interference. Due to the large internal resistance of the interference source, a large ground loop current will not be formed after short-circuiting, and it will not have a great impact on communication. When the internal resistance of the common mode interference source is low, a larger loop current will be formed on the ground wire, which will affect the normal communication. The author believes that the following three measures can be taken:

(1) If the internal resistance of the interference source is not very small, a current-limiting resistor can be added to the ground wire to limit the interference current. The increase in grounding resistance may increase the common-mode voltage, but it will not affect normal communication as long as it is controlled within an appropriate range.
(2) Use floating technology to isolate the ground loop. This is a more commonly used and very effective method. When the internal resistance of common mode interference is very small, the above method is no longer effective. At this time, you can consider floating the node that introduces interference (such as field equipment in a harsh working environment) ( That is, the circuit ground of the system is isolated from the chassis or the ground), so that the ground loop is cut off and a large loop current is not formed.
(3) Use isolation interface. In some cases, for safety or other considerations, the circuit ground must be connected to the chassis or the ground and cannot be suspended. In this case, an isolation interface can be used to isolate the ground loop, but there should still be a ground wire to connect the common terminal of the isolation side. Connect to the working ground of other interfaces.

RS-422 and RS-485 network failure protection

Both RS-422 and RS-485 standards stipulate that the receiver threshold is ±200mV. This stipulation can provide a relatively high noise suppression capability. As mentioned above, when the receiver A level is more than +200mV higher than the B level, the output is positive logic, otherwise, the output is negative logic. But due to the existence of the third state, that is, after the host sends a message data at the sender, the bus is placed in the third state, that is, there is no signal to drive the bus when the bus is idle, so that the voltage between AB is -200~+200mV Until it tends to 0V, this brings about a problem: the receiver output state is uncertain. If the output of the receiver is 0V, the slave in the network will interpret it as a new start bit and try to read the subsequent bytes. Since there will never be a stop bit, a framing error result is generated and there is no more device request The bus, the network is in a state of paralysis. In addition to the above-mentioned situation that the bus idle will cause the voltage difference between the two wires to be less than 200mV, this situation can also occur during an open circuit or a short circuit. Therefore, certain measures should be taken to prevent the receiver from being in an uncertain state.

Usually a bias is added to the bus. When the bus is idle or open, the bus is biased in a certain state (differential voltage ≥ -200mV) by using a bias resistor. Figure 1. Pull up A to the ground and pull B to 5V. The typical value of the resistance is 1kΩ. The specific value varies with the capacitance of the cable.

The above method is a more classic method, but it still cannot solve the problem when the bus is short-circuited. Some manufacturers move the receiving threshold to -200mV/-50mV to solve this problem.

RS-422 and RS-485 transient protection

The signal grounding measures mentioned above can only protect against low-frequency common-mode interference, and cannot do anything against high-frequency transient interference. Since the transmission line is equivalent to inductance for high-frequency signals, for high-frequency transient interference, the grounding line is actually equivalent to an open circuit. Although such a transient disturbance lasts for a short time, it may have a voltage of hundreds of thousands of volts.

In the actual application environment, there is still the possibility of high-frequency transient interference. Generally, high-amplitude transient interference will be generated during the process of switching high-power inductive loads such as motors, transformers, relays, etc. or lightning. If not properly protected, the RS-422 or RS-485 communication interface will be damaged. For this kind of transient interference, isolation or bypass can be used to protect it.

1. Isolation protection method. This solution actually transfers the transient high voltage to the electrical isolation layer in the isolation interface. Due to the high insulation resistance of the isolation layer, damaging surge currents will not be generated and play a role in protecting the interface. Usually high-frequency transformers, optocouplers and other components are used to achieve electrical isolation of the interface. The existing device manufacturers have integrated all these components into a single IC, which is very easy to use. The advantage of this scheme is that it can withstand high-voltage, long-lasting transient interference, and it is relatively easy to implement. The disadvantage is that the cost is relatively high.

2. Bypass protection method. This solution uses transient suppression components (such as TVS, MOV, gas discharge tube, etc.) to bypass hazardous transient energy to the ground. The advantage is that the cost is lower, but the disadvantage is that the protection capability is limited, and it can only protect the energy within a certain amount of energy. Transient interference cannot last for a long time, and it needs a good channel to connect to the earth, which is difficult to realize. In actual application, the above two schemes are combined and used flexibly, as shown in Figure 1. In this method, the isolation interface isolates large-scale transient interference, and the bypass component protects the isolation interface from breakdown by excessively high transient voltage.

When using the RS485 interface, how to consider the length of the transmission cable?

When using the RS485 interface, for a specific transmission line diameter, the maximum cable length allowed for data signal transmission from the generator to the load is a function of the data signal rate. This length data is mainly limited by the influence of signal distortion and noise. The relationship curve between the maximum cable length and the signal rate is obtained when 24AWG copper core twisted-pair telephone cable (wire diameter is 0.511mm), the bypass capacitor between the lines is 52.5PF/M, and the terminal load resistance is 100 ohms. 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 practical use, it is possible to obtain a larger cable length. When using cables with different wire diameters. The maximum cable length obtained is not the same.

How to realize RS-485/422 multi-point communication

Only one transmitter can transmit on the RS-485 bus at any time. In half-duplex mode, only one master and slave can send. In full duplex mode, the master station can always send, and the slave station can only send one.

When communicating with RS-485/RS422 interface, under what conditions do I need to use terminal matching? How to determine the resistance value? How to configure terminal matching resistance?

In long-line signal transmission, generally in order to avoid signal reflection and echo, it is necessary to connect a terminal matching resistor at the receiving end. The terminal matching resistance value depends on the impedance characteristics of the cable, and has nothing to do with the length of the cable.

RS-485/RS-422 are generally connected by twisted pair (shielded or unshielded), and the terminal resistance is generally between 100 and 140 Ω, with a typical value of 120 Ω. In the actual configuration, the two terminal nodes of the cable, namely the nearest end and the farthest end, are each connected to a terminal resistance, and the node in the middle part cannot be connected to the terminal resistance, otherwise it will cause communication errors.

RS-485 network does not know which one is the farthest station, how should I connect the matching resistor?

This situation occurs because the user did not follow the principle that the connection between the station and the bus should be as short as possible when forming the RS-485 network. If the bus wiring follows this principle, there is no problem of not knowing which station is the farthest. And it should be noted that with such wiring, the system will not work well.

Why does the receiver still output data when the RS-485/RS-422 interface stops communicating?

Since RS-485/RS-422 requires all transmission enable control signals to be turned off and keep receiving enable valid after sending data, at this time, the bus driver enters a high-impedance state and the receiver can monitor whether there are new ones on the bus Communication data. But because the bus is in a passive driving state at this time (if the bus has a terminal matching resistor, the differential level of the A and B lines is 0, the output of the receiver is uncertain, and it is very sensitive to the change of the differential signal on the AB line; If there is no terminal matching, the bus is in a high-impedance state, and the output of the receiver is uncertain), which is susceptible to external noise interference. When the noise voltage exceeds the input signal threshold (typical value ±200mV), the receiver will output data, causing the corresponding UART to receive invalid data, making the subsequent normal communication error; another situation may occur when the transmission is turned on/off. At the moment of control, making the receiver output a signal will also cause the UART to receive incorrectly.

1) On the communication bus, the non-inverting input terminal is pulled up (A line) and the inverting input terminal is pulled down (B line) to clamp the bus to ensure that the receiver output is a fixed “1” level;
2) Replace the interface circuit with MAX308x series interface products with built-in fail-safe mode;
3) Eliminate by software, that is, add 2-5 initial synchronization bytes in the communication data packet, and only start the real data communication after the synchronization header is met.

Three factors affecting RS-485 bus communication speed and communication reliability
1. Signal reflection in communication cables

In the communication process, there are two kinds of signal causes that cause signal reflection: impedance discontinuity and impedance mismatch. The impedance is discontinuous, and the signal suddenly encounters the cable impedance at the end of the transmission line is very small or not, and the signal will cause reflection at this place, as shown in Figure 1. The principle of this kind of signal reflection is similar to the reflection caused by light entering another medium from one medium.

To eliminate this reflection, a terminal resistor of the same size as the characteristic impedance of the cable must be connected across the end of the cable to make the impedance of the cable continuous. Since the signal transmission on the cable is bidirectional, a terminal resistance of the same size can be bridged at the other end of the communication cable. From a theoretical analysis, as long as the end of the transmission cable is bridged with a terminal that matches the characteristic impedance of the cable Resistance, signal reflection will no longer occur. However, in the application, because the characteristic impedance of the transmission cable is related to the application environment such as the communication baud rate, the characteristic impedance cannot be completely equal to the terminal resistance, so more or less signal reflections will still exist.

Another cause of signal reflection is the impedance mismatch between the data transceiver and the transmission cable. The reflection caused by this reason is mainly manifested in the confusion of the entire network data when the communication line is in the idle mode.

The effect of signal reflection on data transmission, in the final analysis, is because the reflected signal triggers the comparator at the receiver’s input, causing the receiver to receive the wrong signal, resulting in a CRC check error or an entire data frame error.

In signal analysis, the parameter to measure the intensity of the reflected signal is RAF (Refection Attenuation Factor). Its calculation formula is as formula (1).

RAF=20lg (Vref/Vinc) (1)
Where: Vref-the voltage of the reflected signal; Vinc-the voltage of the incident signal at the connection point of the cable and the transceiver or terminal resistance.

The specific measurement method is shown in Figure 3. For example, the peak-to-peak value of the sine wave of the 2.5MHz incident signal is +5V, and the peak-to-peak value of the reflected signal is +0.297V. The reflection attenuation factor of the communication cable at a communication rate of 2.5MHz is : RAF=20lg (0.297/2.5)=-24.52dB
To reduce the influence of reflected signals on communication lines, methods of noise suppression and bias resistors are usually used. In practical applications, for relatively small reflected signals, the method of adding a bias resistor is often used for simplicity and convenience. In the communication line, the principle of how to increase the reliability of communication by adding a bias resistor will be described in detail later.

Signal attenuation in communication cables

The second factor that affects signal transmission is the signal attenuation during cable transmission. A transmission cable can be seen as an equivalent circuit composed of distributed capacitance, distributed inductance, and resistance.

The distributed capacitance C of the cable is mainly produced by two parallel wires of the twisted pair. The resistance of the wire here has little effect on the signal and can be ignored. The signal loss is mainly due to the LC low-pass filter composed of the distributed capacitance and distributed inductance of the cable. The attenuation coefficient of LAN standard two-core Inductor for PROFIBUS (standard cable selected by Siemens for DP bus) at different baud rates.

Pure resistance load in communication cable

The third factor that affects communication performance is the size of pure resistive load (also called DC load). The pure resistive load referred to here is mainly composed of terminal resistors, bias resistors and RS-485 transceivers.

When describing the EIARS-485 specification, it was mentioned that the RS-485 driver can output a differential voltage of at least 1.5V when it has 32 nodes and is equipped with a 150Ω terminal resistor. The input resistance of a receiver is 12kΩ, and the equivalent circuit of the entire network is shown in Figure 5. According to this calculation, the load capacity of the RS-485 driver is: RL=32 input resistors in parallel||2 terminal resistors=((12000/32)×(150/2))/(12000/32)+(150/ 2)) ≈51.7Ω

The more commonly used RS-485 drivers include MAX485, DS3695, MAX1488/1489, and SN75176A/D used by Hollysys, among which the load capacity of some RS-485 drivers can reach 20Ω. Without considering many other factors, according to the relationship between drive capacity and load, the maximum number of nodes that a drive can carry will be far greater than 32.

Still don’t understand RS485? 18 questions and answers to thoroughly understand RS485

When the communication baud rate is relatively high, it is necessary to bias the resistor on the line. How to connect the bias resistor. Its function is to pull the level from 0 level when there is no data on the bus (idle mode) after the line enters the idle state. In this way, even if a relatively small reflected signal or interference appears in the line, the data receiver connected to the bus will not malfunction due to the arrival of these signals. Through the following example, the size of the bias resistance can be calculated: terminal resistance Rt1=Rr2=120Ω;
Assuming that the maximum peak-to-peak value Vref of the reflected signal is less than or equal to 0.3Vp-p, the negative half-cycle voltage Vref is less than or equal to 0.15V; the reflected current on the terminal resistance caused by the reflected signal Iref is less than or equal to 0.15/(120||120)=2.5mA. The hysteresis value (hysteresisvalue) of general RS-485 transceivers (including SN75176) is 50mV, namely:


Therefore, the bias current generated by the bias resistor can be calculated, Ibias≥3.33mA

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

It can be calculated by formula 2 that R pull-up=R pull-down=720Ω

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

(1) Allocate the bias resistors to each transceiver on the bus in a balanced manner. This method adds a bias resistor to each transceiver connected to the RS-485 bus, and adds a bias voltage to each transceiver.

(2) Only use a pair of bias resistors on a segment of the bus. This method is more 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.

The relationship between the load capacity of the RS-485 bus and the length of the communication cable

When designing the network configuration (bus length and number of loads) composed of the RS-485 bus, three parameters should be considered: pure resistive load, signal attenuation and noise tolerance. The two parameters of pure resistive load and signal attenuation have been discussed above, and now we are going to discuss the noise margin (NoiseMargin). The noise tolerance of the RS-485 bus receiver should be at least greater than 200mV. The previous argumentator did it under the assumption that the noise margin is zero.

In practical applications, in order to improve the anti-interference ability of the bus, it is always hoped that the noise tolerance of the system is better than that specified in the EIARS-485 standard. The relationship between the amount of load on the bus and the length of the communication cable can be seen from the following formula: Vend=0.8 (Vdriver-Vloss-Vnoise-Vbias) (3)
Among them: Vend is the signal voltage at the end of the bus, which is specified as 0.2V in the standard measurement; Vdriver is the output voltage of the drive (related to the number of loads. 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 load number is greater than 35, Vdriver≤2.3V); Vloss is the loss of the signal in the bus transmission process (related to the specification and length of the communication cable), which is determined by the standard cable provided in Table 1. Attenuation coefficient, Vloss=Vin-Vout=0.6V can be calculated according to the formula attenuation coefficient b=20lg (Vout/Vin) (Note: The communication baud rate is 9.6kbps, and the cable length is 1km. If the special rate increases, Vloss will increase accordingly. Large); Vnoise is the noise tolerance, which is specified as 0.1V in the standard measurement; Vbias is the bias voltage provided by the bias resistor (typical value is 0.4V).

Multiplying by 0.8 in formula (3) is to prevent the communication cable from entering a full load state. It can be seen from equation (3) that the size of Vdriver is inversely proportional to the number of loads on the bus, the size of Vloss is inversely proportional to the length of the bus, and the other parameters are only related to the type of drive used. Therefore, on the RS-495 bus with the driver selected, under the condition of a certain communication baud rate, the number of loads is directly related to the maximum distance that the signal can be transmitted. The specific relationship is:
Within the allowable range of the bus, the more the number of loads, the smaller the distance the signal can be transmitted; the less the data with the load, the farther the distance the signal can be transmitted.

The Influence of Distributed Capacitance on RS-485 Bus Transmission Performance

The distributed capacitance of the cable is mainly produced by the two parallel wires of the twisted pair. In addition, there is a distributed capacitance between the wire and the ground, although it is small, it cannot be ignored in the analysis. The influence of distributed capacitance on bus transmission performance is mainly because the fundamental wave signal is transmitted on the bus, and the signal expression is only “1” and “0”. In a special byte, such as 0x01, the signal “0” makes the distributed capacitor have enough time to charge, and when the signal “1” comes, it is too late to discharge due to the charge in the distributed capacitor, (Vin+)-(Vin-)- It is also greater than 200mV, as a result, the connection is mistaken for “0”, which eventually leads to a CRC check error and the entire data frame transmission error.

Due to the influence of the distribution on the bus, data transmission errors are caused, which reduces the performance of the entire network. There are two ways to solve this problem:
(1) Reduce the baud rate of data transmission;
(2) Use cables with small distributed capacitance to improve the quality of the transmission line.

Definition of simplex, half-duplex and full-duplex

1. If at any time during the communication process, information can only be transmitted from one party A to the other party B, it is called simplex.
2. If at any time, information can be transmitted from A to B, or from B to A, but it can only exist in one direction, it is called half-duplex transmission.
3. If there is a two-way signal transmission from A to B and B to A on the line at any time, it is called full duplex.

The telephone line is a second-line full-duplex channel. Due to the echo cancellation technology, the two-way transmission signal will not be confused. The duplex channel sometimes separates the receiving and transmitting channels, and uses separate lines or frequency bands to transmit signals in the opposite direction, such as loop transmission.

The Links:   AA104VC04 CM600HA-12H

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *