Application of RS-485 Bus in Multi-node Long-distance Communication System

Publisher:Whisper123Latest update time:2012-04-16 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

This paper introduces the structure, performance characteristics of the RS-485 interface SN65HVD3082E chip, and the composition of the communication system based on this chip, including their hardware circuits and software design methods; it also explains the advantages and application areas of the system.
Keywords: communication system; RS-485 interface; chip; hardware; software

Application of RS-485 Bus in Many Nodes and Far Distance
Communication System
DENG Zhongyi
(Electronic Engineering Department of Luoding Vocational and Technological College,
Luoding 527200, China)
Key words: communication systems; RS-485 interface; chip; hardware; software
1SN65HVD3082E interface chip introductionSN65HVD3082E
chip is a half-duplex transceiver designed for RS-485 data bus network. It is powered by +5V and is fully compatible with TIA/EIA-485A standard. By controlling the output conversion timing, it can transmit signals up to 200kbps on long-distance twisted pair cables. Its supply current is extremely low, generally less than 0.6mA, and when in inactive shutdown mode, the supply current is only a few nA, so it is particularly suitable for low-power applications. It has a wide common-mode rejection range and high electrostatic discharge protection capabilities, so it is suitable for occasions with high noise tolerance requirements. SN65HVD3082E matches the industrial standard package of SN75176. Its power-on reset circuit can keep the output in a high-impedance state until the supply voltage is stable, and its thermal shutdown function can also protect the chip from damage due to system failure. Its pin diagram is shown in Figure 1, and its internal function diagram is shown in Figure 2. Other features include: up to 256 nodes on a bus; ESD protection on bus pins exceeds 16kV, and receivers are fault protected.

2.1 Overall system design
The system consists of an IBM-PC and multiple AT89C52 single-chip machines. It adopts a master-slave structure. The slave machine with the AT89C52 chip as the core can not only complete data processing and control tasks independently, but also transmit data to the host PC. The PC processes, displays, and prints these data, and transmits various control commands to each slave machine to achieve centralized management and optimal control. The communication between them is completed by the SN65HVD3082E chip. The block diagram is shown in Figure 3. Matching resistors are connected between the interfaces to absorb the reflected signals on the bus to ensure that the normal propagation signal is clean and burr-free (its value is equivalent to the characteristic impedance of the bus). When there is no signal transmission on the bus, the bus is in a suspended state and is easily affected by interference signals. On the bus, a 10kΩ resistor is connected between the positive end of the differential signal and the +5V power supply; a 10kΩ resistor is also connected between the positive end and the negative end; and a 10kΩ resistor is connected between the negative end and the ground to form a resistor network. When there is no signal transmission on the bus, the level of the positive end is about 3.2V, and the level of the negative end is about 1.6V. Even if there is an interference signal, it is difficult to generate the start signal 0 of the serial communication, thereby increasing the anti-interference ability of the bus.
2.2 RS232/RS485 conversion part
DAQ485A series product DAQ485A-6N is selected as the RS-232/RS-485 converter. One end is a DB9S plug, which can be directly connected to the RS-232 port of the PC, and the other end is a four-terminal terminal block, which are A, B, GND, and VCC. It can be powered directly by the RS-232 port of the computer, or an external +5V DC power supply can be connected between VCC and GND; the DQ485A converter has an automatic processing function inside, and the external power supply does not affect the internal power theft, and the internal power theft does not affect the external power supply. Therefore, the two can be supplied separately or at the same time. The DAQ485A-6N series uses TI's E series ESD protection devices, so it is suitable for long-distance outdoor use. Figure 4 is a connection diagram of the RS-232/RS-485 converter and RS-485.

?
The software design of this system is based on Windows 98, and is designed using Delphi and C++ languages. The following only introduces the design ideas and methods of the main programs of the upper and lower computer communication and interface. The communication software must comply with the RS-485 protocol standard. Therefore, the master-slave structure is strictly implemented between the upper and lower computers, with the upper computer as the master and the lower computer as the slave. Everything is controlled by the host. At any time, the host only transmits information to one slave. Slaves cannot communicate directly with each other. If they want to communicate, they can communicate through the host. The data communication baud rate is set to 9600 baud, and each slave has a unique address number to distinguish each slave. The data communication of the single-chip microcomputer is completed by the serial port. Timer T1 is a baud generator. The data transmission format is 1 start bit, 8 data bits, 1 stop bit, and 1 programmable bit (TB8). Working mode: Timer T1 is set to mode 2, and the serial port is set to working mode 3. The single-chip microcomputer sends and receives data through interrupts. Since RS-485 is a half-duplex communication mode, sending and receiving share the same physical channel. Only one machine is allowed to be in the sending state at any time. Therefore, the machine that requires a response must respond only when it hears that the call signal on the bus has been sent and no other machine has sent a response signal. There are strict requirements for the timing of the master and slave machines. If they are not coordinated well, bus conflicts will occur, paralyzing the communication of the system and making it impossible to operate normally. Measures to be taken: (1) When resetting, both the master and slave machines should be in the receiving state. When designing the software, the serial port should be operated several times before the system is powered on or before formal communication to clear illegal data and commands from the port; (2) The effective pulse width of the RE and DE signals on the control end should be greater than the width of sending or receiving a frame of signals; (3) The sending control signals of each machine connected to the bus should be completely separated in timing to avoid bus conflicts. The host program flow chart is shown in Figure 5, and the lower computer communication block diagram is shown in Figure 6.

Since the RS485 bus has a long transmission distance (more than 1200 meters) and its transmission line is usually exposed outdoors, it is very easy to suffer from overvoltage shocks due to lightning strikes and other reasons. The operating voltage of the RS-485 transceiver is low (about +5V), and its own withstand voltage is also very low (-7V ~ +12V). Once it is subjected to overvoltage shock, it will be broken down and damaged. When there is a strong surge of power, it may even cause the transceiver to burst and the circuit board to burn. Therefore, in addition to using protective circuits, selecting high-quality protective devices, and good PCB board design, reliable grounding technology is also used (the grounding resistance cannot exceed 10Ω).
The multi-node long-distance communication system composed of the RS-485 bus can be used in warehouse communication, TV monitoring, robot welding, attendance machine, water meter collection, highway toll collection, pulse power device, data acquisition, industrial control and many other systems. It has many advantages such as long transmission distance, strong anti-interference ability, low price, good stability, simple circuit, etc., and has broad application prospects.
Reference address:Application of RS-485 Bus in Multi-node Long-distance Communication System

Previous article:Application of USB Technology in Field Calibrators
Next article:Design of Fieldbus Traffic Countdown Timer

Latest Analog Electronics Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号