Research on Scalable Local Area Networks Based on RS-485 Bus
2026-04-06 05:56:45··#1
1. Characteristics of RS-485 Bus Communication RS-485 is developed based on RS-422. It can achieve one-to-many communication and multi-point bidirectional communication, but only one transmitter can operate at a time, with the rest acting as receivers—a master-slave communication mode. Currently, many RS-485 bus chips are available on the market, including the MAX1487 which supports 128 nodes and the SP485R which supports 400 nodes. Simple communication networks can be directly constructed using these chips. RS-485 transceivers use balanced transmission and differential reception. At the transmitting end, TTL signals are converted into differential signals for output, and at the receiving end, the differential signals are converted back into TTL signals. Therefore, it has high common-mode rejection capability. Simultaneously, the receiver has high sensitivity, capable of detecting voltages as low as 200mV, and data transmission can reach 1200m. If the data transmission rate is reduced, the communication distance can be further extended. Theoretically, at a communication rate of 1200bps, the communication distance can reach 15km. When the transmission distance exceeds 300m, 120Ω matching resistors need to be connected at both ends of the network to reduce reflections caused by impedance mismatch, absorb noise, and effectively suppress noise interference. The interface circuit diagram of MAX1487 is shown in Figure 1. 2. Network Structure and Implementation Scheme In practical applications, the number of nodes possessed by the RS-485 bus chip itself is insufficient, often requiring a complex local area network (such as thousands or even tens of thousands of nodes) with a large number of nodes. Various devices connected to this network can communicate with each other and can be arbitrarily expanded within a certain number of nodes according to actual needs, achieving plug-and-play functionality. Administrators can access any node in the network using a portable laptop to understand the overall network operation. Combined with user applications, administrators can also obtain operational data of relevant devices connected to the network. To meet these requirements, the local area network must be composed of multiple chips with RS-485 bus connectivity. This paper discusses local area networks with ≤32768 nodes, using MAX1487 as the transceiver. Based on the characteristics of the RS-485 bus, only one transmitter is allowed in the entire network at any given time; the rest must be in receiving mode. However, multiple devices connected to the network may simultaneously request data transmission. Without coordination, bus contention will occur, causing electronic malfunction and rendering the entire network inoperable. A single MAX1487 chip can connect 128 nodes as a subnet, and the entire local area network consists of several subnets. All nodes are not directly connected to user equipment but are connected through a node module. This is a two-terminal intelligent module with a communication port, containing a microcontroller system to execute the local area network communication protocol, handle communication between the BS-485 bus and devices, and participate in the overall communication coordination of the local area network. One end of the module is an RS-485 bus for network connection, and the other end is an RS-232 bus (or TTL level) for connection to user equipment, instruments, or intelligent sensors. Each node module in the subnet has its own address, represented by one byte, i.e., 00H~7FH. Within the local area network (LAN), each subnet also has its own subnet address, represented by one byte, i.e., 00H to FFH. Thus, each node in the LAN has its own unique address represented by a two-byte binary number, similar to an IP address on the Internet, as shown in Figure 2. Taking node 05H in subnet 00H as an example, the "X" is an invalid bit, designating the two nodes with addresses 00H and 7FH in each subnet as special nodes. The node with address 00H is the manager of this subnet, coordinating communication within the subnet, and also serves as a data entry/exit point for this subnet, connecting to the node with address 7FH. The node with address 7FH is the other data entry/exit point for this subnet, responsible for connecting to the node with address 00H in the next subnet. This indicates that the subnets are connected by two back-to-back node modules via an RS-232 bus. These two back-to-back node modules also act as relay stations between subnets. The system also stipulates that the 00H node of the 00H subnet, i.e., the node with the address "00000000·00000000", is the highest-level manager of the entire network. A topology structure is recommended for the local area network to improve network efficiency, while a chain structure can increase the network's communication distance. A schematic diagram of a local area network structure using an RS-485 bus is shown in Figure 3 (taking the 00H and 01H subnets as examples). 3. Node Module Design The key to this local area network is the design of the node modules. This is also a distinctive feature of this local area network, where software design is crucial. The node modules mainly handle network management and communication. To ensure module versatility, all node modules have the same structure and software; any module can be interchanged as long as the correct address is selected according to the network protocol. There is no dedicated network server in the network; any node module has server functionality. Which node module acts as the server is determined by its own address; therefore, the node module software should have the function of automatically identifying addresses to determine its position and role in the network. For example, when a node detects its own address as "00001010·×0000000", it knows it is the OOH node in the 0AH subnet and is the administrator of that subnet; when it detects its own address as "00000000·×0000000", it knows it is the highest administrator of the entire local area network. Node module addresses can be set by the user. To achieve plug-and-play functionality, the highest administrator must periodically broadcast to the entire network to collect network operation information (such as whether new nodes have joined or left the network) and form a network status registry, which is refreshed in real time according to actual conditions. Any node can obtain this registry from the highest administrator, allowing administrators to obtain network operation status from any node. When the network is idle, the highest administrator continuously queries the entire network to monitor for data communication requests. Data communication within a subnet is coordinated by the subnet's administrator (node address 00H). The highest administrator (subnet address 00H, node address also 00H) only intervenes when data is transmitted across subnets. The node module has 8KB of SRAM as a data buffer and 2KB of E2PROM for storing registry information. The microcontroller's serial communication port must handle both RS-485 bus communication and communication from the RS-232 bus to the device, thus requiring a communication port switching function. Normally, the microcontroller's serial communication port is always connected to the RS-485 bus; it only switches to the RS-232 bus when the device needs to transmit data. Therefore, the system must also have a function to detect device communication requests. Due to space limitations, the specific software programming is not described here. The structure of the node module is shown in Figure 4. 4. Summary Theoretically, this local area network has no limit on the expansion of nodes, but considering the limitation of RS-485 bus communication speed, the network size should not be too large. As the structural analysis above shows, the network reliability depends on the subnets. Since there is no crosstalk between subnets, the network reliability will not decrease as the network size increases. This is a general-purpose local area network suitable for any application requiring RS-485 bus communication, thus possessing strong practicality.