Master-slave switching circuit of USB (Universal Serial Bus) equipment and USB equipment

By designing a signal trigger module and a control module in a USB device, recording and switching the master-slave status of the USB device according to parity, the problem of inefficient switching of USB devices in the prior art is solved, and the operation convenience and efficiency are improved, while reducing the speed of operation. Labor cost and design difficulty.

CN221978925UActive Publication Date: 2024-11-08GUANGZHOU ZHOULIGONG SCM DEV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202323401350.2
Authority / Receiving Office
CN · China
Patent Type
Utility models(China)
Current Assignee / Owner
Filing Date
2023-12-13
Publication Date
2024-11-08
Estimated Expiration
2033-12-13

AI Technical Summary

Technical Problem

In the prior art, industrial products are inconvenient to operate when switching USB master-slave status, resulting in low operating efficiency, high labor costs, increased design difficulty, and need to disassemble the machine, affecting the efficiency of the product.

Method used

Design a USB device master-slave switching circuit, including a signal trigger module and a control module. By recording the number of trigger signals and switching the master-slave state of the USB device according to parity, the user can realize state switching without disassembly, improve efficiency and reduce Labor costs.

Benefits of technology

It realizes the efficiency of master-slave status switching of USB devices, reduces labor costs, simplifies operation processes, and reduces restrictions on product appearance design.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN221978925U_ABST
    Figure CN221978925U_ABST
Patent Text Reader

Abstract

The embodiment of the utility model provides a USB equipment master-slave switching circuit and USB equipment, the USB equipment master-slave switching circuit comprises a signal trigger module and a control module, when a user needs to switch the master-slave state of the USB equipment, the signal trigger module can be triggered, so that the signal trigger module generates a trigger signal and transmits the trigger signal to the control module; and the control module controls the switching between the master state and the slave state of the UBS equipment by recording the number of times of receiving the trigger signal and determining the parity of the number of times. According to the embodiment of the utility model, a user can switch the master-slave state of the USB equipment by triggering the signal to trigger the module, and the process of master-slave switching does not need to disassemble, so that the efficiency of switching the master-slave state of the USB equipment is improved, and the labor cost is reduced at the same time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The utility model relates to the technical field of USB, in particular to a USB device master-slave switching circuit and a USB device. Background Art

[0002] In the prior art, for the design of industrial products, a self-locking button or short-circuit cap for switching the USB master-slave status is generally reserved on the product. During the debugging of the product, it is necessary to disassemble the product or operate the self-locking button or short-circuit cap through the reserved opening to switch the master-slave status of the product. However, this design is inconvenient to operate, resulting in very low operating efficiency when switching the master-slave status of the product. Utility Model Content

[0003] The utility model provides a USB device master-slave switching circuit and a USB device, which are used to solve the technical problem of low operating efficiency when switching the master-slave status of products in the prior art.

[0004] In a first aspect, an embodiment of the utility model provides a USB device master-slave switching circuit, comprising a control module, the control module being pre-configured to record times and determine the parity of the corresponding times, and also comprising a signal trigger module, the output end of the signal trigger module being connected to the input end of the control module;

[0005] The signal trigger module is used to generate a trigger signal when triggered, and transmit the trigger signal to the control module;

[0006] The control module is used to update the number of the trigger signal when receiving the trigger signal, and switch the master and slave states of the USB device according to the parity of the number.

[0007] Preferably, the trigger signal is a falling edge signal, and the signal trigger module includes a button, a first resistor and a first voltage source;

[0008] The first end of the button is connected to the ground, and the second end of the button is connected to the first end of the first resistor and the input end of the control module;

[0009] The second end of the first resistor is connected to the output end of the first voltage source.

[0010] Preferably, the button is a self-resetting switch.

[0011] Preferably, the resistance of the first resistor ranges from 1 kΩ to 10 kΩ.

[0012] Preferably, the control module is specifically used to control the USB device to switch to a host state when the number of times is an odd number, and to control the USB device to switch to a slave state when the number of times is an even number.

[0013] Preferably, the control module includes a first input interface, a first output interface and a USB state switching interface, the first input interface is connected to the output end of the signal trigger module, and the first output interface is connected to the USB state switching interface;

[0014] The first input interface is used to receive the trigger signal;

[0015] The control module is used to record the number of times of the trigger signal, and when the number is an odd number, control the first output interface to output a first level signal, and when the number is an even number, control the first output interface to output a second level signal;

