485 repeater based on MCU control
Technical Field
The utility model relates to a RS485 communication technology field, concretely relates to 485 repeaters based on MCU control that can be used to between geological disaster equipment terminal and the sensor.
Background
The 485 repeater is an optical isolation RS-485/422 data relay communication product, can relay and prolong the communication distance of an RS-485/422 bus network, and enhances the number of RS-485/422 bus network devices. The 485 bus can be subjected to photoelectric isolation to prevent common-mode voltage interference. And automatic switching between the RS-485 bus and the RS-422 bus can be supported.
Although the 485 repeater is very mature in technology and very strong in anti-interference capability, the 485 repeater is high in required cost, poor in waterproof performance, high in installation complexity and high in power consumption, and is not beneficial to installation and various indexes of geological disaster monitoring equipment. The 485 repeater is used for connecting between a geological disaster device terminal and a sensor, the repeater in the field adopts a screw type wiring mode at present, the connection mode is not beneficial to field installation, and the waterproofness is not good. Because the interface of the existing 485 repeater cannot be matched with the seven-core interface, the equipment installation complexity is high, the power consumption is high, and the cost is high.
And because the existing geological disaster monitoring equipment is limited by the environment and various conditions of field installation, and the distances between partial sensors and the remote terminal unit are far, the phenomena of unstable signal transmission, impedance mismatching and data accuracy reduction occur, and a repeater which can adapt to the existing field installation environment and increase the distance of signal transmission and the data accuracy is urgently needed.
SUMMERY OF THE UTILITY MODEL
The utility model provides a 485 repeaters based on MCU control aims at one of the technical problem who solves to be: for increasing the distance of signal transmission and the accuracy of the data.
In view of the above problems in the prior art, according to the present invention, the present invention adopts the following technical solutions:
an MCU control based 485 repeater, comprising:
the transceiver U1 and the transceiver U2, the transceiver U1 and the transceiver U2 are both in a receiving state when no data is transmitted, when data is transmitted, one of the transceiver U1 and the transceiver U2 is used for receiving data and outputting the data to the MCU unit, and the other of the transceiver U1 and the transceiver U2 is used for receiving the data processed by the MCU unit and transmitting the data;
and the MCU is respectively connected with the transceiver U1 and the transceiver U2 and is used for controlling the transceiving period of data by utilizing the timing of a timer, transmitting information by data according to bits, amplifying an attenuation signal and keeping the attenuation signal the same as the original data.
In order to better realize the utility model discloses, further technical scheme is:
further, the transceiver U1 employs a MAX485 chip.
Further, the transceiver U2 employs a MAX485 chip.
Furthermore, the MCU unit adopts a singlechip.
Further, the single chip microcomputer is a 51 single chip microcomputer.
Furthermore, the interface of external equipment adopts seven-core waterproof aviation wiring terminal.
Furthermore, the MCU unit adopts an STC15W104 chip.
Further, still include:
and the voltage reduction chip U3 is connected with the transceiver U1 and the transceiver U2 through a voltage reduction circuit and is used for reducing the voltage for supplying power to the transceiver U1, the transceiver U2 and the MCU unit.
Further, the voltage reduction chip U3 adopts an LM1117 chip.
Compared with the prior art, one of the beneficial effects of the utility model is that:
the utility model discloses a 485 repeater based on MCU control adopts MCU control mode, is applicable to the noise interference that reduces seven core wiring end communication equipment and produces when carrying out RS485 communication to increase signal transmission's distance and the rate of accuracy of data; the seven-core waterproof aviation wiring terminal is adopted, can be matched with an interface head of equipment, is convenient to install on site and has good waterproof performance; and the structure is simple, the power consumption is low, and the cost is low.
Drawings
For a clearer explanation of the embodiments or technical solutions in the prior art of the present application, the drawings used in the description of the embodiments or prior art will be briefly described below, it is obvious that the drawings in the following description are only references to some embodiments in the present application, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a block diagram of a 485 repeater based on MCU control according to an embodiment of the present invention.
Fig. 2 is a block diagram of a 485 repeater based on MCU control according to another embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to examples, but the embodiments of the present invention are not limited thereto.
Referring to fig. 1, an MCU control-based 485 repeater includes:
the transceiver U1 and the transceiver U2, the transceiver U1 and the transceiver U2 are both in a receiving state when no data are transmitted, when data are transmitted, one of the transceiver U1 and the transceiver U2 is used for receiving data and outputting the data to the MCU unit, and the other of the transceiver U1 and the transceiver U2 is used for receiving the data processed by the MCU unit and transmitting the data;
and the MCU is respectively connected with the transceiver U1 and the transceiver U2 and is used for controlling the transceiving period of data by utilizing the timing of a timer, transmitting information by data according to bits, amplifying an attenuation signal and keeping the attenuation signal the same as the original data.
The transceiver U1 and the transceiver U2 may preferably be MAX485 chips, but are not limited thereto.
The U1, U2 shown in fig. 1 may be two identical MAX485, one responsible for receiving data from one end of the bus and the other responsible for forwarding data to the other end of the bus. The MCU unit preferably adopts a singlechip, the timing is more accurate by the singlechip, the communication time interval between two bytes is not required to be larger than the communication time of one byte of data, and the high-speed smoothness of the bus can be ensured.
The main control chip can adopt STC15W104, and has simple structure, function meeting the design requirement and low cost. The MAX485 can carry out half-duplex communication and is responsible for receiving and transmitting signals, and as the sensor is required to send data to the remote terminal unit and the remote terminal unit also sends data to the sensor in the geological disaster monitoring equipment, the two MAX485 are required to be combined to realize the functions of bidirectional sending and receiving.
The adaptive baud rate range of the repeater is 1200 bps-115200 bps, the adaptive baud rate can be automatically matched with the baud rate according to input data and then output, and double-end input and output of different baud rates can be realized.
Because the distance is overlength between sensor and the terminal, the signal power of transmission can attenuate gradually on the circuit, and the signal distortion will appear to the decay to a certain degree, and secondly equipment fixing can use the transmission line of different materials to impedance unmatched problem appears, consequently can lead to the wrong or data that can not receive of received data, the repeater is exactly designed for solving this problem. The working principle of the method is that a timer is used for controlling the receiving and sending period of data in a timing mode to transmit information according to bits, attenuation signals are amplified, and the attenuation signals are kept the same as original data.
The single chip microcomputer can be a 51 single chip microcomputer and the like.
As shown in fig. 2, the present invention may further include a voltage-reducing chip U3, which is connected to the transceiver U1 and the transceiver U2 through a voltage-reducing circuit, for reducing the voltage supplied to the transceiver U1, the transceiver U2, and the MCU unit. The buck chip U3 includes but is not limited to LM1117 chip. The terminal equipment is powered by 12V, the MCU of the repeater only needs to be powered by 3.3V voltage, and the normal work of the repeater is ensured by reducing the 12V voltage to 3.3V voltage through the voltage reduction circuit controlled by the LM1117 voltage reduction chip.
The interface of the 485 repeater controlled by the MCU to the external equipment can adopt a seven-core waterproof aviation wiring terminal.
To sum up, through the utility model discloses can reduce the high frequency interference that special interface communication equipment produced when carrying out RS485 communication to increase signal transmission's distance and the rate of accuracy of data.
The embodiments are described in a progressive manner in the specification, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
Reference throughout this specification to "one embodiment," "another embodiment," "an embodiment," etc., means that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment described generally in this application. The appearances of the same phrase in various places in the specification are not necessarily all referring to the same embodiment. Further, when a particular feature, structure, or characteristic is described in connection with any embodiment, it is submitted that it is within the scope of the invention to effect such feature, structure, or characteristic in connection with other embodiments.
Although the invention has been described herein with reference to a number of illustrative embodiments thereof, it should be understood that numerous other modifications and embodiments can be devised by those skilled in the art that will fall within the scope and spirit of the principles of this disclosure. More specifically, various variations and modifications are possible in the component parts and/or arrangements of the subject combination arrangement within the scope of the disclosure and claims of this application. In addition to variations and modifications in the component parts and/or arrangements, other uses will also be apparent to those skilled in the art.