RS-485 Communication Protocol
Overview
The typical serial communication standards are RS-232 and RS-485, which define voltage, impedance, etc., but do not specify software protocols. The RS-485 bus standard defines the electrical characteristics of the bus interface, specifically the definitions for two logic states: a positive level between +2V and +6V represents one logic state, while a negative level between -2V and -6V represents another logic state. Digital signals are transmitted differentially, effectively reducing noise interference.
Background
For over thirty years, the continuous development of industrial control technology and the widespread application of computer network communication technology have necessitated a bus communication technology suitable for long-distance digital communication. In 1983, the Electronic Industries Association established and published the RS-485 bus industrial standard based on the RS-422 industrial bus standard. The RS-485 industrial bus standard effectively supports multiple sub-nodes and long communication distances, and has high sensitivity for information reception. In industrial communication networks, the RS-485 bus is primarily used for information transmission and data exchange with various external industrial devices. Its effective noise suppression capability, high data transmission rate, reliable data transmission performance, and scalable communication cable length are unmatched by many other industrial communication standards. Therefore, RS-485 bus has been widely applied in various fields, such as industrial control, automated traffic control, and fieldbus communication networks.Introduction
The RS-485 bus standard defines the electrical characteristics of the bus interface, specifically the definitions for two logic states: a positive level between +2V and +6V represents one logic state, while a negative level between -2V and -6V represents another logic state. Digital signals are transmitted differentially, effectively reducing noise interference. However, the RS-485 bus standard does not provide clear specifications for the application layer communication protocols in communication networks, allowing users or developers to establish their own applicable high-level communication protocol standards for their communication network devices. Additionally, due to the application of RS-485 bus communication networks in industrial control, where there are often many decentralized industrial network control units and the distribution of various industrial devices is relatively far apart, various interferences can occur in the fieldbus communication network, leading to low communication efficiency and reliability. The reliability of data transmission in the entire network directly affects the reliability of the entire fieldbus communication system, making the study of the communication reliability of RS-485 bus communication systems of practical significance.
Features
The typical serial communication standards are RS-232 and RS-485, which define voltage, impedance, etc., but do not specify software protocols. The characteristics of RS-485, as opposed to RS-232, include:1. The electrical characteristics of RS-485: Logic “1” is represented by a voltage difference of + (2-6)V between the two wires; Logic “0” is represented by a voltage difference of – (2-6)V. The signal levels of the interface 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, facilitating connections with TTL circuits.2. The maximum data transmission rate of RS-485 is 10 Mbps.3. RS-485 interfaces are robust and have good noise immunity.4. The standard maximum transmission distance for RS-485 is 4000 feet, but it can actually reach up to 3000 meters (theoretical data; in practice, the limit is around 1200 meters). Additionally, the RS-232-C interface allows only one transceiver to be connected on the bus, meaning it has single-station capability. In contrast, the RS-485 interface allows up to 128 transceivers to be connected on the bus, providing multi-station capability, allowing users to easily establish a device network using a single RS-485 interface.Due to the excellent noise immunity, long transmission distance, and multi-station capability of the RS-485 interface, it has become the preferred serial interface. Since half-duplex networks formed by RS-485 interfaces typically require only two wires, RS-485 interfaces use shielded twisted pairs for transmission. The RS-485 connector uses a DB-9 9-pin plug, with the intelligent terminal RS-485 interface using a DB-9 (socket) and the keyboard connection using a DB-9 (pin).Network Design
Transceiver Circuit Design
The RS-485 transceiver circuit design utilizes the SBUS multi-master protocol to complete the design of a multi-channel temperature acquisition system. The common RS-232 serial standard is unsuitable for this communication system due to its short communication distance and low speed, while the RS-485 standard effectively compensates for these shortcomings. Therefore, the physical layer transceiver design uses the MAX485 chip, as shown in Figure 1.
Figure 1. RS-485 Communication Circuit Diagram
The RS-485 transceiver has two enable terminals; the receive enable terminal is grounded, while the transmit enable terminal is controlled by the 51 microcontroller. Thus, the host remains in receive mode when idle, and the transmit enable terminal is activated when data needs to be sent. Additionally, to implement bus monitoring, the serial port receive terminal is connected to the external interrupt INT0 of the microcontroller through a Schmitt trigger, allowing the bus status to be determined via interrupts.
Connection Method
In an RS-485 communication network, 485 transceivers are typically used to convert TTL levels to RS-485 levels. The serial port controller in the node connects the RX and TX signal lines to the 485 transceiver, while the transceiver connects to the network bus via differential lines. The serial port controller and transceiver generally use TTL signals for transmission, while the transceiver uses differential signals to transmit to the bus. When sending data, the TX signal from the serial port controller is converted into a differential signal by the transceiver for transmission on the bus, and when receiving data, the transceiver converts the differential signal from the bus into a TTL signal for transmission to the serial port controller via the RX pin. Typically, there can only be one master device among these nodes, while the rest are slave devices. A 120-ohm matching resistor is added at both ends of the bus.
Figure 2. RS-485 Communication Network Connection Diagram
博途视频专辑
S7-200 SMART的PTO如何立即停止输出
如何在S7-200 SMART CPU断电重启后保持运动控制的当前位置值
◆来源:网络,如有侵权请联系删除。
谢谢那么多人关注了我,没有你们,
我的生命不会越来越完整
谢谢你们!
这波操作很稳
👇👇👇
后续会持续更新资源内容
来都来了,点个在看再走吧~~~