[0016] The control module is further configured to control the USB device to switch to a host state when the USB state switching interface receives the first level signal, and to control the USB device to switch to a slave state when the USB state switching interface receives the second level signal.

[0017] Preferably, the first level signal is a low level signal, and the second level signal is a high level signal.

[0018] Preferably, the first input interface is a GPIO interface.

[0019] Preferably, the first output interface is a GPIO interface.

[0020] In a second aspect, an embodiment of the utility model provides a USB device, comprising a USB device master-slave switching circuit as described in the first aspect.

[0021] As described above, the embodiment of the utility model provides a USB device master-slave switching circuit and a USB device. The USB device master-slave switching circuit includes a signal trigger module and a control module. When a user needs to switch the master-slave state of a USB device, the signal trigger module can be triggered, so that the signal trigger module generates a trigger signal and transmits the trigger signal to the control module. The control module controls the switching of the master-slave state of the UBS device by recording the number of times the trigger signal is received and determining the parity of the number. In the embodiment of the utility model, the user can switch the master-slave state of the USB device by triggering the signal trigger module. The process of master-slave switching does not require disassembly of the device, which improves the efficiency of switching the master-slave state of the USB device and reduces labor costs. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] Figure 1 The utility model provides a schematic diagram of the structure of a USB device master-slave switching circuit.

[0023] Figure 2 A structural schematic diagram of another USB device master-slave switching circuit provided by the utility model.

[0024] Figure 3 The present invention provides a schematic diagram of the structure of another USB device master-slave switching circuit.

[0025] In the figure: a signal trigger module 1 , a control module 2 , a button S1 , a first resistor R1 , a first voltage source VCC, a first input interface 21 , a first output interface 22 , and a USB state switching interface 23 . DETAILED DESCRIPTION

[0026] In order to make the technical problems solved by the utility model, the technical solutions adopted and the technical effects achieved clearer, the technical solutions of the embodiments of the utility model are further described in detail below. Obviously, the described embodiments are only part of the embodiments of the utility model, not all of them. Based on the embodiments of the utility model, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the utility model.

[0027] In the description of the present invention, unless otherwise clearly specified and limited, the terms "connected", "connected", and "fixed" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, it can be the internal connection of two elements or the interaction relationship between two elements. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0028] In the present utility model, unless otherwise clearly specified and limited, a first feature being "above" or "below" a second feature may include that the first and second features are in direct contact, or may include that the first and second features are not in direct contact but are in contact through another feature between them. Moreover, a first feature being "above", "above" and "above" a second feature includes that the first feature is directly above and obliquely above the second feature, or simply indicates that the first feature is higher in level than the second feature. A first feature being "below", "below" and "below" a second feature includes that the first feature is directly below and obliquely below the second feature, or simply indicates that the first feature is lower in level than the second feature.

[0029] In the prior art, for the design of industrial products, a self-locking button or short-circuit cap is generally reserved on the product for switching the USB master-slave status. During the debugging of the product, it is necessary to disassemble the product or operate the self-locking button or short-circuit cap through the reserved opening to switch the master-slave status of the product. However, this design method has the following technical problems:

[0030] 1) High labor costs. Due to the large structural differences between different products in industrial product design, the disassembly and assembly operations must be performed by personnel who are familiar with the products, which increases labor costs.

[0031] 2) Low operating efficiency. Due to space limitations, the buttons need to be set on the PCB board, and multiple disassembly and assembly of the machine takes a long time, which leads to low operating efficiency.

[0032] 3) Inconvenient operation for users. In the design of some industrial products, due to space limitations, no holes are reserved and the machine needs to be disassembled for operation, which increases the difficulty of debugging.

[0033] 4) Increase the difficulty of appearance design. Due to structural limitations, self-locking buttons are large in size, and sufficient space must be reserved when designing industrial products, which limits their appearance design to a certain extent.

