Usb master-slave mode power supply hardware switching circuit, industrial control board and electronic equipment

CN121210360BActive Publication Date: 2026-08-11WUHAN JIMU INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-10-28
Publication Date
2026-08-11

AI Technical Summary

Technical Problem

[0003]现有的常见设计方案是为这两种模式分别设置独立的USB接口,即一个专用的调试USB口和一个专用的主机USB口,这种方案的缺陷在于:(1)占用空间大:多个USB接口会占用PCB布局空间,并需要在设备外壳上开多个孔位,不利于设备小型化和紧凑化设计

Benefits of technology

[0013] Compared with the prior art, the beneficial effects achieved by at least one of the above-mentioned technical solutions adopted in the embodiments of this specification include at least the following: The embodiments of this invention fully utilize the USB interface function through a simple circuit switching of three transistors, realizing automatic switching and communication between USB host and slave functions on a single Micro-USB interface, while also realizing the charging function of the USB interface. This greatly saves PCB space and the number of peripheral interfaces, and improves the overall security of the device. Furthermore, the embodiments of this invention use only three transistors and a few resistors, resulting in a very simple circuit with high reliability and extremely low material costs. It not only achieves communication mode switching but also integrates external power supply functionality, meeting the power requirements for connecting external devices such as USB flash drives.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121210360B_ABST
    Figure CN121210360B_ABST
Patent Text Reader

Abstract

This invention provides a USB master-slave mode power hardware switching circuit for an industrial control board SOC, belonging to the field of embedded hardware circuit design technology. It includes: a first transistor, a second transistor, a third transistor, a first resistor, a second resistor, a third resistor, a fourth resistor, a fifth resistor, and a USB connector. The power pin of the USB connector is connected to the emitter of the first transistor, its collector is connected to the OTG detection pin through the fourth resistor, the detection pin is grounded through the fifth resistor, its base is connected to the collector of the second transistor through the second resistor, and its base is connected to the identification pin through the first resistor. The base of the third transistor is connected to one end of the third resistor, and its other end is connected to the identification pin. The emitter of the third transistor is connected to the board's power supply, and its collector is connected to the power pin of the USB connector. This invention integrates multiple functions such as program download, communication with a host computer, and USB flash drive data reading and writing on a single USB interface.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of embedded hardware circuit design technology, specifically to a USB master-slave mode power hardware switching circuit for an industrial control board SOC, the industrial control board, and electronic equipment. Background Technology

[0002] In embedded devices in fields such as industrial control and automotive electronics, industrial control boards typically need to perform multiple functions via USB interfaces, such as program debugging and data communication with a host computer (slave mode), and connecting external storage devices such as USB flash drives for data reading and writing (master mode).

[0003] The existing common design scheme is to set up separate USB interfaces for these two modes, namely a dedicated debugging USB port and a dedicated host USB port. The drawbacks of this scheme are: (1) Large space occupation: Multiple USB interfaces will occupy PCB layout space and require multiple holes to be opened on the device casing, which is not conducive to the miniaturization and compact design of the device. (2) Complex structure: In application scenarios where the device structure space is limited or the dustproof and waterproof level requirements are high, too many external interfaces will increase the difficulty of structural design and may reduce the safety level of the device. (3) Inconvenient to use: When technicians are debugging or using the device on site, they need to connect different USB ports according to different functions, which increases the complexity of operation. Therefore, a solution is needed that can integrate the USB master and slave functions into a single interface and can automatically identify and switch modes. Summary of the Invention

[0004] In view of this, embodiments of this application provide a USB master-slave mode power hardware switching circuit, industrial control board and electronic device for industrial control board SOC with simple circuit structure and low cost, so as to realize multiple functions such as program download, communication with host computer and USB flash drive data reading and writing on a single USB interface.

