Circuit structure compatible with RS485 and SWD

By designing a circuit structure compatible with RS485 and SWD, and switching serial port burning using photocoupler and transistor, the anti-interference and transmission stability problems of the underlying serial port burning circuit are solved, and the efficient and stable operation of the circuit is achieved.

CN223092422UActive Publication Date: 2025-07-11ACCENT TECH (SUZHOU) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202421501899.0
Authority / Receiving Office
CN · China
Patent Type
Utility models(China)
Current Assignee / Owner
Filing Date
2024-06-28
Publication Date
2025-07-11
Estimated Expiration
2034-06-28

AI Technical Summary

Technical Problem

The existing underlying serial port burning circuit has poor anti-interference capability and poor transmission stability, which leads to disassembly and re-upgrade of the software after the burning failure.

Method used

Design a circuit structure compatible with RS485 and SWD. Through the combination of photocoupler and transistor, the circuit switches serial port burning in different working modes, combines RS485 and SWD interfaces to improve anti-interference and transmission stability.

Benefits of technology

Switching the serial port in different working modes improves the anti-interference capability and transmission stability of the circuit, avoiding the need for disassembly and re-upgrade.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN223092422U_ABST
    Figure CN223092422U_ABST
Patent Text Reader

Abstract

The utility model discloses a circuit structure compatible with RS485 and SWD, which comprises a power supply end, a voltage input end before voltage stabilization, a first circuit group, a second circuit group and a BUS port, the power supply end is used for supplying power to the first circuit group and the second circuit group, the voltage input end before voltage stabilization is used for inputting voltage to the second circuit group, and the BUS port is used for supplying power to the first circuit group and the second circuit group. The first circuit group comprises a first connection triode, a first photoelectric coupler and an RS485 interface, the second circuit group comprises a second connection triode, a second photoelectric coupler and an SWD port, when no voltage is input to the voltage input end before voltage stabilization, the first connection triode is switched on, the second connection triode is switched off, and a signal of the RS485 interface is output through the BUS port; when voltage is input into the voltage input end before voltage stabilization, the first connection triode is switched off, the second connection triode is switched on, and signals of the SWD port are output through the BUS port. According to the invention, the RS485 and the SWD are combined into the same circuit, so that the circuit work after dual-serial-port burning is realized, and the anti-interference performance and the stability of the circuit are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The utility model belongs to the technical field of underlying serial port programming, and particularly relates to a circuit structure compatible with RS485 and SWD. Background Art

[0002] In the industrial field, some devices may not have other higher-level interfaces available for firmware programming, or the use of other interfaces is restricted. In such cases, underlying serial port programming provides a way to directly access the device memory for downloading and updating firmware programs.

[0003] However, for current underlying serial port programming, if the programming fails, it is necessary to disassemble the machine and re-upgrade the software through the SWD port for re-programming. The existing circuit after underlying serial port programming has poor anti-interference ability and poor transmission stability. Summary of the Utility Model

[0004] Aiming at the deficiencies of the prior art, the purpose of the utility model is to provide a circuit structure compatible with RS485 and SWD to solve the problems of poor anti-interference ability and poor transmission stability of the circuit after underlying serial port programming in the prior art.

[0005] The circuit structure compatible with RS485 and SWD of this application includes:

[0006] A power supply terminal, a voltage input terminal before voltage regulation, a first circuit group, a second circuit group, and a BUS port. The power supply terminal is used to supply power to the first circuit group and the second circuit group. The voltage input terminal before voltage regulation is used to input voltage to the second circuit group. The first circuit group includes a first connection triode, a first optocoupler, and an RS485 interface. The power supply terminal and the first connection triode are respectively electrically connected to the first optocoupler, and the other end of the first optocoupler is electrically connected to the RS485 interface;

[0007] The second circuit group includes a second connection triode, a second optocoupler, and an SWD port. One end of the voltage input terminal before voltage regulation is respectively electrically connected to the first connection triode and the second connection triode. The other end of the second connection triode is electrically connected to the second optocoupler, and the other end of the second optocoupler is electrically connected to the SWD port;

