485 bus configuration address circuit
By designing the 485 bus configuration address circuit and adopting the nearest principle to connect devices, the problem of poor flexibility of the traditional RS-485 bus is solved, flexible configuration and fault detection of devices are achieved, and the stability of the system is improved.
Patent Information
- Application Number
- CN202422420343.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Utility models(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-08
- Publication Date
- 2025-09-23
- Estimated Expiration
- 2034-10-08
AI Technical Summary
Traditional RS-485 bus matching adopts a bus-type structure, which has poor flexibility, cannot move and connect devices at will, and is difficult to detect device failures in a timely manner.
A 485 bus address configuration circuit is designed, which includes a control host, slave devices, and the first and second connection circuits. The nearest connection principle is adopted. The slave device closest to the control host is matched with the address first, and the other devices are matched in turn. Input and output ports are added to achieve flexible configuration and fault detection.
It enables flexible movement and access of equipment, timely detection of faulty equipment, and improves the stability and flexibility of the system.
Smart Images

Figure CN223377728U_ABST
Abstract
Description
Technical Field
[0001] The utility model relates to the field of 485 bus circuits, in particular to the field of a 485 bus configuration address circuit. Background Art
[0002] The RS-485 bus is a serial communication standard based on differential signal transmission. It usually transmits data through two signal lines to achieve multi-point communication.
[0003] The traditional RS-485 bus matching adopts a bus-type structure, connecting each node in series through a bus; this type of communication is a master-slave mode, that is, the master station visits the slave station in turn.
[0004] In actual applications, the structure is relatively fixed and has poor flexibility, and cannot be moved or connected at will; if the equipment fails, it cannot be found in time. Utility Model Content
[0005] In order to overcome the above technical defects, the utility model provides a 485 bus configuration address circuit.
[0006] In order to solve the above problems, the present invention is implemented according to the following technical solutions:
[0007] The 485 bus configuration address circuit of the utility model includes a control host; a plurality of slave devices, wherein the plurality of slave devices are connected in sequence, and one of the slave devices is connected to the control host;
[0008] a first connecting circuit, the first connecting circuit being connected to the control host and the slave device respectively;
[0009] a plurality of second connection circuits, wherein the plurality of second connection circuits are used for connecting between the plurality of slave devices;
[0010] Wherein, the first connection circuit includes a first regulated power supply, a first 485A line, a first 485B line, a first input terminal and a first output terminal connected to the control host and the slave device respectively;
[0011] Each second connection circuit includes a second regulated power supply, a second 485A line, a second 485B line, a second input end, and a second output end connected to two slave devices respectively.
[0012] Furthermore, the first connection circuit also includes a main control module, a 485 circuit, a power control module, an output control and output detection circuit, a latch circuit and an LED display circuit.
[0013] Furthermore, the main control module includes a single chip microcomputer, a first resistor, a second resistor, a first capacitor, a second capacitor, a third capacitor, a crystal oscillator and a first four-hole terminal;
[0014] Pin 1 of the first four-hole terminal is connected to the SWDIO pin of the microcontroller, pin 2 of the first four-hole terminal is grounded, pin 3 of the first four-hole terminal is connected to the SWCLK pin of the microcontroller, and pin 4 of the first four-hole terminal is connected to a 3.3V power supply;
[0015] The VDD_1 pin of the single-chip microcomputer is connected to one side of the first resistor and to a 3.3V power supply; the other side of the first resistor is respectively connected to one side of the third capacitor and the NRST pin of the single-chip microcomputer, and the other side of the third capacitor is grounded;
[0016] The crystal oscillator is connected to the PF1 / OSC OUT pin of the single-chip microcomputer via the PF0 / OSC IN pin of the single-chip microcomputer;
[0017] One side of the first capacitor is connected to the ground, and the other side of the first capacitor is connected to the PF0 / OSCIN pin of the microcontroller;
[0018] One side of the second capacitor is connected to the ground, and the other side of the second capacitor is connected to the PF1 / OSCOUT pin of the microcontroller;
[0019] The VSSA pin of the single chip microcomputer, the VSS_1 pin of the single chip microcomputer and the VSS_2 pin of the single chip microcomputer are all grounded;
[0020] The VDD_2 pin and the VDD_3 pin of the single chip microcomputer are respectively connected to a 3.3V power supply;
[0021] One side of the second resistor is connected to the ground, and the other side of the second resistor is connected to the BOOT0 pin of the single chip microcomputer.
[0022] Furthermore, the 485 circuit includes a third resistor, a fourth resistor, a fifth resistor, a sixth resistor, a seventh resistor, an eighth resistor, a ninth resistor, an NPN transistor, an RS485 transceiver, a first Zener diode, a second Zener diode, a third Zener diode and a three-hole terminal;
[0023] The RX pin of the RS485 transceiver is connected to the UART2RXD pin of the single-chip microcomputer, the TX pin of the RS485 transceiver is connected to the UART2TXD pin of the single-chip microcomputer, and the GND pin of the RS485 transceiver is connected to the ground;
[0024] One side of the eighth resistor is connected to the TX pin of the RS485 transceiver, the other side of the eighth resistor is connected to the base of the NPN transistor, and the emitter of the NPN transistor is grounded;
[0025] One side of the third resistor is connected to the TE pin of the RS485 transceiver, the RE pin of the RS485 transceiver and the collector of the NPN transistor respectively, and the other side of the third resistor is connected to a 3.3V power supply;
[0026] One side of the fourth resistor and the VCC pin of the RS485 transceiver are connected to a 3.3V power supply, and the other side of the fourth resistor is connected to the A pin of the RS485 transceiver;
[0027] The first Zener diode, the second Zener diode and the third Zener diode are sequentially connected in series, and the first Zener diode and the third Zener diode are both grounded;
[0028] One side of the fifth resistor is connected to the A pin of the RS485 transceiver, and the other side of the fifth resistor is connected to the connection point between the first Zener diode and the second Zener diode;
[0029] One side of the seventh resistor is connected to the B pin of the RS485 transceiver, and the other side of the seventh resistor is connected to the connection point between the second Zener diode and the third Zener diode;
[0030] One side of the sixth resistor is connected to the connection point between the first Zener diode and the second Zener diode, and the other end of the sixth resistor is connected to the second pin of the three-hole terminal;
[0031] One side of the ninth resistor is connected to the B pin of the RS485 transceiver, and the other side of the ninth resistor is connected to the ground;
[0032] The third pin of the three-hole terminal is connected to the connection point between the second Zener diode and the third Zener diode.
[0033] Furthermore, the power control circuit includes a fourth capacitor, a fifth capacitor, a sixth capacitor, a seventh capacitor, an eighth capacitor, a ninth capacitor, a tenth capacitor, an eleventh capacitor, a twelfth capacitor, a thirteenth capacitor, a fourteenth capacitor, a fifteenth capacitor, a first light-emitting diode, a first Schottky diode, a second Schottky diode, a relay, a first electrolytic capacitor, a second electrolytic capacitor, a transient voltage suppressor diode, a DC-DC power supply chip, a tenth resistor, an eleventh resistor, a twelfth resistor, an inductor and a forward low-dropout voltage regulator;
[0034] The eighth capacitor, the ninth capacitor, the tenth capacitor, the eleventh capacitor, and the twelfth capacitor are connected in parallel, and one side of the eighth capacitor is connected to a positive power supply of 3.3V, and one side of the twelfth capacitor is grounded;
[0035] The fourth capacitor, the sixth capacitor, and the seventh capacitor are connected in parallel, one side of the fourth capacitor is connected to a positive power supply 3.3V, and one side of the seventh capacitor is grounded;
[0036] The positive electrode of the first light-emitting diode is connected to a 3.3V power supply, the negative electrode of the first light-emitting diode is connected to one side of the eleventh resistor, and the other side of the eleventh resistor is grounded;
[0037] The positive electrode of the first Schottky diode is connected to a 24V power supply, and the negative electrode of the first Schottky diode is connected to one end of the relay;
[0038] The transient voltage suppressor diode, the first electrolytic capacitor, the fourteenth capacitor and the fifteenth capacitor are connected in parallel, and the negative electrode of the first electrolytic capacitor is grounded;
[0039] The enable terminal of the DC-DC power supply chip and the four ground pins of the DC-DC power supply chip are grounded;
[0040] One side of the twelfth resistor is connected to the FB pin of the DC-DC power supply chip, and the other side of the twelfth resistor is connected to the ground;
[0041] One side of the thirteenth capacitor is connected to the FB pin of the DC-DC power supply chip, and the other side of the thirteenth capacitor is connected to a 5V power supply;
[0042] One side of the tenth resistor is connected to the FB pin of the DC-DC power supply chip, and the other side of the tenth resistor is connected to a 5V power supply;
[0043] The cathode of the second Schottky diode is connected to the OUT pin of the DC-DC power supply chip, and the anode of the second Schottky diode is grounded;
[0044] One side of the inductor is connected to the OUT pin of the DC-DC power supply chip, and the other side of the inductor is connected to a 5V power supply;
[0045] One side of the fifth capacitor is connected to a 5V power supply, and the other side of the fifth capacitor is grounded;
[0046] The positive electrode of the second electrolytic capacitor is connected to a 5V power supply, and the negative electrode of the second electrolytic capacitor is grounded;
[0047] The input end of the forward low-dropout voltage regulator is connected to a 5V power supply, the two output ends of the forward low-dropout voltage regulator are connected to a 3.3V source, and the ground end of the forward low-dropout voltage regulator is connected to the ground.
[0048] Furthermore, the output control and input detection circuit includes: a second four-hole terminal, a six-hole terminal, a twelve-hole terminal, a thirteenth resistor, a fourteenth resistor, a fifteenth resistor, a sixteenth resistor, a seventeenth resistor, a first photocoupler, and a second photocoupler;
[0049] The first port of the second four-hole terminal is connected to 3.3V, the second port of the second four-hole terminal is connected to the UART1TXD pin of the single-chip microcomputer, the third port of the second four-hole terminal is connected to the UART1RXD pin of the single-chip microcomputer, and the fourth port of the second four-hole terminal is grounded;
[0050] The first port of the six-hole terminal is connected to a 24V power supply, the second port of the six-hole terminal and the fifth port of the six-hole terminal are grounded, the third port of the six-hole terminal is connected to a connection point between the first Zener diode and the second Zener diode, and the fourth port of the six-hole terminal is connected to a connection point between the second Zener diode and the third Zener diode;
[0051] The seventh port of the twelve-hole terminal is connected to a 24V power supply, the eighth port of the twelve-hole terminal and the eleventh port of the twelve-hole terminal are grounded, and the twelfth port of the twelve-hole terminal is connected to the sixth pin of the first photocoupler;
[0052] One side of the thirteenth resistor is connected to the PA15 pin of the single chip microcomputer, and the other side of the thirteenth resistor is connected to the first pin of the first photocoupler, and the first pin of the first photocoupler is connected to a 3.3V power supply;
[0053] One side of the fourteenth resistor is connected to the PA15 pin of the single chip microcomputer, and the other side of the fourteenth resistor is connected to the third pin of the first photocoupler;
[0054] One side of the fifteenth resistor is connected to the sixth pin of the first photocoupler, and the other side of the fifteenth resistor is connected to a 3.3V power supply;
[0055] One side of the sixteenth resistor is connected to the twelfth port of the twelve-hole terminal, and the other side of the sixteenth resistor is connected to the third pin of the second photoelectric coupler;
[0056] One side of the seventeenth resistor is connected to the sixth pin of the second photoelectric coupler, and the other side of the seventeenth resistor is connected to a 3.3V power supply;
[0057] The first pin of the second photocoupler is connected to a 3.3V power supply, the fourth pin is grounded, and the sixth pin of the second photocoupler is connected to the PA1 pin of the microcontroller.
[0058] Furthermore, the latch circuit includes an eighteenth resistor, a nineteenth resistor, a twentieth resistor, a twenty-first resistor, a twenty-second resistor, a twenty-third resistor, a sixteenth capacitor, a seventeenth capacitor, a first output latch, and a second output latch;
[0059] One side of the eighteenth resistor is connected to one side of the nineteenth resistor, a connection point between the eighteenth resistor and the nineteenth resistor is connected to the OE pin of the first output latch, the other side of the eighteenth resistor is connected to a 3.3V power supply, and the other side of the nineteenth resistor is grounded;
[0060] One side of the 20th resistor is connected to one side of the 16th capacitor, a connection point between the 20th resistor and the 16th capacitor is connected to the RESET pin of the first output latch, the other side of the 20th resistor is connected to a 3.3V power supply, and the other side of the 16th capacitor is grounded;
[0061] The VCC pin of the first output latch is connected to a 3.3V power supply, the GND pin of the first output latch is connected to the ground, the RESET pin of the first output latch is connected to the PA8 pin of the single-chip microcomputer, the OE pin of the first output latch is connected to the PB13 pin of the single-chip microcomputer, the SHIFT CLOCK pin of the first output latch is connected to the PB15 pin of the single-chip microcomputer, the LATCH CLOCK pin of the first output latch is connected to the PB14 pin of the single-chip microcomputer, the A pin of the first output latch is connected to the PA11 pin of the single-chip microcomputer, and the SQH pin of the first output latch is connected to the A pin of the second output latch;
[0062] One side of the twenty-first resistor is connected to one side of the twenty-second resistor, a connection point between the twenty-first resistor and the twenty-second resistor is connected to the OE pin of the second output latch, the other side of the twenty-second resistor is connected to a 3.3V power supply, and the other side of the twenty-first resistor is grounded;
[0063] One side of the twenty-third resistor is connected to one side of the seventeenth capacitor, a connection point between the twenty-third resistor and the seventeenth capacitor is connected to the RESET pin of the second output latch, the other side of the twenty-third resistor is connected to a 3.3V power supply, and the other side of the seventeenth capacitor is grounded;
[0064] The VCC pin of the second output latch is connected to a 3.3V power supply, the GND pin of the second output latch is connected to the ground, the RESET pin of the second output latch is connected to the PA8 pin of the microcontroller, the OE pin of the second output latch is connected to the PB13 pin of the microcontroller, the SHIFT CLOCK pin of the second output latch is connected to the PB15 pin of the microcontroller, and the LATCH CLOCK pin of the second output latch is connected to the PB14 pin of the microcontroller.
[0065] Furthermore, the LED display circuit includes nineteen 1K resistors and nineteen second light-emitting diodes, and one side of each 1K resistor is correspondingly connected to the positive electrode of one of the second light-emitting diodes.
[0066] The other sides of the nineteen 1K resistors are connected one-to-one to the eight parallel output terminals of the first latch, the eight parallel output terminals of the second output latch, the PC15 pin of the single-chip microcomputer, the PC14 pin of the single-chip microcomputer, and the PC13 pin of the single-chip microcomputer;
[0067] The cathodes of the nineteen second light emitting diodes are all grounded.
[0068] Compared with the prior art, the beneficial effects of the present invention are: a control host; multiple slave devices, which are connected in sequence, and one of the slave devices is connected to the control host; a first connection circuit, which is respectively connected to the control host and the slave device; multiple second connection circuits, which are used for connections between multiple slave devices; wherein the first connection circuit includes a first regulated power supply, a first 485A line, a first 485B line, a first input end and a first output end connected to the control host and the slave device respectively; each second connection circuit includes a second regulated power supply, a second 485A line, a second 485B line, a second input end and a second output end connected to two slave devices respectively.
[0069] The working principle of the configuration address described in the present invention is: the device connection adopts the principle of proximity; the first output end of the control host is connected to the first input end of one of the devices for address matching, and a low-level matching method is adopted. The device connected to the control host is the device closest to the control host; the second output ends of the multiple second connection circuits transmit the address matching information to the second input end, and a low-level matching method is also adopted. The device at the second output end is the slave device connected to the control host, and the slave device here serves as the control host.
[0070] This patent adopts the method of adding an input port and an output port to control the configuration address of the device. Multiple devices are connected in sequence, and the control host is connected to the slave device closest to the host. The connection principle of other slave devices is also to choose the connection close to the slave device acting as the host. With this connection method, it is possible to detect in time which host has a fault, and the device can be moved and connected at will. BRIEF DESCRIPTION OF THE DRAWINGS
[0071] The specific embodiments of the present invention will be further described in detail below with reference to the accompanying drawings, wherein:
[0072] Figure 1 This is a circuit diagram of the main control module of the utility model;
[0073] Figure 2 This is a schematic diagram of the 485 circuit of the utility model;
[0074] Figure 3 This is a circuit diagram of the power control module of the utility model;
[0075] Figure 4 This is a schematic diagram of the output control and output detection circuit of the utility model;
[0076] Figure 5 This is a schematic diagram of a latch circuit of the present utility model;
[0077] Figure 6 This is a schematic diagram of the LED display circuit of the present utility model.
[0078] In the figure: 1-main control module; 2-485 circuit; 3-power control module; 4-output control and output detection circuit; 5-latch circuit; 6-LED display circuit. DETAILED DESCRIPTION
[0079] The preferred embodiments of the present invention are described below in conjunction with the accompanying drawings. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present invention and are not used to limit the present invention.
[0080] like Figures 1 to 6 As shown, a 485 bus configuration address circuit described in the utility model.
[0081] A plurality of slave devices, wherein the plurality of slave devices are connected in sequence, and one of the slave devices is connected to the control host;
[0082] a first connecting circuit, the first connecting circuit being connected to the control host and the slave device respectively;
[0083] a plurality of second connection circuits, wherein the plurality of second connection circuits are used for connecting between the plurality of slave devices;
[0084] Wherein, the first connection circuit includes a first regulated power supply, a first 485A line, a first 485B line, a first input terminal and a first output terminal connected to the control host and the slave device respectively;
[0085] Each second connection circuit includes a second regulated power supply connected to two slave devices respectively, a second 485A line, a second 485B line, a second input end and a second output end.
[0086] The slave device connected to the control host is the device closest to the host, and the principle of connecting the multiple slave devices is also the closest connection principle.
[0087] The address matching of the present invention adds an input and output port, the output port is used to transmit the high and low levels of the address matching signal, and the input port is used to receive the information transmitted by the output port.
[0088] Among them, the address matching of the one slave device is that the control host sends the address matching information to the one slave device through the first input terminal, and the addresses of the other slave devices are matched by their last connected slave device; such a matching method can move and access devices at will, and its stability is relatively strong; during the address matching process, if the slave device suddenly fails to match the corresponding address, then the corresponding device fails; this makes it easy to find the faulty device in time.
[0089] The control host can send information to the multiple slave devices. The multiple slave devices have a memory storage function during the address matching process and only need to match the address once.
[0090] like Figure 1 As shown, the main control module includes a single chip microcomputer, a first resistor, a second resistor, a first capacitor, a second capacitor, a third capacitor, a crystal oscillator and a first four-hole terminal;
[0091] Pin 1 of the first four-hole terminal is connected to the SWDIO pin of the microcontroller, pin 2 of the first four-hole terminal is grounded, pin 3 of the first four-hole terminal is connected to the SWCLK pin of the microcontroller, and pin 4 of the first four-hole terminal is connected to a 3.3V power supply;
[0092] The VDD_1 pin of the single-chip microcomputer is connected to one side of the first resistor and to a 3.3V power supply; the other side of the first resistor is respectively connected to one side of the third capacitor and the NRST pin of the single-chip microcomputer, and the other side of the third capacitor is grounded;
[0093] The crystal oscillator is connected to the PF1 / OSC OUT pin of the single-chip microcomputer via the PF0 / OSC IN pin of the single-chip microcomputer;
[0094] One side of the first capacitor is connected to the ground, and the other side of the first capacitor is connected to the PF0 / OSCIN pin of the microcontroller;
[0095] One side of the second capacitor is connected to the ground, and the other side of the second capacitor is connected to the PF1 / OSCOUT pin of the microcontroller;
[0096] The VSSA pin of the single chip microcomputer, the VSS_1 pin of the single chip microcomputer and the VSS_2 pin of the single chip microcomputer are all grounded;
[0097] The VDD_2 pin and the VDD_3 pin of the single chip microcomputer are respectively connected to a 3.3V power supply;
[0098] One side of the second resistor is connected to the ground, and the other side of the second resistor is connected to the BOOT0 pin of the single chip microcomputer.
[0099] The main control module controls the information transmission of the 485 circuit, the input and output of the address matching signal, and the display function of the LED circuit.
[0100] like Figure 2 As shown, the 485 circuit includes a third resistor, a fourth resistor, a fifth resistor, a sixth resistor, a seventh resistor, an eighth resistor, a ninth resistor, an NPN transistor, an RS485 transceiver, a first Zener diode, a second Zener diode, a third Zener diode and a three-hole terminal;
[0101] The RX pin of the RS485 transceiver is connected to the UART2RXD pin of the single-chip microcomputer, the TX pin of the RS485 transceiver is connected to the UART2TXD pin of the single-chip microcomputer, and the GND pin of the RS485 transceiver is connected to the ground;
[0102] One side of the eighth resistor is connected to the TX pin of the RS485 transceiver, the other side of the eighth resistor is connected to the base of the NPN transistor, and the emitter of the NPN transistor is grounded;
[0103] One side of the third resistor is connected to the TE pin of the RS485 transceiver, the RE pin of the RS485 transceiver and the collector of the NPN transistor respectively, and the other side of the third resistor is connected to a 3.3V power supply;
[0104] One side of the fourth resistor and the VCC pin of the RS485 transceiver are connected to a 3.3V power supply, and the other side of the fourth resistor is connected to the A pin of the RS485 transceiver;
[0105] The first Zener diode, the second Zener diode and the third Zener diode are sequentially connected in series, and the first Zener diode and the third Zener diode are both grounded;
[0106] One side of the fifth resistor is connected to the A pin of the RS485 transceiver, and the other side of the fifth resistor is connected to the connection point between the first Zener diode and the second Zener diode;
[0107] One side of the seventh resistor is connected to the B pin of the RS485 transceiver, and the other side of the seventh resistor is connected to the connection point between the second Zener diode and the third Zener diode;
[0108] One side of the sixth resistor is connected to the connection point between the first Zener diode and the second Zener diode, and the other end of the sixth resistor is connected to the second pin of the three-hole terminal;
[0109] One side of the ninth resistor is connected to the B pin of the RS485 transceiver, and the other side of the ninth resistor is connected to the ground;
[0110] The third pin of the three-hole terminal is connected to the connection point between the second Zener diode and the third Zener diode.
[0111] The 485 circuit outputs corresponding data through the main control module, and transmits the corresponding matching address to the slave device connected to the control host through the 485 bus.
[0112] The working principle of the 485 circuit described in the present invention is: the circuit is based on differential signal transmission; 485 uses two signal lines to transmit differential signals, and determines whether the data bit is 0 or 1 by detecting the voltage difference between the two lines.
[0113] like Figure 3 As shown, the power control circuit includes a fourth capacitor, a fifth capacitor, a sixth capacitor, a seventh capacitor, an eighth capacitor, a ninth capacitor, a tenth capacitor, an eleventh capacitor, a twelfth capacitor, a thirteenth capacitor, a fourteenth capacitor, a fifteenth capacitor, a first light-emitting diode, a first Schottky diode, a second Schottky diode, a relay, a first electrolytic capacitor, a second electrolytic capacitor, a transient voltage suppressor diode, a DC-DC power supply chip, a tenth resistor, an eleventh resistor, a twelfth resistor, an inductor and a forward low-dropout voltage regulator;
[0114] The eighth capacitor, the ninth capacitor, the tenth capacitor, the eleventh capacitor, and the twelfth capacitor are connected in parallel, and one side of the eighth capacitor is connected to a positive power supply of 3.3V, and one side of the twelfth capacitor is grounded;
[0115] The fourth capacitor, the sixth capacitor, and the seventh capacitor are connected in parallel, one side of the fourth capacitor is connected to a positive power supply 3.3V, and one side of the seventh capacitor is grounded;
[0116] The positive electrode of the first light-emitting diode is connected to a 3.3V power supply, the negative electrode of the first light-emitting diode is connected to one side of the eleventh resistor, and the other side of the eleventh resistor is grounded;
[0117] The positive electrode of the first Schottky diode is connected to a 24V power supply, and the negative electrode of the first Schottky diode is connected to one end of the relay;
[0118] The transient voltage suppressor diode, the first electrolytic capacitor, the fourteenth capacitor and the fifteenth capacitor are connected in parallel, and the negative electrode of the first electrolytic capacitor is grounded;
[0119] The enable terminal of the DC-DC power supply chip and the four ground pins of the DC-DC power supply chip are grounded;
[0120] One side of the twelfth resistor is connected to the FB pin of the DC-DC power supply chip, and the other side of the twelfth resistor is connected to the ground;
[0121] One side of the thirteenth capacitor is connected to the FB pin of the DC-DC power supply chip, and the other side of the thirteenth capacitor is connected to a 5V power supply;
[0122] One side of the tenth resistor is connected to the FB pin of the DC-DC power supply chip, and the other side of the tenth resistor is connected to a 5V power supply;
[0123] The cathode of the second Schottky diode is connected to the OUT pin of the DC-DC power supply chip, and the anode of the second Schottky diode is grounded;
[0124] One side of the inductor is connected to the OUT pin of the DC-DC power supply chip, and the other side of the inductor is connected to a 5V power supply;
[0125] One side of the fifth capacitor is connected to a 5V power supply, and the other side of the fifth capacitor is grounded;
[0126] The positive electrode of the second electrolytic capacitor is connected to a 5V power supply, and the negative electrode of the second electrolytic capacitor is grounded;
[0127] The input end of the forward low-dropout voltage regulator is connected to a 5V power supply, the two output ends of the forward low-dropout voltage regulator are connected to a 3.3V source, and the ground end of the forward low-dropout voltage regulator is connected to the ground.
[0128] The power control circuit converts the 24V power supply into a 5V power supply through a DC-DC power supply chip, and then converts it into 3.3V through a forward low-dropout voltage regulator.
[0129] like Figure 4 As shown, the output control and input detection circuit includes: a second four-hole terminal, a six-hole terminal, a twelve-hole terminal, a thirteenth resistor, a fourteenth resistor, a fifteenth resistor, a sixteenth resistor, a seventeenth resistor, a first photocoupler, and a second photocoupler;
[0130] The first port of the second four-hole terminal is connected to 3.3V, the second port of the second four-hole terminal is connected to the UART1TXD pin of the single-chip microcomputer, the third port of the second four-hole terminal is connected to the UART1RXD pin of the single-chip microcomputer, and the fourth port of the second four-hole terminal is grounded;
[0131] The first port of the six-hole terminal is connected to a 24V power supply, the second port of the six-hole terminal and the fifth port of the six-hole terminal are grounded, the third port of the six-hole terminal is connected to a connection point between the first Zener diode and the second Zener diode, and the fourth port of the six-hole terminal is connected to a connection point between the second Zener diode and the third Zener diode;
[0132] The seventh port of the twelve-hole terminal is connected to a 24V power supply, the eighth port of the twelve-hole terminal and the eleventh port of the twelve-hole terminal are grounded, and the twelfth port of the twelve-hole terminal is connected to the sixth pin of the first photocoupler;
[0133] One side of the thirteenth resistor is connected to the PA15 pin of the single chip microcomputer, and the other side of the thirteenth resistor is connected to the first pin of the first photocoupler, and the first pin of the first photocoupler is connected to a 3.3V power supply;
[0134] One side of the fourteenth resistor is connected to the PA15 pin of the single chip microcomputer, and the other side of the fourteenth resistor is connected to the third pin of the first photocoupler;
[0135] One side of the fifteenth resistor is connected to the sixth pin of the first photocoupler, and the other side of the fifteenth resistor is connected to a 3.3V power supply;
[0136] One side of the sixteenth resistor is connected to the twelfth port of the twelve-hole terminal, and the other side of the sixteenth resistor is connected to the third pin of the second photoelectric coupler;
[0137] One side of the seventeenth resistor is connected to the sixth pin of the second photoelectric coupler, and the other side of the seventeenth resistor is connected to a 3.3V power supply;
[0138] The first pin of the second photocoupler is connected to a 3.3V power supply, the fourth pin is grounded, and the sixth pin of the second photocoupler is connected to the PA1 pin of the microcontroller.
[0139] like Figure 5 As shown, the latch circuit includes an eighteenth resistor, a nineteenth resistor, a twentieth resistor, a twenty-first resistor, a twenty-second resistor, a twenty-third resistor, a sixteenth capacitor, a seventeenth capacitor, a first output latch, and a second output latch;
[0140] One side of the eighteenth resistor is connected to one side of the nineteenth resistor, a connection point between the eighteenth resistor and the nineteenth resistor is connected to the OE pin of the first output latch, the other side of the eighteenth resistor is connected to a 3.3V power supply, and the other side of the nineteenth resistor is grounded;
[0141] One side of the 20th resistor is connected to one side of the 16th capacitor, a connection point between the 20th resistor and the 16th capacitor is connected to the RESET pin of the first output latch, the other side of the 20th resistor is connected to a 3.3V power supply, and the other side of the 16th capacitor is grounded;
[0142] The VCC pin of the first output latch is connected to a 3.3V power supply, the GND pin of the first output latch is connected to the ground, the RESET pin of the first output latch is connected to the PA8 pin of the single-chip microcomputer, the OE pin of the first output latch is connected to the PB13 pin of the single-chip microcomputer, the SHIFT CLOCK pin of the first output latch is connected to the PB15 pin of the single-chip microcomputer, the LATCH CLOCK pin of the first output latch is connected to the PB14 pin of the single-chip microcomputer, the A pin of the first output latch is connected to the PA11 pin of the single-chip microcomputer, and the SQH pin of the first output latch is connected to the A pin of the second output latch;
[0143] One side of the twenty-first resistor is connected to one side of the twenty-second resistor, a connection point between the twenty-first resistor and the twenty-second resistor is connected to the OE pin of the second output latch, the other side of the twenty-second resistor is connected to a 3.3V power supply, and the other side of the twenty-first resistor is grounded;
[0144] One side of the twenty-third resistor is connected to one side of the seventeenth capacitor, a connection point between the twenty-third resistor and the seventeenth capacitor is connected to the RESET pin of the second output latch, the other side of the twenty-third resistor is connected to a 3.3V power supply, and the other side of the seventeenth capacitor is grounded;
[0145] The VCC pin of the second output latch is connected to a 3.3V power supply, the GND pin of the second output latch is connected to the ground, the RESET pin of the second output latch is connected to the PA8 pin of the microcontroller, the OE pin of the second output latch is connected to the PB13 pin of the microcontroller, the SHIFT CLOCK pin of the second output latch is connected to the PB15 pin of the microcontroller, and the LATCH CLOCK pin of the second output latch is connected to the PB14 pin of the microcontroller.
[0146] like Figure 6 As shown, the LED display circuit includes nineteen 1K resistors and nineteen second light-emitting diodes, and one side of each 1K resistor is correspondingly connected to the positive electrode of each second light-emitting diode.
[0147] The other sides of the nineteen 1K resistors are connected one-to-one to the eight parallel output terminals of the first latch, the eight parallel output terminals of the second output latch, the PC15 pin of the single-chip microcomputer, the PC14 pin of the single-chip microcomputer, and the PC13 pin of the single-chip microcomputer;
[0148] The cathodes of the nineteen second light emitting diodes are all grounded.
[0149] The single chip microcomputer controls the on and off of three LEDs, and the functions of the three lights are pairing status, receiving and sending status and system operation.
[0150] For other structures of the 485 bus configuration circuit described in this embodiment, please refer to the prior art.
[0151] The above description is only a preferred embodiment of the present invention and does not limit the present invention in any form. Therefore, any modifications, equivalent changes and modifications made to the above embodiments based on the technical essence of the present invention without departing from the content of the technical solution of the present invention are still within the scope of the technical solution of the present invention.
Claims
1. A 485 bus configuration address circuit, characterized in that: Control host; A plurality of slave devices, wherein the plurality of slave devices are connected to each other in sequence, and one of the slave devices is connected to the control host; a first connecting circuit, the first connecting circuit being connected to the control host and the slave device respectively; a plurality of second connection circuits, wherein the plurality of second connection circuits are used for connecting between the plurality of slave devices; Wherein, the first connection circuit includes a first regulated power supply, a first 485A line, a first 485B line, a first input terminal and a first output terminal connected to the control host and the slave device respectively; Each second connection circuit includes a second regulated power supply connected to two slave devices respectively, a second 485A line, a second 485B line, a second input end and a second output end.
2. The 485 bus configuration address circuit according to claim 1, characterized in that: The first connection circuit also includes a main control module, a 485 circuit, a power control module, an output control and output detection circuit, a latch circuit and an LED display circuit.
3. A 485 bus configuration address circuit according to claim 2, characterized in that: The main control module includes a single chip microcomputer, a first resistor, a second resistor, a first capacitor, a second capacitor, a third capacitor, a crystal oscillator and a first four-hole terminal; Pin 1 of the first four-hole terminal is connected to the SWDIO pin of the microcontroller, pin 2 of the first four-hole terminal is grounded, pin 3 of the first four-hole terminal is connected to the SWCLK pin of the microcontroller, and pin 4 of the first four-hole terminal is connected to a 3.3V power supply; The VDD_1 pin of the single-chip microcomputer is connected to one side of the first resistor and to a 3.3V power supply; the other side of the first resistor is respectively connected to one side of the third capacitor and the NRST pin of the single-chip microcomputer, and the other side of the third capacitor is grounded; The crystal oscillator is connected to the PF1 / OSC OUT pin of the single-chip microcomputer via the PF0 / OSC IN pin of the single-chip microcomputer; One side of the first capacitor is connected to the ground, and the other side of the first capacitor is connected to the PF0 / OSC IN pin of the microcontroller; One side of the second capacitor is connected to the ground, and the other side of the second capacitor is connected to the PF1 / OSC OUT pin of the microcontroller; The VSSA pin of the single chip microcomputer, the VSS_1 pin of the single chip microcomputer and the VSS_2 pin of the single chip microcomputer are all grounded; The VDD_2 pin and the VDD_3 pin of the single chip microcomputer are respectively connected to a 3.3V power supply; One side of the second resistor is connected to the ground, and the other side of the second resistor is connected to the BOOT0 pin of the single chip microcomputer.
4. The 485 bus configuration address circuit according to claim 2, characterized in that: The 485 circuit includes a third resistor, a fourth resistor, a fifth resistor, a sixth resistor, a seventh resistor, an eighth resistor, a ninth resistor, an NPN transistor, an RS485 transceiver, a first Zener diode, a second Zener diode, a third Zener diode and a three-hole terminal; The RX pin of the RS485 transceiver is connected to the UART2RXD pin of the single-chip microcomputer, the TX pin of the RS485 transceiver is connected to the UART2TXD pin of the single-chip microcomputer, and the GND pin of the RS485 transceiver is connected to the ground; One side of the eighth resistor is connected to the TX pin of the RS485 transceiver, the other side of the eighth resistor is connected to the base of the NPN transistor, and the emitter of the NPN transistor is grounded; One side of the third resistor is connected to the TE pin of the RS485 transceiver, the RE pin of the RS485 transceiver and the collector of the NPN transistor respectively, and the other side of the third resistor is connected to a 3.3V power supply; One side of the fourth resistor and the VCC pin of the RS485 transceiver are connected to a 3.3V power supply, and the other side of the fourth resistor is connected to the A pin of the RS485 transceiver; The first Zener diode, the second Zener diode and the third Zener diode are sequentially connected in series, and the first Zener diode and the third Zener diode are both grounded; One side of the fifth resistor is connected to the A pin of the RS485 transceiver, and the other side of the fifth resistor is connected to the connection point between the first Zener diode and the second Zener diode; One side of the seventh resistor is connected to the B pin of the RS485 transceiver, and the other side of the seventh resistor is connected to the connection point between the second Zener diode and the third Zener diode; One side of the sixth resistor is connected to the connection point between the first Zener diode and the second Zener diode, and the other end of the sixth resistor is connected to the second pin of the three-hole terminal; One side of the ninth resistor is connected to the B pin of the RS485 transceiver, and the other side of the ninth resistor is connected to the ground; The third pin of the three-hole terminal is connected to the connection point between the second Zener diode and the third Zener diode.
5. The 485 bus configuration address circuit according to claim 2, characterized in that: The power control circuit includes a fourth capacitor, a fifth capacitor, a sixth capacitor, a seventh capacitor, an eighth capacitor, a ninth capacitor, a tenth capacitor, an eleventh capacitor, a twelfth capacitor, a thirteenth capacitor, a fourteenth capacitor, a fifteenth capacitor, a first light-emitting diode, a first Schottky diode, a second Schottky diode, a relay, a first electrolytic capacitor, a second electrolytic capacitor, a transient voltage suppressor diode, a DC-DC power supply chip, a tenth resistor, an eleventh resistor, a twelfth resistor, an inductor and a forward low-dropout voltage regulator; The eighth capacitor, the ninth capacitor, the tenth capacitor, the eleventh capacitor, and the twelfth capacitor are connected in parallel, and one side of the eighth capacitor is connected to a positive power supply of 3.3V, and one side of the twelfth capacitor is grounded; The fourth capacitor, the sixth capacitor, and the seventh capacitor are connected in parallel, one side of the fourth capacitor is connected to a positive power supply 3.3V, and one side of the seventh capacitor is grounded; The positive electrode of the first light-emitting diode is connected to a 3.3V power supply, the negative electrode of the first light-emitting diode is connected to one side of the eleventh resistor, and the other side of the eleventh resistor is grounded; The positive electrode of the first Schottky diode is connected to a 24V power supply, and the negative electrode of the first Schottky diode is connected to one end of the relay; The transient voltage suppressor diode, the first electrolytic capacitor, the fourteenth capacitor and the fifteenth capacitor are connected in parallel, and the negative electrode of the first electrolytic capacitor is grounded; The enable terminal of the DC-DC power supply chip and the four ground pins of the DC-DC power supply chip are grounded; One side of the twelfth resistor is connected to the FB pin of the DC-DC power supply chip, and the other side of the twelfth resistor is connected to the ground; One side of the thirteenth capacitor is connected to the FB pin of the DC-DC power supply chip, and the other side of the thirteenth capacitor is connected to a 5V power supply; One side of the tenth resistor is connected to the FB pin of the DC-DC power supply chip, and the other side of the tenth resistor is connected to a 5V power supply; The cathode of the second Schottky diode is connected to the OUT pin of the DC-DC power supply chip, and the anode of the second Schottky diode is grounded; One side of the inductor is connected to the OUT pin of the DC-DC power supply chip, and the other side of the inductor is connected to a 5V power supply; One side of the fifth capacitor is connected to a 5V power supply, and the other side of the fifth capacitor is grounded; The positive electrode of the second electrolytic capacitor is connected to a 5V power supply, and the negative electrode of the second electrolytic capacitor is grounded; The input end of the forward low-dropout voltage regulator is connected to a 5V power supply, the two output ends of the forward low-dropout voltage regulator are connected to a 3.3V source, and the ground end of the forward low-dropout voltage regulator is connected to the ground.
6. The 485 bus configuration address circuit according to claim 2, characterized in that: The output control and input detection circuit includes: a second four-hole terminal, a six-hole terminal, a twelve-hole terminal, a thirteenth resistor, a fourteenth resistor, a fifteenth resistor, a sixteenth resistor, a seventeenth resistor, a first photoelectric coupler, and a second photoelectric coupler; The first port of the second four-hole terminal is connected to 3.3V, the second port of the second four-hole terminal is connected to the UART1TXD pin of the single-chip microcomputer, the third port of the second four-hole terminal is connected to the UART1RXD pin of the single-chip microcomputer, and the fourth port of the second four-hole terminal is grounded; The first port of the six-hole terminal is connected to a 24V power supply, the second port of the six-hole terminal and the fifth port of the six-hole terminal are grounded, the third port of the six-hole terminal is connected to a connection point between a first Zener diode and a second Zener diode, and the fourth port of the six-hole terminal is connected to a connection point between the second Zener diode and a third Zener diode; The seventh port of the twelve-hole terminal is connected to a 24V power supply, the eighth port of the twelve-hole terminal and the eleventh port of the twelve-hole terminal are grounded, and the twelfth port of the twelve-hole terminal is connected to the sixth pin of the first photocoupler; One side of the thirteenth resistor is connected to the PA15 pin of the single chip microcomputer, and the other side of the thirteenth resistor is connected to the first pin of the first photocoupler, and the first pin of the first photocoupler is connected to a 3.3V power supply; One side of the fourteenth resistor is connected to the PA15 pin of the single chip microcomputer, and the other side of the fourteenth resistor is connected to the third pin of the first photocoupler; One side of the fifteenth resistor is connected to the sixth pin of the first photocoupler, and the other side of the fifteenth resistor is connected to a 3.3V power supply; One side of the sixteenth resistor is connected to the twelfth port of the twelve-hole terminal, and the other side of the sixteenth resistor is connected to the third pin of the second photoelectric coupler; One side of the seventeenth resistor is connected to the sixth pin of the second photoelectric coupler, and the other side of the seventeenth resistor is connected to a 3.3V power supply; The first pin of the second photocoupler is connected to a 3.3V power supply, the fourth pin is grounded, and the sixth pin of the second photocoupler is connected to the PA1 pin of the microcontroller.
7. The 485 bus configuration address circuit according to claim 2, characterized in that: The latch circuit includes an eighteenth resistor, a nineteenth resistor, a twentieth resistor, a twenty-first resistor, a twenty-second resistor, a twenty-third resistor, a sixteenth capacitor, a seventeenth capacitor, a first output latch, and a second output latch; One side of the eighteenth resistor is connected to one side of the nineteenth resistor, a connection point between the eighteenth resistor and the nineteenth resistor is connected to the OE pin of the first output latch, the other side of the eighteenth resistor is connected to a 3.3V power supply, and the other side of the nineteenth resistor is grounded; One side of the 20th resistor is connected to one side of the 16th capacitor, a connection point between the 20th resistor and the 16th capacitor is connected to the RESET pin of the first output latch, the other side of the 20th resistor is connected to a 3.3V power supply, and the other side of the 16th capacitor is grounded; The VCC pin of the first output latch is connected to a 3.3V power supply, the GND pin of the first output latch is connected to the ground, the RESET pin of the first output latch is connected to the PA8 pin of the single-chip microcomputer, the OE pin of the first output latch is connected to the PB13 pin of the single-chip microcomputer, the SHIFT CLOCK pin of the first output latch is connected to the PB15 pin of the single-chip microcomputer, the LATCH CLOCK pin of the first output latch is connected to the PB14 pin of the single-chip microcomputer, the A pin of the first output latch is connected to the PA11 pin of the single-chip microcomputer, and the SQH pin of the first output latch is connected to the A pin of the second output latch; One side of the twenty-first resistor is connected to one side of the twenty-second resistor, a connection point between the twenty-first resistor and the twenty-second resistor is connected to the OE pin of the second output latch, the other side of the twenty-second resistor is connected to a 3.3V power supply, and the other side of the twenty-first resistor is grounded; One side of the twenty-third resistor is connected to one side of the seventeenth capacitor, a connection point between the twenty-third resistor and the seventeenth capacitor is connected to the RESET pin of the second output latch, the other side of the twenty-third resistor is connected to a 3.3V power supply, and the other side of the seventeenth capacitor is grounded; The VCC pin of the second output latch is connected to a 3.3V power supply, the GND pin of the second output latch is connected to the ground, the RESET pin of the second output latch is connected to the PA8 pin of the microcontroller, the OE pin of the second output latch is connected to the PB13 pin of the microcontroller, the SHIFT CLOCK pin of the second output latch is connected to the PB15 pin of the microcontroller, and the LATCH CLOCK pin of the second output latch is connected to the PB14 pin of the microcontroller.
8. The 485 bus configuration address circuit according to claim 2, characterized in that: The LED display circuit includes nineteen 1K resistors and nineteen second light-emitting diodes, and one side of each 1K resistor is correspondingly connected to the positive electrode of one of the second light-emitting diodes.
9. The 485 bus configuration address circuit according to claim 8, characterized in that: The other sides of the nineteen 1K resistors are connected one by one to the eight parallel output terminals of the first latch, the eight parallel output terminals of the second output latch, the PC15 pin of the microcontroller, the PC14 pin of the microcontroller, and the PC13 pin of the microcontroller; The cathodes of the nineteen second light emitting diodes are all grounded.