How to solve some problems of RS-485?
Why does the receiver still output data when the RS-485/RS-422 interface stops communicating?
Since RS-485/RS-422 requires all the transmission enable control signals to be closed and keep the reception enable valid after the data transmission is completed, at this time, the bus driver enters a high-impedance state and the receiver can monitor the bus for new ones. Communication data. However, 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, causing the subsequent normal communication error; another situation may occur when the transmission is turned on/off. The moment when it can be controlled, the receiver output signal will also cause the UART to receive it incorrectly.
1) Clamp the bus on the communication bus by pulling in the same phase input (line A) and pulling down the inverting input (line B) to ensure that the receiver output is at a fixed "1" level;
2) The interface circuit of the MAX308x series of built-in fail-safe modes is used to replace the interface circuit;
3) Eliminate by software, that is, add 2-5 start synchronization bytes in the communication data packet, and only start the real data communication after meeting the synchronization header.
Three factors affecting RS-485 bus communication speed and communication reliability
1. Signal reflection in the communication cable
In the communication process, there are two kinds of signals that cause signal reflection: impedance discontinuity and impedance mismatch. Impedance is discontinuous. The signal suddenly encounters little or no cable impedance at the end of the transmission line. 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 a medium from another medium. To eliminate this reflection, a termination resistor of the same size as the characteristic impedance of the cable must be connected across the end of the cable to make the cable impedance continuous. Because the signal transmission on the cable is bidirectional, a terminating resistor of the same size can be bridged at the other end of the communication cable. Theoretically, at the end of the transmission cable, as long as a terminal that matches the characteristic impedance of the cable is bridged Resistance, there will never be signal reflection again. However, in the implementation of 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 reflection 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 messy data of the entire network when the communication line is in idle mode.
In the final analysis, the effect of signal reflection on data transmission is because the reflected signal triggers the comparator at the input of the receiver, 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 that measures the strength of the reflected signal is RAF (RefectionAttenuaTIonFactor reflection attenuation factor). Its calculation formula is as formula (1).
RAF=20lg (Vref/Vinc) (1)
In the type: Vref- the magnitude of the voltage of the reflected signal; Vinc- the magnitude of the voltage of the incident signal at the connection point between the cable and the transceiver or the terminating resistor.
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 measured by experiments is +5V, and the peak-to-peak value of the reflected signal is +0.297V. When the communication cable has a communication rate of 2.5MHz, its reflection attenuation factor is : RAF=20lg (0.297/2.5)=-24.52dB
To reduce the impact of the reflected signal on the communication line, the methods of noise suppression and bias resistance are usually used. In practical applications, for relatively small reflected signals, for simplicity and convenience, the method of adding a bias resistor is often used. 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.
If you want to know more, our website has product specifications for RS-485, you can go to ALLICDATA ELECTRONICS LIMITED to get more information