[0008] When there is no input voltage at the input terminal of the voltage before voltage regulation, the circuit structure executes the first working mode, the first connection triode conducts, the second connection triode turns off, and the signal of the RS485 interface is output through the BUS port; when there is an input voltage at the input terminal of the voltage before voltage regulation, the circuit structure executes the second working mode, the first connection triode turns off, the second connection triode conducts, and the signal of the SWD port is output through the BUS port.

[0009] Further, the first optocoupler includes a first optocoupler A and a first optocoupler B, the RS485 interface includes an RS485 interface A and an RS485 interface B, and the BUS port includes a BUS port A and a BUS port B;

[0010] One end of the first optocoupler A is electrically connected to the power supply terminal and the first connection triode respectively, the other end of the first optocoupler A is electrically connected to the RS485 interface A and the BUS port A respectively, one end of the first optocoupler B is electrically connected to the power supply terminal and the first connection triode respectively, the other end of the first optocoupler B is electrically connected to the RS485 interface B and the BUS port B respectively. When there is no input voltage at the input terminal of the voltage before voltage regulation, the signal of the RS485 interface A is output from the BUS port A, and the signal of the RS485 interface B is output from the BUS port B.

[0011] Further, the second optocoupler includes a second optocoupler A and a second optocoupler B. One end of the second optocoupler A is electrically connected to the power supply terminal and the second connection triode, the other end of the second optocoupler A is electrically connected to the SWD and the BUSA port respectively, one end of the second optocoupler B is electrically connected to the power supply terminal and the second connection triode, and the other end of the second optocoupler B is electrically connected to the BUS port B. When there is an input voltage at the input terminal of the voltage before voltage regulation, the signal of the SWD port is output from the BUS port A and the BUS port B respectively.

[0012] Further, the first connection triode is a PNP triode, and the second connection triode is an NPN triode.

[0013] In an implementable solution, the input voltage at the input terminal of the voltage before voltage regulation is 3.3 V - 5V.

[0014] In an implementable solution, the power supply of the power supply terminal is 3.3V - 5V.

[0015] In an implementable solution, the first opto-coupler is an opto-coupler with a photosensitive triode or a photosensitive resistor or a photothyristor, and the second opto-coupler is an opto-coupler with a photosensitive triode or a photosensitive resistor or a photothyristor.

[0016] In an implementable solution, a first resistor is provided between the first opto-coupler A and the power supply terminal, a second resistor is provided between the first opto-coupler B and the power supply terminal, a third resistor is provided between the first connecting triode and the pre-regulator voltage input terminal, a fourth resistor is provided between the second opto-coupler A and the power supply terminal, a fifth resistor is provided between the second opto-coupler B and the power supply terminal, and a sixth resistor is provided between the second connecting triode and the pre-regulator voltage input terminal.

[0017] The circuit structure of the present application compatible with RS485 and SWD includes:

[0018] A power supply terminal, a pre-regulator voltage input terminal, a first circuit group, a second circuit group, and a BUS port. The power supply terminal is used to supply power to the first circuit group and the second circuit group. The pre-regulator voltage input terminal is used to input voltage to the second circuit group. The first circuit group includes a first connecting triode, a first opto-coupler, and an RS485 interface. The power supply terminal and the first connecting triode are respectively electrically connected to the first opto-coupler, and the other end of the first opto-coupler is electrically connected to the RS485 interface. The second circuit group includes a second connecting triode, a second opto-coupler, and an SWD port. One end of the pre-regulator voltage input terminal is respectively electrically connected to the first connecting triode and the second connecting triode. The other end of the second connecting triode is electrically connected to the second opto-coupler, and the other end of the second opto-coupler is electrically connected to the SWD port. When no voltage is input to the pre-regulator voltage input terminal, the first connecting triode is turned on, the second connecting triode is turned off, and the signal of the RS485 interface is output through the BUS port. When voltage is input to the pre-regulator voltage input terminal, the first connecting triode is turned off, the second connecting triode is turned on, and the signal of the SWD port is output through the BUS port. By integrating RS485 and SWD into the same circuit for programming, the present application enables the circuit to work after dual-serial programming. Under different working mode requirements, different serial circuits can work by switching the programming serial port, improving the anti-interference ability and transmission stability of the circuit. Description of the Drawings