[0034] Based on this, in order to solve the above technical problems, the embodiment of the utility model provides a USB device master-slave switching circuit, such as Figure 1 As shown, Figure 1 The structure diagram of a USB device master-slave switching circuit provided by the embodiment of the utility model, the USB device master-slave switching circuit provided by the embodiment of the utility model includes a control module 2, and the control module 2 is pre-configured to record the number of times and determine the parity of the corresponding number of times. Specifically, in this embodiment, the control module 2 is a module with data processing function and instruction issuing function, for example, the control module 2 can select MPU, MCU or CPU, etc., which can be selected according to actual needs, and is not specifically limited in this embodiment. In this embodiment, the control module 2 is taken as an example for explanation as MPU, and the user needs to configure the MPU in advance so that the MPU has the function of recording the number of times and determining the parity corresponding to the number of times, wherein determining the parity corresponding to the number of times refers to determining whether the number of times is an even number or an odd number of times. In this embodiment, the object corresponding to the number of times is the trigger signal sent by the signal trigger module 1, that is, the MPU is configured to record the number of times the trigger signal is received, and determine whether the number of times is an even number of times or an odd number of times. In addition, it should be noted that the process of configuring the control module 2 can adopt the existing technology, which is not specifically limited in this embodiment.

[0035] The USB device master-slave switching circuit also includes a signal trigger module 1, and the output end of the signal trigger module 1 is connected to the input end of the control module 2;

[0036] The signal trigger module 1 is used to generate a trigger signal when triggered, and transmit the trigger signal to the control module 2;

[0037] The control module 2 is used to update the number of trigger signals when receiving the trigger signal, and switch the master and slave states of the USB device according to the parity of the number.

[0038] In this embodiment, the USB device master-slave switching circuit further includes a signal trigger module 1, wherein the output end of the signal trigger module 1 is connected to the input end of the control module 2, and the signal trigger module 1 is used to generate a trigger signal when triggered. Exemplarily, the signal trigger module 1 includes a button, and each time the button is pressed, the signal trigger module 1 generates a trigger signal.

[0039] After the signal trigger module 1 generates a trigger signal, it transmits the trigger signal to the control module 2. After receiving the trigger signal, the control module 2 records the number of times the trigger signal is received, and updates the number each time the trigger signal is received. Afterwards, the control module 2 determines the parity of the latest updated number, and switches the master-slave state of the USB device according to the parity. Exemplarily, when the control module 2 determines that the number is an odd number, the master-slave state of the USB device can be switched to the host state; and when the number is an even number, the master-slave state of the USB device can be switched to the slave state.

[0040] In one embodiment, the signal trigger module 1 can be set on the shell surface of the USB device or led out of the shell of the USB device as a separate module, so as to facilitate the user to operate. The user can switch the master-slave state of the USB device by triggering the signal trigger module 1. In addition, it should be noted that the number of trigger signals recorded in the control module 2 is the number of trigger signals received after power-on. When the master-slave switching circuit of the USB device is powered off, the number recorded in the control module 2 will be cleared, and the number will be counted again after the next power-on. In addition, after each power-on, the control module 2 can also be pre-configured to set the host state or the slave state to the initial state.

[0041] In another embodiment, in order to facilitate the user to determine the current master-slave state, an indication circuit may be provided in the USB device master-slave switching circuit to indicate the current master-slave state of the USB device.

[0042] As described above, the embodiment of the utility model provides a USB device master-slave switching circuit, including a signal trigger module and a control module. When a user needs to switch the master-slave state of a USB device, the signal trigger module can be triggered, so that the signal trigger module generates a trigger signal and transmits the trigger signal to the control module. The control module controls the switching of the master-slave state of the UBS device by recording the number of times the trigger signal is received and determining the parity of the number of times. In the embodiment of the utility model, the user can switch the master-slave state of the USB device by triggering the signal trigger module. The process of master-slave switching does not require disassembly of the device, which improves the efficiency of switching the master-slave state of the USB device and reduces labor costs.

[0043] On the basis of the above embodiment, the trigger signal is a falling edge signal, and the signal trigger module 1 includes a button S1, a first resistor R1 and a first voltage source VCC.

[0044] A first end of the button S1 is grounded, and a second end of the button S1 is connected to a first end of the first resistor R1 and an input end of the control module.

[0045] The second end of the first resistor R1 is connected to the output end of the first voltage source VCC.

