The Design of Single-chip Microcomputer for the Project of "Increase 485 Bus Communication Speed”

The operation and maintenance of traditional substations is not timely due to the huge cost of manpower and material resources. In the context of "ubiquitous power Internet of Things", the operation and maintenance of substations uses a large number of sensor equipment. However, the traditional rs485 bus is difficult to transmit large-capacity data such as waveform curves and images in real time, and the optical fiber transmission form of industrial Ethernet will bring higher costs, which will hinder real-time monitoring. This project intends to achieve impedance matching by adjusting the resistance of the pull-up and pull-down resistors and terminal resistors, thereby increasing the communication rate of the rs485 bus. To this end, we specially designed a simple STM32 single-chip microcomputer to match the realization of the project. The hardware part of this design adopts the STM32F103RCT6 single-chip microcomputer as the main control chip, using MAX3485 as the serial port chip, and at the same time choosing the resistance and capacitance of 0805 package, using AMS1117 Packaged voltage regulator chip.


Background
The operation and maintenance of traditional substations is not timely due to the huge cost of manpower and material resources, and there is a lack of instruments for online monitoring of power equipment. With the concept of "Ubiquitous Power Internet of Things", it provides opportunities for online operation and maintenance of power distribution equipment at its perception layer.
The main equipment in the substation is the switch cabinet and the transformer cabinet. The switch cabinet is equipped with a large number of three-phase switches, and the transformer cabinet is equipped with a large number of distribution transformers. In order to achieve real-time monitoring and data acquisition of distribution transformers and three-phase switches, a large number of online sensors, such as partial discharge sensors and temperature sensors, are installed in the switch cabinet. Various sensors transmit the data recorded by the sensors to the field terminal device through the field bus, and then the terminal device collects the information. However, when some sensors transmit information in the form of waveforms, pictures, etc. via the field bus, the information capacity is too large, which exceeds the communication capacity of the traditional low-cost rs485 bus, so that the information collected by the sensors cannot be transmitted smoothly to the power equipment Monitoring caused difficulties. However, if the optical fiber transmission form of industrial Ethernet is adopted, it will bring a very high cost, which is obviously unrealistic [1,2].
For this reason, we need to transform the low-cost rs485 bus to improve its transmission rate. (1) Its library function is rich, no need to configure registers, it will be more convenient to debug [3].

MCU design
(2) The upper limit of the communication rate of STM32 is much higher than that of STM51. Based on the research purpose of this project, STM32 will be a better choice.
(3) In order to achieve compatibility of STM32 working voltage, power supply voltage, and 485 serial port chip voltage, we chose STM32F103RCT6 with a working voltage of 2V~3.6V.
(4) STM32F103RCT6 incorporates the high-performance ARM-based Cortex-M3 32-bit RISC core operating at a 72 MHz frequency, high-speed embedded memories (256 Kbytes of Flash memory and 48 Kbytes of SRAM).  (1) MAX3485 is designed for half-duplex communication, which meets the requirements of this project.
(2) Based on the research purpose of this project, that is, to increase the communication rate of the rs485 bus, we plan to curb electromagnetic interference and terminal reflections during signal transmission. In order to solve this problem, we will choose a chip with a driver designed in Slew-Rate-Limited so as not to generate excessive high frequency components on the transmission line [4] (3) The MAX3485 transmits at up to 10Mbps. (4) The MAX3485 chip is a 3.3V low-power serial port chip produced by MAXIM. It contains a driver and a transceiver, with a slew rate limiting drive, which can minimize EMl and reflected current caused by improper cable connection [5]. The parasitic parameters of SMD components are small. If the component selects the in-line type instead of the patch type, the parasitic capacitance will be increased when the hole is punched, and the signal will be distorted.

Voltage regulator chip.
The reason why we choose the SMD type voltage regulator chip packaged as AMS1117 is as follows: (1) Since the power supply is 5V, and the normal operation of STM32F103RCT6 requires a stable 3.3V rated voltage, we need a voltage regulator chip to generate 3.3V for the main controller.
(2) AMS1117 has current limit, thermal protection and 0.4% typical load regulation rate, stable output voltage of 3.3V, the maximum error is less than 2% [6].
(3) The parasitic parameters of SMD components are small. If the component selects the in-line type instead of the patch type, the parasitic capacitance will be increased when the hole is punched, and the signal will be distorted. 2.1.5. Human-computer interaction. In order to build the circuit and adjust the parameters conveniently, we designed 2 LED lights and 1 switches. We have written related programs. After

Schematic design
The complete schematic diagram is as follows: Figure 6. Complete schematic-1.

PCB design
After completing the component selection and schematic drawing, we completed the PCB circuit drawing.
The PCB circuit diagram is as follows: After completing the component selection and schematic drawing, we completed the PCB circuit The PCB circuit diagram is as follows:

Component list
The list of components is as follows: Figure 9. Component list.

Conclusion
The completion of the project "Increase the communication speed of the 485 bus" is based on the successful design of the microcontroller. Through comprehensive consideration, we chose STM32F103RCT6 as the main controller, MAX3485 as the serial port chip, AMS1117 as the serial port chip, and other external devices according to the needs.