[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art.

[0020] Figure 1 This is the circuit diagram of the circuit structure described in the present utility model. Detailed implementation manners

[0021] Next, the technical solutions in the embodiments of the present utility model will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present utility model. Based on the embodiments in the present utility model, all other embodiments obtained by those of ordinary skill in the art without making creative efforts belong to the scope of protection of the present utility model.

[0022] To solve the problems existing in the prior art, the present application provides a circuit structure compatible with RS485 and SWD. Specifically, as Figure 1 shown, the circuit structure includes a power supply terminal, a pre-regulation voltage input terminal, a first circuit group, a second circuit group, and a BUS port. The power supply terminal is used to supply power to the first circuit group and the second circuit group. The pre-regulation voltage input terminal is used to input voltage to the second circuit group. The first circuit group includes a first connection triode, a first optocoupler, and an RS485 interface. The power supply terminal and the first connection triode are respectively electrically connected to the first optocoupler, and the other end of the first optocoupler is electrically connected to the RS485 interface;

[0023] The second circuit group includes a second connection triode, a second optocoupler, and an SWD port. One end of the pre-regulation voltage input terminal is respectively electrically connected to the first connection triode and the second connection triode. The other end of the second connection triode is electrically connected to the second optocoupler, and the other end of the second optocoupler is electrically connected to the SWD port;

[0024] When no voltage is input to the pre-regulation voltage input terminal, the circuit structure executes the first working mode, the first connection triode is turned on, the second connection triode is turned off, and the signal of the RS485 interface is output through the BUS port. When voltage is input to the pre-regulation voltage input terminal, the circuit structure executes the second working mode, the first connection triode is turned off, the second connection triode is turned on, and the signal of the SWD port is output through the BUS port.

[0025] Among them, RS485 is a serial communication interface standard used for long-distance and high anti-interference data transmission between multiple devices. The RS485 interface defines the physical layer and electrical characteristics, including signal level, transmission rate, line configuration, etc. In this application, it is simply referred to as the RS485 interface. SWD (Serial Wire Debug) is a serial interface protocol used for debugging and programming embedded systems. In this application, it is simply referred to as the SWD port. Further, the first working mode can be a state based on the RS485 circuit, and the second working mode can be a state based on SWD. In this example, by burning RS485 and SWD into the same circuit, the circuit operation after dual-serial port burning is realized. Under different working mode requirements, different serial port circuits work by switching the burned serial port, improving the anti-interference ability and transmission stability of the circuit.

[0026] Further, the first optocoupler includes a first optocoupler A and a first optocoupler B, the RS485 interface includes an RS485 interface A and an RS485 interface B, and the BUS port includes a BUS port A and a BUS port B;

[0027] One end of the first optocoupler A is electrically connected to the power supply terminal and the first connecting triode respectively, the other end of the first optocoupler A is electrically connected to the RS485 interface A and the BUS port A respectively, one end of the first optocoupler B is electrically connected to the power supply terminal and the first connecting triode respectively, the other end of the first optocoupler B is electrically connected to the RS485 interface B and the BUS port B respectively. When no input voltage is applied to the pre-regulation voltage input terminal, the signal of the RS485 interface A is output from the BUS port A, and the signal of the RS485 interface B is output from the BUS port B.

[0028] Further, the second optocoupler includes a second optocoupler A and a second optocoupler B. One end of the second optocoupler A is electrically connected to the power supply terminal and the second connecting triode, the other end of the second optocoupler A is electrically connected to the SWD and the BUSA port respectively, one end of the second optocoupler B is electrically connected to the power supply terminal and the second connecting triode, and the other end of the second optocoupler B is electrically connected to the BUS port B. When the input voltage is applied to the pre-regulation voltage input terminal, the signals of the SWD port are output from the BUS port A and the BUS port B respectively.

[0029] Exemplarily, the RS485 interface A is represented by RS485A in Figure 1 the RS485 interface B is represented by RS485B in Figure 1 the BUS port A is represented by BUSA in Figure 1 the BUS port B is represented by BUSB in Figure 1 the first optocoupler A is inFigure 1 is represented by U1 in Figure 1 is represented by U2. The second optocoupler A is in Figure 1 is represented by U3, and the second optocoupler B is in Figure 1 is represented by U4. When there is no input voltage at the input terminal of the voltage before regulation, the first connection triode conducts and the second connection triode turns off. At the same time, U1 and U2 are in the conducting state, and U3 and U4 are in the off state. When there is an input voltage at the input terminal of the voltage before regulation, U1 and U2 are in the off state, and U3 and U4 are in the conducting state.

[0030] Further, the first connection triode is a PNP triode, and the second connection triode is an NPN triode.

[0031] In an implementable solution, the input voltage at the input terminal of the voltage before regulation is 3.3 V to 5V.

[0032] In an implementable solution, the power supply at the power supply terminal is 3.3V to 5V.

[0033] In an implementable solution, the first optocoupler is an optocoupler with a photosensitive triode or a photosensitive resistor or a photothyristor, and the second optocoupler is an optocoupler with a photosensitive triode or a photosensitive resistor or a photothyristor.

[0034] In an implementable solution, a first resistor R1 is provided between the first optocoupler A and the power supply terminal, a second resistor R2 is provided between the first optocoupler B and the power supply terminal, a third resistor R3 is provided between the first connection triode and the input terminal of the voltage before regulation, a fourth resistor R4 is provided between the second optocoupler A and the power supply terminal, a fifth resistor R5 is provided between the second optocoupler B and the power supply terminal, and a sixth resistor R6 is provided between the second connection triode and the input terminal of the voltage before regulation.

[0035] The circuit structure compatible with RS485 and SWD of the present application includes a power supply terminal, a pre-regulator voltage input terminal, a first circuit group, a second circuit group, and a BUS port. The power supply terminal is used to supply power to the first circuit group and the second circuit group. The pre-regulator voltage input terminal is used to input voltage to the second circuit group. The first circuit group includes a first connection triode, a first optocoupler, and an RS485 interface. The power supply terminal and the first connection triode are respectively electrically connected to the first optocoupler, and the other end of the first optocoupler is electrically connected to the RS485 interface. The second circuit group includes a second connection triode, a second optocoupler, and an SWD port. One end of the pre-regulator voltage input terminal is respectively electrically connected to the first connection triode and the second connection triode. The other end of the second connection triode is electrically connected to the second optocoupler, and the other end of the second optocoupler is electrically connected to the SWD port. When no voltage is input to the pre-regulator voltage input terminal, the first connection triode is turned on, the second connection triode is turned off, and the signal of the RS485 interface is output through the BUS port. When voltage is input to the pre-regulator voltage input terminal, the first connection triode is turned off, the second connection triode is turned on, and the signal of the SWD port is output through the BUS port. By integrating RS485 and SWD into the same circuit for programming, the present application enables the circuit to work after dual-serial-port programming. Under different working mode requirements, different serial-port circuits can work by switching the programming serial port, improving the anti-interference ability and transmission stability of the circuit.

[0036] The above are the embodiments only used to illustrate the technical solutions of the present invention, rather than to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the various embodiments of the present invention.

[0037] The above shows and describes the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited by the above embodiments. What is described in the above embodiments and the specification is only to illustrate the principle of the present invention. Without departing from the spirit and scope of the present invention, the present invention will have various changes and improvements, and these changes and improvements all fall within the scope of the present invention claimed.

Claims

1. A circuit structure compatible with RS485 and SWD, characterized in that The circuit structure includes: A power supply terminal, a pre-regulator voltage input terminal, a first circuit group, a second circuit group, and a BUS port. The power supply terminal is used to supply power to the first circuit group and the second circuit group. The pre-regulator voltage input terminal is used to input voltage to the second circuit group. The first circuit group includes a first connection triode, a first optocoupler, and an RS485 interface. The power supply terminal and the first connection triode are electrically connected to the first optocoupler respectively, and the other end of the first optocoupler is electrically connected to the RS485 interface; The second circuit group includes a second connection triode, a second optocoupler, and an SWD port. One end of the pre-regulator voltage input terminal is electrically connected to the first connection triode and the second connection triode respectively. The other end of the second connection triode is electrically connected to the second optocoupler, and the other end of the second optocoupler is electrically connected to the SWD port; When no voltage is input to the pre-regulator voltage input terminal, the circuit structure executes the first working mode, the first connection triode conducts, the second connection triode turns off, and the signal of the RS485 interface is output through the BUS port; when voltage is input to the pre-regulator voltage input terminal, the circuit structure executes the second working mode, the first connection triode turns off, the second connection triode conducts, and the signal of the SWD port is output through the BUS port.

2. The circuit structure compatible with RS485 and SWD according to claim 1, wherein The first optocoupler includes a first optocoupler A and a first optocoupler B. The RS485 interface includes an RS485 interface A and an RS485 interface B. The BUS port includes a BUS port A and a BUS port B; One end of the first optocoupler A is electrically connected to the power supply terminal and the first connection triode respectively. The other end of the first optocoupler A is electrically connected to the RS485 interface A and the BUS port A respectively. One end of the first optocoupler B is electrically connected to the power supply terminal and the first connection triode respectively. The other end of the first optocoupler B is electrically connected to the RS485 interface B and the BUS port B respectively. When no voltage is input to the pre-regulator voltage input terminal, the signal of the RS485 interface A is output from the BUS port A, and the signal of the RS485 interface B is output from the BUS port B.

3. The circuit structure compatible with RS485 and SWD according to claim 2, wherein The second optocoupler includes a second optocoupler A and a second optocoupler B. One end of the second optocoupler A is electrically connected to the power supply terminal and the second connection triode. The other end of the second optocoupler A is electrically connected to the SWD and the BUSA port respectively. One end of the second optocoupler B is electrically connected to the power supply terminal and the second connection triode. The other end of the second optocoupler B is electrically connected to the BUS port B. When voltage is input to the pre-regulator voltage input terminal, the signal of the SWD port is output from the BUS port A and the BUS port B respectively.

4. The circuit structure compatible with RS485 and SWD according to claim 1, wherein The first connecting triode is a PNP triode, and the second connecting triode is an NPN triode.

5. The circuit structure compatible with RS485 and SWD according to claim 1, characterized in that, The input voltage of the input terminal before voltage regulation is 3.3 V to 5V.

6. The circuit structure compatible with RS485 and SWD according to claim 1, characterized in that The power supply of the power supply terminal is 3.3V to 5V.

7. The circuit structure compatible with RS485 and SWD according to claim 1, wherein The first optocoupler is an optocoupler with a photosensitive triode or a photosensitive resistor or a photothyristor, and the second optocoupler is an optocoupler of a photosensitive triode or a photosensitive resistor or a photothyristor.

8. The circuit structure compatible with RS485 and SWD according to claim 3, wherein, A first resistor is arranged between the first optocoupler A and the power supply terminal, a second resistor is arranged between the first optocoupler B and the power supply terminal, a third resistor is arranged between the first connecting triode and the input terminal before voltage regulation, a fourth resistor is arranged between the second optocoupler A and the power supply terminal, a fifth resistor is arranged between the second optocoupler B and the power supply terminal, and a sixth resistor is arranged between the second connecting triode and the input terminal before voltage regulation.