[0005] This application provides the following technical solution: a USB master-slave mode power hardware switching circuit for an industrial control board SOC, comprising: a first transistor Q3, a second transistor Q10, a third transistor Q11, a first resistor R3410, a second resistor R3411, a third resistor R3413, a fourth resistor R494, a fifth resistor R495, and a USB connector; the power pin of the USB connector is connected to the emitter of the first transistor Q3; the collector of the first transistor Q3 is connected to the OTG detection pin of the industrial control board SOC through the fourth resistor R494, and the OTG detection pin is also grounded through the fifth resistor R495; the base of the first transistor Q3 is connected to the collector of the second transistor Q10 through the second resistor R3411, and the base of the second transistor Q10 is connected to the identification pin USB0_ID of the USB connector through the first resistor R3410; the base of the third transistor Q11... The first transistor Q3 is connected to one end of the third resistor R3413, and the other end of the third resistor R3413 is connected to the identification pin USB0_ID of the USB connector. The emitter of the third transistor Q11 is connected to the board power supply PMIC_5V, and the collector of the third transistor Q11 is connected to the power supply pin USB_5V of the USB connector. When the identification pin USB0_ID of the USB connector is floating, the first transistor Q3 is turned on, transmitting power to the OTG detection pin, enabling the industrial control board SOC to operate in USB slave mode. When the identification pin USB0_ID of the USB connector is grounded, the first transistor Q3 is turned off, and the third transistor Q11 is turned on, outputting the board power supply PMIC_5V to the power supply pin USB_5V of the USB connector, and powering external devices. At the same time, the OTG detection pin is at a low level, enabling the industrial control board SOC to operate in USB master mode.

[0006] According to one embodiment of this application, the first transistor Q3 is a PNP transistor.

[0007] According to one embodiment of this application, the second transistor Q10 is an NPN transistor.

[0008] According to one embodiment of this application, the third transistor Q11 is a PNP transistor.

[0009] According to one embodiment of this application, the device further includes a sixth resistor R3414 and a seventh resistor R3408. The sixth resistor R3414 is an optional soldering resistor that can be soldered between the identification pin USB0_ID of the USB connector and the emitter of the third transistor Q11. The seventh resistor R3408 is soldered between the identification pin USB0_ID of the USB connector and the emitter of the first transistor Q3. When the seventh resistor R3408 is soldered, the identification pin USB0_ID of the USB connector is in a high-level state when a standard USB cable is inserted.

[0010] According to one embodiment of this application, the USB slave device mode includes program debugging and data communication with a host computer via a USB interface, and the USB master device mode includes data reading and writing by connecting to an external storage device via a USB interface.

[0011] This application also provides an industrial control board that integrates the USB master-slave mode power hardware switching circuit described above.

[0012] This application also provides an electronic device that includes the industrial control board as described above.

[0013] Compared with the prior art, the beneficial effects achieved by at least one of the above-mentioned technical solutions adopted in the embodiments of this specification include at least the following: The embodiments of this invention fully utilize the USB interface function through a simple circuit switching of three transistors, realizing automatic switching and communication between USB host and slave functions on a single Micro-USB interface, while also realizing the charging function of the USB interface. This greatly saves PCB space and the number of peripheral interfaces, and improves the overall security of the device. Furthermore, the embodiments of this invention use only three transistors and a few resistors, resulting in a very simple circuit with high reliability and extremely low material costs. It not only achieves communication mode switching but also integrates external power supply functionality, meeting the power requirements for connecting external devices such as USB flash drives. Attached Figure Description

[0014] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0015] Figure 1 This is a schematic diagram of the USB master-slave mode power hardware switching process according to an embodiment of the present invention; Figure 2 This is a schematic diagram of the USB master-slave mode power hardware switching circuit according to an embodiment of the present invention; Figure 3This is a circuit diagram of the detection pin when the USB is working in master-slave mode in an embodiment of the present invention; Figure 4 This is a schematic diagram of the USB_ID pin circuit when USB is operating in master-slave mode in an embodiment of the present invention; Figure 5 This is a schematic diagram of a USB interface application scenario on an industrial control board, representing an embodiment of the present invention. Detailed Implementation

[0016] The embodiments of this application will now be described in detail with reference to the accompanying drawings.

[0017] The following specific examples illustrate the implementation of this application. Those skilled in the art can easily understand other advantages and effects of this application from the content disclosed in this specification. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. This application can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of this application. It should be noted that, in the absence of conflict, the following embodiments and features in the embodiments can be combined with each other. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0018] like Figure 1-2 As shown, this embodiment of the invention provides a USB master-slave mode power hardware switching circuit for an industrial control board SOC. Through a logic control circuit consisting of three transistors and a small number of external resistors, the power path and the SOC's OTG detection signal are automatically controlled according to the level state of the USB connector ID pin, thereby realizing the switching of the working mode.

