HCBBS Forum (English)
Submit Chemical Projects / Find Solutions
Amplify Your Requirements on a Broader Chemical Platform *Engineering · Technology · Equipment · Solutions*
Submit Request

485 Communication.doc

2008-01-10View Original

Thread Content

1. What kind of communication cable should be used for the 485 bus? Shielded twisted pair cables that are standard internationally must be used. The type of shielded twisted pair we recommend is RVSP2*0.5 (a two-core shielded twisted pair, with each core consisting of 16 strands of 0.2mm wire). The use of shielded twisted pair helps to reduce and eliminate the distributed capacitance that arises between the two 485 communication lines, as well as the common-mode interference generated around those communication lines. It is incorrect for most contractors to routinely use Category 5 or Category 5e cable as 485 communication cables. This is because: <BR>(1) Ordinary network cables lack a shielding layer, so they cannot prevent common-mode interference. (2) The network cable has only 0.2 mm² of cross-sectional area; its thin diameter results in a reduced transmission distance and fewer devices that can be connected to it. (3) The network cable is a single-strand copper wire, which is more prone to breaking compared to multi-core wires. 2. Why is grounding necessary? The 485 transceiver can operate properly only when the specified common-mode voltage is within the range of -7V to +12V. If it exceeds this range, it will affect communication; in severe cases, it may damage the communication interface. Common-mode interference will increase the aforementioned common-mode voltage. One effective way to eliminate common-mode interference is to use the shielding layer of the 485 communication cable as a ground wire, connecting the grounds of devices in the network such as machinery and computers together, and providing a reliable connection to the earth at one point. 4. How should the 485 communication cable be routed? Keep communication cables as far away as possible from high-voltage wires; do not run them parallel to power cables, and under no circumstances should they be tied together. 5. Why does the 485 bus use a daisy-chain structure instead of a star structure? The star topology generates reflection signals, thereby affecting 485 communication. The length of the branch lines from the bus to each terminal device should be as short as possible, generally not exceeding 5 meters. If a branch line is not connected to a terminal, reflected signals will be generated, causing significant interference to communication; such branches should be removed. 6. Can there be contacts between devices on a 485 bus? Within the same network system, use the same type of cable and minimize the number of connections in the wiring. Ensure good welding at the joints, with tight wrapping to prevent loosening and oxidation. Ensure a single, continuous signal channel serves as the bus. 7. What are common-mode interference and differential-mode interference? How to eliminate interference on communication lines? A 485 communication line consists of two twisted pairs; it transmits signals by means of the voltage difference between these two wires, which is why it is referred to as differential voltage transmission. Common-mode interference travels between two signal lines and is a type of symmetric interference. The method to eliminate differential mode interference is to add a bias resistor to the circuit and use twisted pair wiring ; Common-mode interference is transmitted between the signal line and ground, and it belongs to asymmetric interference. Methods to eliminate common-mode interference include: (1) using shielded twisted pair cables and ensuring proper grounding; (2) considering the use of galvanized pipes for shielding in areas with strong electric fields; (3) keeping wiring away from high-voltage lines, and never bundling high-voltage power lines with signal lines together; (4) not sharing the same power supply with electric control locks; (5) using linear regulated power supplies or high-quality switching power supplies (with ripple interference below 50 mV). 8. Under what circumstances is it necessary to add termination resistors on the 485 bus? Under normal circumstances, there is no need to add termination resistors; they are only required when the 485 communication distance exceeds 100 meters, in which case termination resistors must be added at both the start and end of the 485 communication. 9. How to extend the communication distance of 485? One of the specifications for 485 networks is a length of 1.2 kilometers with 32 nodes. If this limit is exceeded, a 485 repeater or 485 hub must be used to extend the network distance or the number of nodes.   A large 485 network can be divided into several network segments using 485 repeaters or 485 hubs. A 485 repeater or 485 hub acts as a \"bridge\" to connect 485 network segments. Of course, each network segment still adheres to the aforementioned 485 specifications, namely a length of 1.2 kilometers and 32 nodes.    Diagram of extending network distance using 485 repeaters: Using 485 repeaters to address the issue of multiple branches in a 485 network, as shown in the diagram. Constructing a star-shaped 485 network using 485 hubs – A 485 hub is an extension of the concept of a 485 repeater; it not only solves the problem of multiple branches but also addresses the issue of isolation between different network segments. In other words, if there is a problem in one segment (such as a short circuit), it does not affect other segments, thereby greatly enhancing the security and stability of large-scale networks. We can understand the advantages of star topology networks by looking at the evolution of local area networks from bus topology to star topology. Similarly, a star-shaped 485 network using 485 hubs will also be a direction for the development of 485 networks. Multi-point communication between a PC and a microcontroller using the RS-485 communication protocol. Authors: Liu Tao, Ma Jixun, Lian Haitao. Source: Internet. Views: 910. Update date: 2007-2-1. Abstract: This article introduces the RS-485 interface chip MAX485; with this chip, serial communication between a PC and a microcontroller can be easily established. Examples of multi-point communication between a PC and a microcontroller are also provided. Keywords RS-485 serial communication, multi-point communication. With the widespread use of data acquisition systems, application systems typically composed of microcontrollers, such as instruments and smart devices, need to exchange data with PCs in order to establish communication between them. This enables full utilization of the complementary capabilities and shared resources between PCs and microcontrollers. The commonly used RS-232 protocol can no longer meet the requirements of modern design to a large extent, due to drawbacks such as slow transmission speeds, short transmission distances, and susceptibility of the transmitted signals to external interference. This article introduces a high-performance RS-485 interface chip, as well as how to use this chip to achieve remote communication between a microcontroller and a PC. It also discusses expanding its functions to enable the PC to manage arrays of microcontrollers. ? 1 Introduction to the RS-485 protocol and the MAX485 chip? Due to the various shortcomings of RS-232, a new serial communication interface standard called RS-449 was developed; the electrical standard corresponding to it is RS-485. RS-485 is a multi-point communication standard developed by the Electrical Industries Association (EIA) of the United States, which uses balanced twisted pair cables as the transmission medium. It uses differential signals for transmission ; The maximum transmission distance can reach 1.2 km ; Up to 32 drives and transceivers can be connected ; The minimum sensitivity of the receiver can reach ±200 mV ; The maximum transmission rate can reach 2.5 Mb/s. It is evident that the RS-485 protocol is a standard designed for long-distance, high-sensitivity, multi-point communication. ? The MAX485 interface chip is an RS‑485 chip from Ma*m Corporation. ? It operates on a single +5 V power supply, with a rated current of 300 μA, and uses half-duplex communication. It performs the function of converting TTL levels to RS-485 levels. Its pin layout is shown in Figure 1. As can be seen from the diagram, the structure and pins of the MAX485 chip are very simple; it contains a driver and a receiver inside. The RO and DI terminals are respectively the output of the receiver and the input of the driver; when connecting to a microcontroller, they simply need to be connected to the microcontroller’s RXD and TXD ports respectively ; /The RE and DE terminals are the enable terminals for reception and transmission respectively; when /RE is at logic 0, the device is in reception mode ; When DE is at logic 1, the device is in transmit mode. Since the MAX485 operates in half-duplex mode, only one pin of the microcontroller is needed to control these two pins ; Terminal A and terminal B are the differential signal terminals for reception and transmission respectively; when the level at pin A is higher than that at pin B, it indicates that the transmitted data is 1 ; When the level of A is lower than that of B, it indicates that the transmitted data is 0. Wiring is very simple when connecting to a microcontroller. Only one signal is needed to control the reception and transmission of the MAX485. At the same time, a matching resistor should be added between terminals A and B; a 100Ω resistor is generally a suitable choice. ? 2. Implementing multi-point communication with an 8031 microcontroller using a PC ? When communicating between the 8031 microcontroller and a PC, it is necessary to use level conversion interface chips, as the microcontroller outputs TTL levels, which need to be converted before they can match those of the PC. The RS-485 protocol is used in this article, so the microcontroller needs to have an RS-485 interface ; On the PC side, RS-232 and RS-485 level conversion interfaces are used. In this article, the level conversion interface from Wuhan Xinte Electronics Company is used. This interface is easy to use, does not require an external power supply, can achieve a data transfer rate of up to 10 Mb/s, and does not need any software initialization or modification. Additionally, to achieve multi-point communication, it is necessary to understand the driving capacity of the devices; when the driving capacity of the devices is sufficient, we can add the required nodes as needed. The example given in this article demonstrates the use of a single PC to control 64 microcontrollers, employing multi-point communication. By sending control words and mode words to the corresponding microcontroller, it is prompted to perform the appropriate operations. After receiving the data, the microcontroller carries out data collection; once the PC sends a command, it sends the collected data back to the PC, which then analyzes and processes the data. ?   ??????? Programs for PCs can be written using any object-oriented, high-level language available under Windows. This approach is simpler than using serial port interrupts in DOS; the application hands control over to the serial port driver, with the reception and transmission of data being entirely managed by the driver, which reduces many complexities in the programming process. In this program, Delphi’s serial communication control component Spcomm is used to achieve this. The parameter settings can be completed automatically. The microcontroller operates in interrupt mode and is programmed in assembly language. The communication baud rate is 1.2 kb/s. To enable communication with a PC, an 11.0592 MHz crystal oscillator is used to ensure that the baud rate matches that of the PC, thereby avoiding transmission and reception errors caused by different baud rates. To support multi-machine operation, Mode 3 is selected. The communication flowchart of the microcontroller is shown in Figure 3. ? Below are the communication program written in Delphi, as well as the receiving and sending programs for the microcontroller. ? Microcontroller initialization subroutine: ? Microcontroller reception subroutine: ? REPT: CLRRI? MOVA, SBUF? MOV@R0, A? RET? During program development, to ensure the accuracy of data reception and transmission, a CRC verification routine was added. Additionally, the data sent from the PC to the microcontroller is in ASCII format, and it also requires some simple conversion; these steps are omitted here. ? Serial communication using the RS-485 protocol ensures fast and stable data transmission over long distances. It will undoubtedly see increasing use in industrial control and other fields, both now and in the future. ? References? 1 Wu Zifang, Yu Hesong. Microcomputer Control Systems and Their Applications. Xi’an: Xi’an Jiaotong University Press, 1998. 2 Product documentation from Ma*m. 3 Li Chaoqing (editor). Data Communication Techniques for PCs and Microcontrollers. Beijing: Beihang University Press, 1999. 4 Basic Knowledge of Communications 1. What kind of communication cable should be used for the 485 bus? How many devices can be connected to one bus? RVSP shielded twisted pair must be used. The specification of the shielded twisted pair used is related to the distance from the 485 communication line and the number of devices connected, as shown in the table below. The use of shielded twisted pair helps to reduce and eliminate the distributed capacitance that arises between the two 485 communication lines, as well as the common-mode interference generated around those communication lines. Communication distance, Number of devices, Specification of communication cable: 1–400 m: 1–32 devices; cable diameter 0.5 mm2. 400–800 m: 1–16 devices; cable diameter 0.5 mm2. 400–800 m: 17–32 devices; cable diameter 0.75 mm2. 800–1200 m: 1–8 devices; cable diameter 0.5 mm2. 800–1200 m: 9–21 devices; cable diameter 0.75 mm2. 800–1200 m: 22–32 devices; cable diameter 1.0 mm2. It is a mistake for contractors to commonly use Category 5 or Category 5e cables as 485 communication cables. This is because: (1) ordinary network cables lack a shielding layer, which prevents common-mode interference. (2) The network cable has only 0.2 mm² of cross-sectional area; its thin diameter results in a reduced transmission distance and fewer devices that can be connected to it. (3) The network cable is a single-strand copper wire, which is more prone to breaking compared to multi-core wires. 2. Why is grounding necessary? The 485 transceiver can operate properly only when the specified common-mode voltage is within the range of -7V to +12V. If it exceeds this range, it will affect communication; in severe cases, it may damage the communication interface. Common-mode interference will increase the aforementioned common-mode voltage. One effective way to eliminate common-mode interference is to use the shielding layer of the 485 communication cable as a ground wire, connecting the grounds of devices in the network such as machinery and computers together, and providing a reliable connection to the earth at one point. Can the electronic lock and the controller/card reader share the same power supply? No. When the electronically controlled lock is not operating, the ripple voltage of SKPS is only 40-50 mV ; Once the lock is operated, that is, when it opens or closes electronically, the ripple voltage rises to 100mV–300mV. This ripple voltage enters the controller and card reader through the ground wire, causing the communication chips and CPU to overheat, leading to unstable communication; in severe cases, it can even damage the chips. Moreover, at the moment of power loss or restoration, the coil inside the electronic lock undergoes charging and discharging, generating a pulse as high as 850mA. If no diodes are connected in parallel across the electronic lock, this ripple signal will also be transmitted to the controller and the card reader. Ximake recommends using a single SKPS power supply for one controller and all the card readers connected to it ; Each electric lock under this controller uses a separate SKPS power supply. 4. How should the 485 communication cable be routed? Keep communication cables as far away as possible from high-voltage wires; do not run them parallel to power cables, and under no circumstances should they be tied together. 5. Why does the 485 bus use a daisy-chain structure instead of a star structure? The star topology generates reflection signals, thereby affecting 485 communication. The length of the branch lines from the bus to each terminal device should be as short as possible, generally not exceeding 5 meters. If a branch line is not connected to a terminal, reflected signals will be generated, causing significant interference to communication; such branches should be removed. In the Ximake access control system, the 485 bus is used in two places. One is from the computer to the controller connected below it, and the other is from the controller to the 485 card reader connected below it. 6. Can there be contacts between devices on a 485 bus? Within the same network system, use the same type of cable and minimize the number of connections in the wiring. Ensure good welding at the joints, with tight wrapping to prevent loosening and oxidation. Ensure a single, continuous signal channel serves as the bus. 7. What are common-mode interference and differential-mode interference? How to eliminate interference on communication lines? A 485 communication line consists of two twisted pairs; it transmits signals by means of the voltage difference between these two wires, which is why it is referred to as differential voltage transmission. Common-mode interference travels between two signal lines and is a type of symmetric interference. The method to eliminate differential mode interference is to add a bias resistor to the circuit and use twisted pair wiring ; Common-mode interference is transmitted between the signal line and ground, and it belongs to asymmetric interference. Methods to eliminate common-mode interference include: (1) using shielded twisted pair cables and ensuring proper grounding; (2) considering the use of galvanized pipes for shielding in areas with strong electric fields; (3) keeping wiring away from high-voltage lines, and never bundling high-voltage power lines with signal lines together; (4) not sharing the same power supply with electric control locks; (5) using linear regulated power supplies or high-quality switching power supplies (with ripple interference below 50 mV). Under what circumstances is it necessary to add termination resistors on the 485 bus? Under normal circumstances, there is no need to add termination resistors; they are only required when the 485 communication distance exceeds 300 meters, in which case termination resistors must be added at both the start and end of the 485 communication. Especially when there are few devices on the 485 bus. When there are a large number of devices (such as more than 22). Generally, there is no need to add termination resistors, as they reduce the load capacity of the 485 bus. When it is necessary to increase the terminal resistance, simply set the terminal resistor jumper on the controller; if the other end is connected to a computer, short-circuit the brown and white wires of the 485 converter as well. 9. How to extend the communication distance of 485? One of the specifications for 485 networks is a length of 1.2 kilometers with 32 nodes. If this limit is exceeded, a 485 hub must be used to extend the network distance or the number of nodes.   Using a 485 hub, a large 485 network can be divided into several network segments. A 485 hub acts as a “bridge” connecting 485 network segments. Of course, each network segment still adheres to the aforementioned 485 specifications, namely a length of 1.2 kilometers and 32 nodes.    Diagram of extending network distance using a 485 hub: Using a 485 hub to address the issue of multiple branches, as shown in the diagram; constructing a star-shaped 485 network with a 485 hub. A 485 hub is an extension of the concept of a 485 repeater – it not only solves the problem of multiple branches but also addresses the issue of isolation between different network segments. In other words, if there is a problem in one segment (such as a short circuit), it does not affect other segments, thereby greatly enhancing the security and stability of large networks. We can understand the advantages of star topology networks by looking at the evolution of local area networks from bus topology to star topology. Similarly, a star-shaped 485 network using 485 hubs will also be a direction for the development of 485 networks.

Submit a Project

**Looking for Chemical Technology, Equipment & Solutions?** No Registration Required Broader Platform Exposure | Global Chemical Service Provider Connections

Submit Request — Free Consultation

Disclaimer

This is an automated machine translation of the original thread. Some technical terms may have inaccuracies; the original text shall prevail. Click "View Original" at the top right to access the source page, which supports IP-based automatic real-time language translation. Please watch out for contact details and sales inducements to prevent fraud. All content and translations are for reference only, representing solely the poster's personal views. For enquiries, email service@hcbbs.com.