[0046] In one embodiment, the trigger signal is a falling edge signal, wherein the moment when the digital level changes from a high level (digital "1") to a low level (digital "0") is called a falling edge, and the falling edge signal is a signal including a falling edge. Figure 2 As shown, Figure 2 A schematic diagram of another USB device master-slave switching circuit provided by an embodiment of the utility model. Figure 2In the embodiment, the signal trigger module 1 includes a button S1, a first resistor R1 and a first voltage source VCC, wherein the first end of the button S1 is connected to the ground, the second end of the button S1 is connected to the first end of the first resistor R1 and the input end of the control module 2, and the second end of the first resistor R1 is connected to the output end of the first voltage source VCC. When the button S1 is not triggered, since the first voltage source VCC outputs a voltage to the first resistor R1, there is a voltage drop between the first end and the second end of the first resistor R1, so that the first end of the first resistor R1 is maintained at a high level, that is, the first resistor R1 in this embodiment is a pull-up resistor, which is used to clamp the level of the first end of the first resistor R1 at a high level. In one embodiment, the resistance value of the first resistor R1 ranges from 1kΩ to 10kΩ. When the button S1 is triggered, the first end of the first resistor R1 is grounded, causing the voltage of the first end of the first resistor R1 to be pulled down, and at this time, the first end of the first resistor R1 generates a falling edge signal. In one embodiment, the button S1 is a self-reset switch. After being triggered, the self-reset switch can automatically reset, so that the level of the first end of the first resistor R1 can be restored to a high level after a falling edge is generated, which is convenient for the user to generate a new falling edge signal after triggering the self-reset switch next time, thereby improving the efficiency of switching the USB device between the master and slave states.

[0047] On the basis of the above embodiment, the control module 2 is specifically used to control the USB device to switch to the host state when the number is an odd number, and to control the USB device to switch to the slave state when the number is an even number.

[0048] In one embodiment, the control module 2 is specifically used to record the number of times the trigger signal is received, and determine the parity of the current number in real time. When the number is an odd number, the USB device is controlled to switch to the host state. In the host state, the USB device can act as a host to control other slaves. When the number is an even number, the USB device is controlled to switch to the slave state. In the slave state, the USB device acts as a slave and is controlled by the host.

[0049] On the basis of the above embodiment, the control module 2 includes a first input interface 21, a first output interface 22 and a USB state switching interface 23, the first input interface 21 is connected to the output end of the signal trigger module 1, and the first output interface 22 is connected to the USB state switching interface 23;

[0050] The first input interface 21 is used to receive a trigger signal;

[0051] The control module 2 is used to record the number of trigger signals, and when the number is an odd number, control the first output interface 22 to output a first level signal, and when the number is an even number, control the first output interface 22 to output a second level signal;

[0052] The control module 2 is further configured to control the USB device to switch to the host state when the USB state switching interface 23 receives a first level signal, and to control the USB device to switch to the slave state when the USB state switching interface 23 receives a second level signal.

[0053] In one embodiment, if Figure 3 As shown, Figure 3 A schematic diagram of a USB device master-slave switching circuit according to an embodiment of the present invention is provided. Figure 3 The control module 2 includes a first input interface 21, a first output interface 22 and a USB state switching interface 23, wherein the first input interface 21 is connected to the output end of the signal trigger module 1, and the first input interface 21 is used to receive the trigger signal transmitted by the signal trigger module 1, that is, the falling edge signal. In one embodiment, the first input interface 21 is a GPIO interface, for example Figure 3 GPIO1 in the figure, where GPIO is a general-purpose input / output interface (General-Purpose IOports). The GPIO interface can be pre-configured into an output mode to control an external device, or configured into an input mode to read an external signal. In this embodiment, GPIO1 can be configured into an input mode to receive a falling edge signal transmitted by the signal trigger module 1.

[0054] In addition, in this embodiment, the first output interface 22 is connected to the USB state switching interface 23. In one embodiment, the first output interface 22 may also be a GPIO interface, for example Figure 3 The GPIO2 in the GPIO2 interface can be pre-configured as an output mode to output signals to the outside. The control module 2 is also used to record the number of times the falling edge signal is received after receiving the falling edge signal through the first input interface 21. When the number of times the falling edge signal is received is an odd number, the control module 2 further controls the first output interface 22 to output a first level signal to the USB state switching interface 23. When the number of times the falling edge signal is received is an even number, the control module 2 controls the first output interface 22 to output a second level signal to the USB state switching interface 23. Exemplarily, the first level signal is a low level signal, and the second level signal is a high level signal.

[0055] The control module 2 is also used to control the USB device to switch to the host state when the USB state switching interface 23 receives the first level signal, that is, Figure 3 and when the USB state switching interface 23 receives the second level signal, the USB device is controlled to switch to the slave state, ie Figure 3 USB_Device in the control module 2 is used to switch the master and slave states of the USB device according to the parity of the received falling edge signal.