[0019] The USB master-slave mode power hardware switching circuit of this embodiment includes: a first transistor Q3, a second transistor Q10, a third transistor Q11, a first resistor R3410, a second resistor R3411, a third resistor R3413, a fourth resistor R494, a fifth resistor R495, and a USB connector. The circuit connections are as follows: the power supply pin of the USB connector is connected to the emitter of the first transistor Q3; the collector of the first transistor Q3 is connected to the OTG detection pin of the industrial control board SOC through the fourth resistor R494, and the OTG detection pin is also grounded through the fifth resistor R495; the base of the first transistor Q3 is connected to the collector of the second transistor Q10 through the second resistor R3411, and the base of the second transistor Q10 is connected to the identification pin USB0_ID of the USB connector through the first resistor R3410; the base of the third transistor Q11 is connected to one end of the third resistor R3413, the other end of the third resistor R3413 is connected to the identification pin USB0_ID of the USB connector, the emitter of the third transistor Q11 is connected to the board power supply PMIC_5V, and the collector of the third transistor Q11 is connected to the power supply pin USB_5V of the USB connector. The circuit's operating logic is as follows: USB Slave Mode: When a standard USB-A to Micro-USB cable is plugged in (with the USB connector's identification pin USB_ID floating), the base of the first transistor Q3 is pulled low by the second transistor Q10 through the second resistor R3411, thus turning it on. At this time, the 5V power supply USB_5V from the external USB host is supplied to the SOC's OTG detection pin CV_USB0_DETECT_VBUS through the conducting first transistor Q3 and the fourth resistor R494. Upon detecting the high level, the SOC automatically configures itself into USB slave mode, which can be used for program downloading or communication with a PC. Meanwhile, the third transistor Q11 is turned off because its base is high.

[0020] USB Host Mode: When a USB OTG cable is plugged in (the USB connector's identification pin USB_ID is grounded internally), the USB connector's identification pin USB_ID is pulled low, causing the base of the first transistor Q3 to de-conduct the second transistor Q10, making the second resistor R3411 high and thus cut off. The cutoff of the first transistor Q3 means its collector has no 5V power output, i.e., the OTG detection pin CV_USB0_DETECT_VBUS is low. Simultaneously, the base of the third transistor Q11 is pulled low and conducts, outputting the board's own 5V power supply VCC_PMIC_5V to the USB connector's power pin USB_5V, powering external USB devices (such as USB flash drives). When the SOC detects that the OTG detection pin CV_USB0_DETECT_VBUS is low, it automatically configures itself to USB host mode.

[0021] In this embodiment, preferably, the first transistor Q3 is a PNP type, the second transistor Q10 is an NPN type, and the third transistor Q11 is a PNP type.

[0022] In one embodiment of the present invention, the circuit further includes a sixth resistor R3414 and a seventh resistor R3408. The sixth resistor R3414 is an optional soldering resistor that can be soldered between the identification pin USB0_ID of the USB connector and the emitter of the third transistor Q11. The seventh resistor R3408 is soldered between the identification pin USB0_ID of the USB connector and the emitter of the first transistor Q3. When the seventh resistor R3408 is soldered, the system defaults to a high level for the USB_ID pin, which facilitates the use of SOC USB slave mode.

[0023] like Figures 3-4 As shown, a preferred embodiment of the circuit of the present invention includes an NPN transistor Q10, PNP transistors Q3 and Q11, resistors R3408, R3410, R3411, R3413, and R3414 (optionally soldered), and a Micro-USB connector.

[0024] Its working process is as follows: From device mode: such as Figure 3-4As shown, when the industrial control board needs to connect to a PC via USB for debugging or program downloading, a standard USB-A to Micro-USB cable is used. In this case, the ID pin of the Micro-USB connector is left floating. VCC (USB_5V) is supplied by the PC. Because the USB cable ID is floating, the base of the PNP transistor Q3 receives a low level through resistor R3411 and is turned on. The USB_5V supplied by the PC generates a high-level signal (CV_USB0_DETECT_VBUS) to the SOC through the turned-on PNP transistor Q3 and resistors R494 and R495. After recognizing this high level, the SOC initializes its USB controller to slave mode. At this time, the PNP transistor Q11 is reliably turned off because its base is at a high level.

[0025] Master device mode: such as Figure 4-5 As shown, when connecting a USB flash drive, a USB OTG adapter cable is used. Internally, the Micro-USB ID pin is shorted to GND. Therefore, when inserted, the ID pin is pulled low to GND, causing the base of PNP transistor Q3 to be high and thus cut off. The cutoff of PNP transistor Q3 pulls the CV_USB0_DETECT_VBUS signal low through the fourth and fifth resistors R494 and R495 in the SOC external circuit. Upon recognizing the low level, the SOC switches to USB host mode. Simultaneously, because USB0_ID is low, the base of PNP transistor Q11 is also pulled low and turned on, outputting the onboard 5V power supply (VCC_PMIC_5V) to the USB_5V pin through the turned-on PNP transistor Q11, thus powering the USB flash drive.

[0026] Resistor R3408 serves as a pull-up resistor. When soldered, it ensures that the ID pin is at a defined high level when disconnected. In practical applications, soldering can be selected based on the preferred mode. For example, if the device is more frequently used as a slave device, leaving the ID pin high by default simplifies production.

[0027] like Figure 4-5 As shown in the figure, this circuit is integrated into an application example on an in-vehicle industrial control board. This industrial control board can meet various needs such as program updates, data communication and external storage through this single USB interface, simplifying the interface layout of in-vehicle equipment.

[0028] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A USB master-slave mode power hardware switching circuit for an industrial control board SOC, characterized in that, include: The components include: first transistor Q3, second transistor Q10, third transistor Q11, first resistor R3410, second resistor R3411, third resistor R3413, fourth resistor R494, fifth resistor R495, and a USB connector. The power pin USB_5V of the USB connector is connected to the emitter of the first transistor Q3. The collector of the first transistor Q3 is connected to the OTG detection pin of the industrial control board SOC through the fourth resistor R494, and the OTG detection pin is also grounded through the fifth resistor R495; the base of the first transistor Q3 is connected to the collector of the second transistor Q10 through the second resistor R3411, the base of the second transistor Q10 is connected to the identification pin USB0_ID of the USB connector through the first resistor R3410, and the emitter of the second transistor Q10 is connected to ground; The base of the third transistor Q11 is connected to one end of the third resistor R3413, the other end of the third resistor R3413 is connected to the identification pin USB0_ID of the USB connector, the emitter of the third transistor Q11 is connected to the board power supply PMIC_5V, and the collector of the third transistor Q11 is connected to the power supply pin USB_5V of the USB connector. When the USB connector's identification pin USB0_ID is floating, the first transistor Q3 is turned on, transmitting power to the OTG detection pin, enabling the industrial control board SOC to operate in USB slave mode. When the identification pin USB0_ID of the USB connector is grounded, the first transistor Q3 is cut off and the third transistor Q11 is turned on, outputting the board power supply PMIC_5V to the power supply pin USB_5V of the USB connector and powering external devices. At the same time, the OTG detection pin is at a low level, so that the industrial control board SOC works in USB host mode. Wherein, the first transistor Q3 is a PNP transistor; the second transistor Q10 is an NPN transistor; and the third transistor Q11 is a PNP transistor; It also includes a sixth resistor R3414 and a seventh resistor R3408. The sixth resistor R3414 is an optional soldering resistor that can be soldered between the identification pin USB0_ID of the USB connector and the emitter of the third transistor Q11. The seventh resistor R3408 is soldered between the identification pin USB0_ID of the USB connector and the emitter of the first transistor Q3. When the seventh resistor R3408 is soldered, the identification pin USB0_ID of the USB connector is in a high-level state when a standard USB cable is inserted.

2. The USB master-slave mode power hardware switching circuit according to claim 1, characterized in that, The USB slave device mode includes program debugging and data communication with the host computer via a USB interface, while the USB master device mode includes data reading and writing via a USB interface to an external storage device.

3. An industrial control board, characterized in that, It integrates the USB master-slave mode power hardware switching circuit as described in claim 1.

4. An electronic device, characterized in that, It includes the industrial control board as described in claim 3.

Citation Information

Patent Citations

  • Hand-held reader including a USB signal connection circuit

    CN109032983A

  • Device for realizing identification and switching of master and slave function modes of USB (Universal Serial Bus)

    CN213365502U