[0056] As mentioned above, the embodiment of the utility model provides a USB device master-slave switching circuit, including a signal trigger module and a control module. When a user needs to switch the master-slave state of a USB device, the signal trigger module can be triggered, so that the signal trigger module generates a falling edge signal and transmits the falling edge signal to the control module. The control module records the number of times the falling edge signal is received and determines the parity of the number. When the number of falling edge signals is an odd number, the USB device is switched to the host state, and when the number is an even number, the USB device is switched to the host state. In the embodiment of the utility model, the user can switch the master-slave state of the USB device by triggering the signal trigger module. The process of master-slave switching does not require disassembly, which improves the efficiency of switching the master-slave state of the USB device and reduces labor costs. In addition, since the signal trigger module adopts a self-reset switch, it has a simple structure, a small size, a low cost, and a large product design space, and will not limit the appearance design of the product.

[0057] The embodiment of the utility model also provides a USB device, including the above-mentioned USB device master-slave switching circuit. As mentioned above, the embodiment of the utility model provides a USB device master-slave switching circuit, including a signal trigger module and a control module. When a user needs to switch the master-slave status of a USB device, the signal trigger module can be triggered, so that the signal trigger module generates a trigger signal and transmits the trigger signal to the control module. The control module controls the switching of the master-slave status of the UBS device by recording the number of times the trigger signal is received and determining the parity of the number. In the embodiment of the utility model, the user can switch the master-slave status of the USB device by triggering the signal trigger module. The process of master-slave switching does not require disassembly of the machine, which improves the efficiency of switching the master-slave status of the USB device and reduces labor costs.

[0058] The specific embodiments described above further describe the purpose, technical solutions and beneficial effects of the utility model in detail. It should be understood that the above description is only a specific embodiment of the utility model and is not intended to limit the protection scope of the utility model. It is particularly pointed out that for those skilled in the art, any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the utility model should be included in the protection scope of the utility model.

Claims

1. A USB device master-slave switching circuit, comprising a control module, wherein the control module is pre-configured to record times and determine the parity of corresponding times, characterized in that: It also includes a signal trigger module, the output end of the signal trigger module is connected to the input end of the control module; The signal trigger module is used to generate a trigger signal when triggered, and transmit the trigger signal to the control module; The control module is used to update the number of the trigger signal when receiving the trigger signal, and switch the master and slave states of the USB device according to the parity of the number.

2. A USB device master-slave switching circuit according to claim 1, characterized in that: The trigger signal is a falling edge signal, and the signal trigger module includes a button, a first resistor and a first voltage source; The first end of the button is connected to the ground, and the second end of the button is connected to the first end of the first resistor and the input end of the control module; The second end of the first resistor is connected to the output end of the first voltage source.

3. A USB device master-slave switching circuit according to claim 2, characterized in that: The button is a self-resetting switch.

4. A USB device master-slave switching circuit according to claim 2, characterized in that: The resistance of the first resistor ranges from 1 kΩ to 10 kΩ.

5. A USB device master-slave switching circuit according to claim 1, characterized in that: The control module is specifically used to control the USB device to switch to a host state when the number is an odd number, and to control the USB device to switch to a slave state when the number is an even number.

6. A USB device master-slave switching circuit according to claim 5, characterized in that: The control module includes a first input interface, a first output interface and a USB state switching interface, the first input interface is connected to the output end of the signal trigger module, and the first output interface is connected to the USB state switching interface; The first input interface is used to receive the trigger signal; The control module is used to record the number of times of the trigger signal, and when the number is an odd number, control the first output interface to output a first level signal, and when the number is an even number, control the first output interface to output a second level signal; The control module is further configured to control the USB device to switch to a host state when the USB state switching interface receives the first level signal, and to control the USB device to switch to a slave state when the USB state switching interface receives the second level signal.

7. A USB device master-slave switching circuit according to claim 6, characterized in that: The first level signal is a low level signal, and the second level signal is a high level signal.

8. A USB device master-slave switching circuit according to claim 6, characterized in that: The first input interface is a GPIO interface.

9. A USB device master-slave switching circuit according to claim 6, characterized in that: The first output interface is a GPIO interface.

10. A USB device, characterized in that: The invention comprises a UBS device master-slave switching circuit as claimed in any one of claims 1 to 9.