WO2016169140A1 - Usb接口复用的电路、方法和装置 - Google Patents

Usb接口复用的电路、方法和装置 Download PDF

Info

Publication number
WO2016169140A1
WO2016169140A1 PCT/CN2015/084376 CN2015084376W WO2016169140A1 WO 2016169140 A1 WO2016169140 A1 WO 2016169140A1 CN 2015084376 W CN2015084376 W CN 2015084376W WO 2016169140 A1 WO2016169140 A1 WO 2016169140A1
Authority
WO
WIPO (PCT)
Prior art keywords
module
switch
usb
usb interface
terminal
Prior art date
Application number
PCT/CN2015/084376
Other languages
English (en)
French (fr)
Inventor
邱腾渊
宋国栋
Original Assignee
中兴通讯股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Priority to US15/568,603 priority Critical patent/US10528492B2/en
Priority to RU2017138396A priority patent/RU2684577C1/ru
Priority to EP15889629.0A priority patent/EP3287905B1/en
Publication of WO2016169140A1 publication Critical patent/WO2016169140A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/10Program control for peripheral devices
    • G06F13/102Program control for peripheral devices where the programme performs an interfacing function, e.g. device driver
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/26Power supply means, e.g. regulation thereof
    • G06F1/32Means for saving power
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/14Handling requests for interconnection or transfer
    • G06F13/20Handling requests for interconnection or transfer for access to input/output bus
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/40Bus structure
    • G06F13/4004Coupling between buses
    • G06F13/4022Coupling between buses using switching circuits, e.g. switching matrix, connection or expansion network
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/40Bus structure
    • G06F13/4063Device-to-bus coupling
    • G06F13/4068Electrical coupling
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/40Bus structure
    • G06F13/4063Device-to-bus coupling
    • G06F13/4068Electrical coupling
    • G06F13/4072Drivers or receivers
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2213/00Indexing scheme relating to interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F2213/0042Universal serial bus [USB]

Definitions

  • the present invention relates to the field of terminal technologies, and in particular, to a circuit, method and device for multiplexing a Universal Serial Bus (USB) interface.
  • USB Universal Serial Bus
  • a USB device can be divided into a master device and a slave device.
  • a device has a USB master device function, when it is connected to a USB slave device, data can be acquired from the connected USB slave device.
  • USB main device functions such as a computer, a home gateway, a set-top box, etc.
  • a USB interface is set on the terminal, which is usually used as a main device interface, and is used to connect with a slave device such as a USB disk to implement data communication.
  • the terminal can also include a slave device module, and the peripheral device USB function device is connected to the slave device function module USB interface to implement debugging or acquiring information about the slave device module.
  • the peripheral device USB function device is connected to the slave device function module USB interface to implement debugging or acquiring information about the slave device module.
  • the main object of the present invention is to provide a circuit, method and device for multiplexing a USB interface, which can implement data transmission of a master device function and a slave device function using a standard USB interface.
  • the invention provides a circuit for multiplexing a USB interface, comprising a master device module, a slave device module, a switch module and a USB interface, wherein a detection end of the master device module is connected to a detection signal end of the USB interface, and the master device module
  • the first control output is connected to the first control input end of the switch module
  • the data end of the main device module is connected to the first data end of the switch module
  • the data end of the slave device module is connected to the switch module
  • the second data end of the switch module is connected to the data end of the USB interface.
  • the switch module includes a USB signal switch, and a control input end of the USB signal switch is connected as a first control input end of the switch module to a first control output end of the main device module, the USB signal switch
  • the first end of the switch module is connected to the data end of the main device module, and the second end of the USB signal switch is connected to the slave device module as a second data end of the switch module.
  • the data end, the third end of the USB signal switch is connected to the data end of the USB interface as a third data end of the switch module.
  • the second control output end of the main device module is connected to the second control input end of the switch module
  • the power input end of the switch module is connected to the power supply of the terminal
  • the power output end of the switch module is connected to the The power input of the USB interface.
  • the switch module further includes a current limiting switch and a diode connected in parallel with the current limiting switch, and a control input end of the current limiting switch is connected as a second control input end of the switch module to the main device module.
  • a second control output end the power input end of the current limiting switch is used as a power input end of the switch module to connect the power supply of the terminal, and the power output end of the current limiting switch is connected as the power output end of the switch module
  • a power input end of the USB interface, an anode of the diode is connected to a power input end of the current limiting switch, and a cathode of the diode is connected to a power output end of the current limiting switch.
  • the invention also proposes a USB interface multiplexing method, comprising the steps of:
  • the external device type is a USB host device, switching a USB signal switch of the switch module to the slave device module, and turning on a path between the slave device module and the USB interface;
  • the USB signal switch of the switch module is switched to the master device module, and the path between the master device module and the USB interface is turned on.
  • the step of switching the USB signal switch of the switch module to the slave device module and turning on the path between the slave device module and the USB interface further comprises:
  • the current limiting switch of the switch module is disconnected, so that the power of the terminal supplies power to the USB interface through the diode of the switch module.
  • the step of switching the USB signal switch of the switch module to the master device module, and the step of turning on the path between the master device module and the USB interface further comprises:
  • the current limiting switch of the switch module is turned on, so that the power of the terminal directly supplies power to the USB interface.
  • the invention also provides a device for multiplexing a USB interface, comprising a main device module and a switch module;
  • the master device module detects a USB signal, and determines an external device type that is currently connected to the USB interface; when the external device type is a USB master device, the master device module controls the switch module to turn on the slave device module and the a path between the USB interfaces; when the external device type is a USB slave device, the master device module controls the switch module to turn on a path between the master device module and the USB interface.
  • the switch module includes a USB signal switch; when the external device type is a USB host device, the master device module controls a USB signal switch of the switch module to switch to a slave device module; when the external device type When the device is a USB slave device, the master device module controls the USB signal switch of the switch module to switch to the master device module.
  • the switch module further includes a current limiting switch and a diode; when the external device type is a USB slave device, the master device module controls the current limiting switch of the switch module to be turned on, so that the power of the terminal is directly directed The USB interface is powered; when the external device type is a USB host device, the master device module controls the current limiting switch of the switch module to be disconnected, so that the power of the terminal supplies power to the USB interface through the diode.
  • the invention multiplexes the USB interface of the terminal as the main device function interface and the slave device function interface, so that only one USB interface is needed on the terminal to complete the main device function and the slave device function, and the terminal and the external device transmit data. Therefore, it is not necessary to separately develop an interface inside the single board, which saves the internal space of the single board and facilitates miniaturization of the terminal.
  • 1a is a schematic structural diagram of a first embodiment of a circuit for multiplexing a USB interface according to the present invention
  • FIG. 1b is a schematic structural diagram of a second embodiment of a circuit for multiplexing a USB interface according to the present invention
  • FIG. 2 is a flowchart of a first embodiment of a method for multiplexing a USB interface according to the present invention
  • FIG. 3 is a flowchart of a second embodiment of a method for multiplexing a USB interface according to the present invention.
  • FIG. 4 is a block diagram of an embodiment of an apparatus for multiplexing a USB interface according to the present invention.
  • FIG. 1a is a schematic structural diagram of a first embodiment of a circuit for multiplexing a USB interface according to the present invention.
  • This embodiment refers to a USB interface multiplexing circuit, including a main device module 100, a slave device module 200, a switch module 300, and a USB interface 400.
  • the detection end of the main device module 100 is connected to the detection signal end of the USB interface 400, and the main device module.
  • the first control output of the switch 100 is connected to the first control input of the switch module 300.
  • the data end of the main device module 100 is connected to the first data end of the switch module 300, and the data end of the slave device module 200 is connected to the second data of the switch module 300.
  • the third data end of the switch module 300 is connected to the data end of the USB interface 400.
  • the circuit of the USB interface multiplexed in this embodiment is disposed in the terminal, and the terminal can be a computer, a television, a set top box, and the like.
  • the main device module 100 is configured to detect a USB signal and determine the type of external device currently connected to the USB interface 400. If the external device is a USB slave device such as a USB flash drive, according to the USB specification, one of the two USB data lines of the peripheral device has a pull-up resistor of 1.5K ⁇ , and after power-on, the data line of the pull-up resistor has The level will be pulled high, and the master device module 100 can detect the level state in the USB data line of the peripheral device. If the level of a USB data line of the peripheral device is high, the external device type is USB slave. Device, otherwise USB master device.
  • the master device module 100 controls the switch module 300 to turn on the path between the slave device module 200 and the USB interface 400, so that the terminal implements the slave device function through the slave device module 200, and provides data to the external device. Or for external devices to debug the USB interface of the terminal.
  • the master device module 100 controls the switch module 300 to turn on the path between the master device module 100 and the USB interface 400, so that the terminal implements the master device function through the master device module 100, and acquires data of the external device. .
  • the USB interface of the terminal is simultaneously used as the master device function interface and the slave device function interface, so that only one USB interface is needed on the terminal to complete the master device function and the slave device function, and the terminal and the external device transmit data. It is convenient and does not need to separately develop the interface inside the board, which saves the internal space of the board and facilitates the miniaturization of the terminal.
  • the second control output end of the main device module 100 is connected to the second control input end of the switch module 300.
  • the power input end of the switch module 300 is connected to the power supply of the terminal, and the power output end of the switch module 300 is connected to the USB interface. Power input.
  • the main device module 100 controls the switch module 300 to be in the low voltage power supply mode, the switch module 300 lowers the power supply output voltage of the terminal, and supplies the reduced voltage to the USB interface 400.
  • the external device type is a USB slave device
  • the load current will increase due to the operation of the external USB slave device. The larger the current, the larger the power supply voltage drop. If the switch module 300 is still in the low voltage power supply mode, the voltage supply will be reduced.
  • the USB interface 400 when the load current is large, the terminal power supply voltage drop is too large, and the voltage output by the USB interface 400 cannot meet the USB specification of the external device.
  • the output voltage of the USB interface 400 needs to be increased, and the main device module 100
  • the control switch module 300 is switched to the high voltage power supply mode, and the switch module 300 directly supplies the power of the terminal to the USB interface 400.
  • the main device module 100 determines that the external device type is a USB host device, the terminal and the external device may supply power to the USB interface 400 at the same time. If the voltage provided by the terminal is too high, the power of the external device may be damaged, and if externally If the device voltage is too high, it may damage the power supply of the terminal. Therefore, at this time, the main device module 100 controls the switch module 300 to switch to the low voltage power supply mode, and the switch module 300 lowers the power output voltage of the terminal and supplies the reduced voltage to the USB interface 400.
  • the terminal When the terminal is multiplexed with the USB interface, the terminal has a problem that the voltage is too low or too high when the terminal supplies power to the USB interface, and provides a mode in which the output voltage of the USB interface is adjustable, and provides a sufficient working voltage when the external device is a slave device.
  • the external device is the main device, the terminal itself or the external device is prevented from providing excessive voltage to the peer device, which may cause damage to the peer device, and the security is higher.
  • FIG. 1b is a schematic structural diagram of a second embodiment of a circuit for multiplexing a USB interface according to the present invention.
  • the switch module 300 includes a USB signal switch 310.
  • the control input end of the USB signal switch 310 is connected to the first control output end of the main device module 100 as the first control input end of the switch module 300, and the USB signal switch 310 is One end of the switch module 300 is connected to the data end of the main device module 100, and the second end of the USB signal switch 310 is connected to the data end of the slave module 200 as the second data end of the switch module 300.
  • the USB signal switch 310 is connected.
  • the third end is connected to the data end of the USB interface 400 as the third data end of the switch module 300.
  • the main device module 100 sends a control signal to the USB signal switch 310, and controls the second end and the third end of the USB signal switch 310 to be turned on, and turns on the slave device module 200 and the USB interface 400.
  • the path between the terminals enables the terminal to implement the slave device function from the device module 200, provides data to the external device, or allows the external device to debug the USB interface of the terminal.
  • the master device module 100 sends a control signal to the USB signal switch 310, and controls the first end and the third end of the USB signal switch 310 to be turned on, and turns on the main device module 100 and the USB interface 400.
  • the path between the terminals enables the terminal to implement the function of the master device through the master device module 100, and acquires data of the external device.
  • the switch module 300 further includes a current limiting switch 320 and a diode 330 connected in parallel with the current limiting switch 320.
  • the control input of the current limiting switch 320 is connected to the second control of the main device module 100 as a second control input of the switching module 300.
  • the power input end of the current limiting switch 320 is used as the power input end of the switch module 300 to connect the power supply of the terminal.
  • the power output end of the current limiting switch 320 is used as the power output end of the switch module 300 to connect the power input end of the USB interface 400, and the diode.
  • the anode of 330 is connected to the power input end of the current limiting switch 320, and the cathode of the diode 330 is connected to the power supply of the current limiting switch 320. Output.
  • the main device module 100 When the USB interface 400 is not connected to the external device, the main device module 100 outputs a control signal to control the current limiting switch 320 to be disconnected, so that the power of the terminal is supplied to the USB interface 400 through the diode 330. Since the diode 330 has a voltage drop, the terminal power supply passes through the diode 330. After that, the voltage output to the USB interface 400 is lowered.
  • the external device type is a USB slave device
  • the output voltage of the USB interface 400 needs to be increased, and the control signal is output from the master device module 100 to the current limiting switch 320, and the current limiting switch 320 is controlled to be turned on, and the power of the terminal is directly supplied to the USB interface 400. , to provide sufficient working voltage for external devices.
  • the main device module 100 determines that the external device type is a USB host device, the terminal device and the external device simultaneously supply power to the USB interface 400. To avoid damage to the terminal power source or the power of the external device, the main device module 100 outputs a control signal to the current limit.
  • the switch 320 controls the current limiting switch 320 to be disconnected, so that the power of the terminal is stepped down by the diode 330 and then output to the USB interface 400. Since the diode 330 has a voltage drop, the output voltage of the USB interface 400 is smaller than the power supply voltage of the external device, which is guaranteed.
  • the external device is not damaged, and the unidirectional conduction characteristic of the diode 330 and the current limiting switch 320 have reverse overvoltage protection, which can prevent the output voltage of the external device from being excessively high and avoid damage to the internal power supply of the terminal.
  • FIG. 2 is a flowchart of a first embodiment of a method for multiplexing a USB interface according to the present invention.
  • the method for multiplexing the USB interface 400 proposed in this embodiment includes the following steps:
  • Step S10 detecting a USB signal, and determining an external device type currently connected to the USB interface 400;
  • the USB interface multiplexing circuit in the embodiment shown in FIG. 1a and/or FIG. 1b is adopted, and the USB interface multiplexing circuit is disposed in the terminal, and the terminal may be a computer, a television, a set top box, and the like.
  • the main device module 100 is configured to detect a USB signal and determine the type of external device currently connected to the USB interface 400. If the external device is a USB slave device such as a USB flash drive, according to the USB specification, one of the two USB data lines of the peripheral device has a pull-up resistor of 1.5K ⁇ , and after power-on, the data line of the pull-up resistor has The level will be pulled high, and the master device module 100 can detect the level state in the USB data line of the peripheral device. If the level of a USB data line of the peripheral device is high, the external device type is USB slave. Device, otherwise USB master device.
  • step S20 when the external device type is a USB host device, the USB signal switch 310 of the switch module 300 is switched to the slave device module 200, and the path between the slave device module 200 and the USB interface 400 is turned on;
  • the master device module 100 sends a control signal to the USB signal switch 310, and the control USB signal switch 310 turns on the path between the slave device module 200 and the USB interface 400, so that the terminal passes the slave device module 200.
  • Implement slave device functions provide data to external devices, or allow external devices to debug the terminal's USB interface.
  • step S30 when the external device type is a USB slave device, the USB signal switch 310 of the switch module 300 is switched to the master device module 100, and the path between the master device module 100 and the USB interface 400 is turned on.
  • the master device module 100 sends a control signal to the USB signal switch 310, and controls the USB signal switch 310 to turn on the path between the master device module 100 and the USB interface 400, so that the terminal passes through the master device module 100.
  • Implement the master device function to obtain data from the external device.
  • the USB interface of the terminal is simultaneously used as the master device function interface and the slave device function interface, so that only one USB interface is needed on the terminal to complete the master device function and the slave device function, and the terminal and the external device transmit data. It is convenient and does not need to separately develop the interface inside the board, which saves the internal space of the board and facilitates the miniaturization of the terminal.
  • FIG. 3 is a flowchart of a second embodiment of a method for multiplexing a USB interface according to the present invention. This embodiment includes all the steps in the embodiment shown in FIG. 2. After step S30, the method further includes:
  • Step S31 the current limiting switch 320 of the switch module 300 is turned on, so that the power of the terminal directly supplies power to the USB interface 400.
  • the main device module 100 controls the switch module 300 to be in the low voltage power supply mode, and the main device module 100 outputs a control signal to control the current limit switch 320 to be disconnected, so that the power of the terminal passes through the diode 330 to the USB interface 400.
  • Power supply due to the voltage drop of the diode 330, after the terminal power supply passes through the diode 330, the voltage output to the USB interface 400 is lowered.
  • the load current will increase due to the operation of the external USB slave device.
  • the larger the current the larger the power supply voltage drop.
  • the switch module 300 is still in the low voltage power supply mode, the voltage supply will be reduced.
  • the USB interface 400 when the load current is large, the terminal power supply voltage drop is too large, and the voltage output by the USB interface 400 cannot meet the USB specification of the external device. In this case, the output voltage of the USB interface 400 needs to be increased, and the main device module 100
  • the control switch module 300 switches to the high voltage power supply mode, and the main device module 100 outputs a control signal to the current limiting switch 320 to control the current limiting switch 320 to be turned on.
  • the power of the terminal is directly supplied to the USB interface 400 to provide a sufficient operating voltage for the external device.
  • the method further includes:
  • step S21 the current limiting switch 320 of the switch module 300 is turned off, and the power of the terminal is supplied to the USB interface 400 through the diode 330 of the switch module 300.
  • the terminal and the external device may supply power to the USB interface 400 at the same time. If the voltage provided by the terminal is too high, the power of the external device may be damaged, and if externally If the device voltage is too high, it may damage the power supply of the terminal. Therefore, at this time, the main device module 100 controls the switch module 300 to switch to the low voltage power supply mode, and the main device module 100 outputs a control signal to the current limiting switch 320 to control the current limiting switch 320 to be disconnected, so that the power of the terminal is stepped down by the diode 330.
  • the output voltage of the USB interface 400 is smaller than the power supply voltage of the external device due to the voltage drop of the diode 330, so that the external device can be prevented from being damaged, and the unidirectional conduction characteristic of the diode 330 and the current limiting switch 320 have opposite
  • the overvoltage protection prevents the output voltage of the external device from being too high and avoids damage to the internal power supply of the terminal.
  • the terminal When the terminal is multiplexed with the USB interface, the terminal has a problem that the voltage is too low or too high when the terminal supplies power to the USB interface, and provides a mode in which the output voltage of the USB interface is adjustable, and provides a sufficient working voltage when the external device is a slave device.
  • the external device is the main device, the terminal itself or the external device is prevented from providing excessive voltage to the peer device, which may cause damage to the peer device, and the security is higher.
  • FIG. 4 is a schematic block diagram of an embodiment of a device for multiplexing a USB interface according to the present invention.
  • the device for multiplexing the USB interface provided in this embodiment includes a master device module 100, a slave device module 200, a switch module 300, and a USB interface 400.
  • the master device module 100 detects a USB signal and determines the type of the external device currently connected to the USB interface 400.
  • the master device module 100 controls the switch module 300 to turn on the path between the slave device module 200 and the USB interface 400; when the external device type is a USB slave device, the master device module 100 controls the switch Module 300 is connected The path between the master device module 100 and the USB interface 400.
  • the USB interface multiplexing circuit in the embodiment shown in FIG. 1a and/or FIG. 1b is adopted, and the USB interface multiplexing circuit is disposed in the terminal, and the terminal may be a computer, a television, a set top box, and the like.
  • the main device module 100 is configured to detect a USB signal and determine the type of external device currently connected to the USB interface 400. If the external device is a USB slave device such as a USB flash drive, according to the USB specification, one of the two USB data lines of the peripheral device has a pull-up resistor of 1.5K ⁇ , and after power-on, the data line of the pull-up resistor has The level will be pulled high, and the master device module 100 can detect the level state in the USB data line of the peripheral device. If the level of a USB data line of the peripheral device is high, the external device type is USB slave. Device, otherwise USB master device.
  • the master device module 100 controls the switch module 300 to turn on the path between the slave device module 200 and the USB interface 400, so that the terminal implements the slave device function through the slave device module 200, and provides data to the external device. Or for external devices to debug the USB interface of the terminal.
  • the master device module 100 controls the switch module 300 to turn on the path between the master device module 100 and the USB interface 400, so that the terminal implements the master device function through the master device module 100, and acquires data of the external device. .
  • the USB interface of the terminal is simultaneously used as the master device function interface and the slave device function interface, so that only one USB interface is needed on the terminal to complete the master device function and the slave device function, and the terminal and the external device transmit data. It is convenient and does not need to separately develop the interface inside the board, which saves the internal space of the board and facilitates the miniaturization of the terminal.
  • the switch module 300 includes a USB signal switch 310; when the external device type is a USB host device, the master device module 100 controls the USB signal switch 310 of the switch module 300 to switch to the slave device module 200; when the external device type is a USB slave device At this time, the main device module 100 controls the USB signal switch 310 of the switch module 300 to switch to the main device module 100.
  • the main device module 100 when the external device type is a USB host device, the main device module 100 sends a control signal to the USB signal switch 310, and controls the second end and the third end of the USB signal switch 310 to be turned on, and the slave device module 200 is turned on.
  • the path between the USB interface 400 and the terminal enables the terminal to provide data from the device module 200 to the external device, or the external device to debug the USB interface of the terminal.
  • the external device type is a USB slave device
  • the master device module 100 sends a control signal to the USB signal switch 310, and controls the first end and the third end of the USB signal switch 310 to be turned on, and turns on the main device module 100 and the USB interface 400.
  • the path between the terminals enables the terminal to implement the function of the master device through the master device module 100, and acquires data of the external device.
  • the switch module 300 further includes a current limiting switch 320 and a diode 330.
  • the main device module 100 controls the current limiting switch 320 of the switch module 300 to be turned on, so that the power of the terminal directly goes to the USB interface.
  • the main device module 100 controls the current limiting switch 320 of the switch module 300 to be disconnected, so that the power of the terminal passes through the diode 330 to supply power to the USB interface 400.
  • the main device module 100 controls the switch module 300 to be in the low voltage power supply mode, and the main device module 100 outputs a control signal to control the current limit switch 320 to be disconnected, so that the power of the terminal passes through the diode.
  • 330 supplies power to the USB interface 400. Since the diode 330 has a voltage drop, the terminal power supply passes through the diode 330, and the voltage output to the USB interface 400 decreases.
  • the load current will increase due to the operation of the external USB slave device.
  • the larger the current the larger the power supply voltage drop.
  • the switch module 300 is still in the low voltage power supply mode, the voltage supply will be reduced.
  • the USB interface 400 when the load current is large, the terminal power supply voltage drop is too large, and the voltage output by the USB interface 400 cannot meet the USB specification of the external device. In this case, the output voltage of the USB interface 400 needs to be increased, and the main device module 100
  • the control switch module 300 switches to the high voltage power supply mode, and the main device module 100 outputs a control signal to the current limiting switch 320 to control the current limiting switch 320 to be turned on.
  • the power of the terminal is directly supplied to the USB interface 400 to provide a sufficient operating voltage for the external device.
  • the terminal and the external device may supply power to the USB interface 400 at the same time. If the voltage provided by the terminal is too high, the power of the external device may be damaged, and if externally If the device voltage is too high, it may damage the power supply of the terminal. Therefore, at this time, the main device module 100 controls the switch module 300 to switch to the low voltage power supply mode, and the main device module 100 outputs a control signal to the current limiting switch 320 to control the current limiting switch 320 to be disconnected, so that the power of the terminal is stepped down by the diode 330.
  • the output voltage of the USB interface 400 is smaller than the power supply voltage of the external device due to the voltage drop of the diode 330, so that the external device can be prevented from being damaged, and the unidirectional conduction characteristic of the diode 330 and the current limiting switch 320 have opposite
  • the overvoltage protection prevents the output voltage of the external device from being too high and avoids damage to the internal power supply of the terminal.
  • the terminal When the terminal is multiplexed with the USB interface, the terminal has a problem that the voltage is too low or too high when the terminal supplies power to the USB interface, and provides a mode in which the output voltage of the USB interface is adjustable, and provides a sufficient working voltage when the external device is a slave device.
  • the external device is the main device, the terminal itself or the external device is prevented from providing excessive voltage to the peer device, which may cause damage to the peer device, and the security is higher.
  • the present invention multiplexes the USB interface of the terminal as a master device function interface and a slave device function interface, so that only one USB interface is required on the terminal to complete the master device function and the slave device function. It is convenient to transfer data between the terminal and the external device, and it is not necessary to separately develop the interface inside the board, which saves the internal space of the board and facilitates the miniaturization of the terminal.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Mathematical Physics (AREA)
  • Power Sources (AREA)
  • Information Transfer Systems (AREA)

Abstract

一种USB接口复用的电路,包括主设备模块(100)、从设备模块(200)、开关模块(300)和通用串行总线(USB)接口(400),所述主设备模块(100)的检测端连接USB接口(400)的检测信号端,所述主设备模块(100)的第一控制输出端连接所述开关模块(300)的第一控制输入端,所述主设备模块(100)的数据端连接所述开关模块(300)的第一数据端,所述从设备模块(200)的数据端连接所述开关模块(300)的第二数据端,所述开关模块(300)的第三数据端连接所述USB接口(400)的数据端。一种USB接口复用的电路、装置和USB接口复用的实现方法,使得终端的USB接口(400)同时作为主设备功能接口和从设备功能接口复用,终端上只需要一个USB接口即可完成主设备功能和从设备功能,为终端与外部设备传输数据提供了方便。

Description

USB接口复用的电路、方法和装置 技术领域
本发明涉及终端技术领域,特别涉及通用串行总线(Universal Serial Bus,简称为USB)接口复用的电路、方法和装置。
背景技术
USB设备可分为主设备(host)和从设备(slave),当一台设备具有USB主设备功能时,当它与一台USB从设备连接时,可以从已连接的USB从设备中获取数据,实现数据传输。目前很多终端都具备USB主设备功能,例如电脑、家庭网关、机顶盒等,终端上设置USB接口,通常是作为主设备接口,用来与U盘等从设备连接,实现数据通讯。
终端除了具备主设备功能模块外,通常还可包括从设备模块,由其他外设USB主设备连接终端的从设备功能模块USB接口,实现对USB接口调试或获取从设备模块相关信息。为同时实现终端的主设备和从设备功能,除了在终端上设置普通USB接口作为主设备接口,通常还需要单独在单板内部预留一个USB接插件来作为从设备接口。但是,由于USB接插件较大,不利于终端小型化,而且由于USB接插件设置在单板内部,当需要使用USB接插件时,往往需要将终端的结构件拆开,使用不便。
发明内容
本发明的主要目的为提供一种USB接口复用的电路、方法和装置,能够使用一个标准的USB接口实现终端的主设备功能和从设备功能的数据传输。
本发明提出一种USB接口复用的电路,包括主设备模块、从设备模块、开关模块和USB接口,所述主设备模块的检测端连接所述USB接口的检测信号端,所述主设备模块的第一控制输出端连接所述开关模块的第一控制输入端,所述主设备模块的数据端连接所述开关模块的第一数据端,所述从设备模块的数据端连接所述开关模块的第二数据端,所述开关模块的第三数据端连接所述USB接口的数据端。
优选地,所述开关模块包括USB信号开关,所述USB信号开关的控制输入端作为所述开关模块的第一控制输入端连接所述主设备模块的第一控制输出端,所述USB信号开关的第一端作为所述开关模块的第一数据端连接所述主设备模块的数据端,所述USB信号开关的第二端作为所述开关模块的第二数据端连接所述从设备模块的数据端,所述USB信号开关的第三端作为所述开关模块的第三数据端连接所述USB接口的数据端。
优选地,所述主设备模块的第二控制输出端连接所述开关模块的第二控制输入端,所述开关模块的电源输入端连接终端的电源,所述开关模块的电源输出端连接所述USB接口的电源输入端。
优选地,所述开关模块还包括限流开关和与所述限流开关并联的二极管,所述限流开关的控制输入端作为所述开关模块的第二控制输入端连接所述主设备模块的第二控制输出端,所述限流开关的电源输入端作为所述开关模块的电源输入端连接终端的电源,所述限流开关的电源输出端作为所述开关模块的电源输出端连接所述USB接口的电源输入端,所述二极管的阳极连接所述限流开关的电源输入端,所述二极管的阴极连接所述限流开关的电源输出端。
本发明还提出USB接口复用的方法,包括步骤:
检测USB信号,判断当前接入USB接口的外部设备类型;
当所述外部设备类型为USB主设备时,将开关模块的USB信号开关切换至从设备模块,接通从设备模块与所述USB接口之间的通路;
当所述外部设备类型为USB从设备时,将开关模块的USB信号开关切换至主设备模块,接通主设备模块与所述USB接口之间的通路。
优选地,所述当外部设备类型为USB主设备时,将开关模块的USB信号开关切换至从设备模块,接通从设备模块与所述USB接口之间的通路的步骤之后还包括:
断开开关模块的限流开关,使终端的电源经过所述开关模块的二极管向所述USB接口供电。
优选地,所述当外部设备类型为USB从设备时,将开关模块的USB信号开关切换至主设备模块,接通主设备模块与所述USB接口之间的通路的步骤之后还包括:
导通开关模块的限流开关,使终端的电源直接向所述USB接口供电。
本发明还提出一种USB接口复用的装置,包括主设备模块和开关模块;
所述主设备模块检测USB信号,判断当前接入USB接口的外部设备类型;当所述外部设备类型为USB主设备时,所述主设备模块控制所述开关模块接通从设备模块与所述USB接口之间的通路;当所述外部设备类型为USB从设备时,所述主设备模块控制所述开关模块接通主设备模块与所述USB接口之间的通路。
优选地,所述开关模块包括USB信号开关;当所述外部设备类型为USB主设备时,所述主设备模块控制所述开关模块的USB信号开关切换至从设备模块;当所述外部设备类型为USB从设备时,所述主设备模块控制所述开关模块的USB信号开关切换至主设备模块。
优选地,所述开关模块还包括限流开关和二极管;当所述外部设备类型为USB从设备时,所述主设备模块控制所述开关模块的限流开关导通,使终端的电源直接向所述USB接口供电;当所述外部设备类型为USB主设备时,所述主设备模块控制所述开关模块的限流开关断开,使终端的电源经过所述二极管向所述USB接口供电。
本发明将终端的USB接口同时作为主设备功能接口和从设备功能接口复用,使终端上只需要一个USB接口即可完成主设备功能和从设备功能,为终端与外部设备传输数据提供了方 便,且无须在单板内部单独开发接口,节省了单板内部空间,便于终端的小型化设计。
附图说明
图1a为本发明USB接口复用的电路的第一实施例的结构示意图;
图1b为本发明USB接口复用的电路的第二实施例的结构示意图;
图2为本发明USB接口复用的方法的第一实施例的流程图;
图3为本发明USB接口复用的方法的第二实施例的流程图;
图4为本发明USB接口复用的装置的实施例的模块示意图。
本发明目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。
具体实施方式
应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。
如图1a所示,图1a为本发明USB接口复用的电路的第一实施例的结构示意图。本实施例提到USB接口复用的电路,包括主设备模块100、从设备模块200、开关模块300和USB接口400,主设备模块100的检测端连接USB接口400的检测信号端,主设备模块100的第一控制输出端连接开关模块300的第一控制输入端,主设备模块100的数据端连接开关模块300的第一数据端,从设备模块200的数据端连接开关模块300的第二数据端,开关模块300的第三数据端连接USB接口400的数据端。
本实施例的USB接口复用的电路设于终端内,终端可为电脑、电视机、机顶盒等设备。主设备模块100设置为检测USB信号,判断当前接入USB接口400的外部设备类型。如果外部设备为U盘等USB从设备,根据USB规范,外设设备两根USB数据线中的一根线存在1.5KΩ的上拉电阻,上电后,有上拉电阻的那根数据线的电平会被拉高,主设备模块100可检测外设设备的USB数据线中的电平状态,如果外设设备的一根USB数据线的电平为高,则该外部设备类型为USB从设备,否则为USB主设备。
当外部设备类型为USB主设备时,主设备模块100控制开关模块300接通从设备模块200与USB接口400之间的通路,使终端通过从设备模块200实现从设备功能,向外部设备提供数据,或供外部设备对终端的USB接口进行调试。当外部设备类型为USB从设备时,主设备模块100控制开关模块300接通主设备模块100与USB接口400之间的通路,使终端通过主设备模块100实现主设备功能,获取外部设备的数据。
本实施例将终端的USB接口同时作为主设备功能接口和从设备功能接口复用,使终端上只需要一个USB接口即可完成主设备功能和从设备功能,为终端与外部设备传输数据提供了方便,且无须在单板内部单独开发接口,节省了单板内部空间,便于终端的小型化设计。
优选的,图1a中,主设备模块100的第二控制输出端连接开关模块300的第二控制输入端,开关模块300的电源输入端连接终端的电源,开关模块300的电源输出端连接USB接口的电源输入端。
在USB接口400未连接外部设备时,主设备模块100控制开关模块300处于低电压供电模式,开关模块300使终端的电源输出电压降低,并将降低后的电压供给USB接口400。当外部设备类型为USB从设备时,由于外部USB从设备工作时负载电流会增大,电流越大,电源压降越大,如果开关模块300仍然处于低电压供电模式,将降低后的电压供给USB接口400,当负载电流较大时,终端电源压降过大,USB接口400输出的电压无法满足外部设备的USB规范要求,此时需调高USB接口400的输出电压,由主设备模块100控制开关模块300切换至高电压供电模式,开关模块300将终端的电源直接供给USB接口400。当主设备模块100判断出外部设备类型为USB主设备时,此时终端和外部设备可能会同时向USB接口400供电,如果终端提供的电压过高,则可能会损坏外部设备的电源,反之如果外部设备电压过高,则也可能会损坏终端的电源。因此,此时主设备模块100控制开关模块300切换至低电压供电模式,开关模块300使终端的电源输出电压降低,并将降低后的电压供给USB接口400。
本实施例针对USB接口复用时,终端向USB接口供电时存在电压过低或过高的问题,提供了USB接口输出电压可调的模式,在外部设备为从设备时提供足够的工作电压,在外部设备为主设备时有效避免终端本身或外接设备向对端设备提供过高电压造成对端设备损坏的风险,安全性更高。
如图1b所示,图1b为本发明USB接口复用的电路的第二实施例的结构示意图。本实施例中,开关模块300包括USB信号开关310,USB信号开关310的控制输入端作为开关模块300的第一控制输入端连接主设备模块100的第一控制输出端,USB信号开关310的第一端作为开关模块300的第一数据端连接主设备模块100的数据端,USB信号开关310的第二端作为开关模块300的第二数据端连接从设备模块200的数据端,USB信号开关310的第三端作为开关模块300的第三数据端连接USB接口400的数据端。
当外部设备类型为USB主设备时,主设备模块100发送控制信号到USB信号开关310,控制USB信号开关310的第二端和第三端导通,接通从设备模块200与USB接口400之间的通路,使终端通过从设备模块200实现从设备功能,向外部设备提供数据,或供外部设备对终端的USB接口进行调试。当外部设备类型为USB从设备时,主设备模块100发送控制信号到USB信号开关310,控制USB信号开关310的第一端和第三端导通,接通主设备模块100与USB接口400之间的通路,使终端通过主设备模块100实现主设备功能,获取外部设备的数据。
优选的,开关模块300还包括限流开关320和与限流开关320并联的二极管330,限流开关320的控制输入端作为开关模块300的第二控制输入端连接主设备模块100的第二控制输出端,限流开关320的电源输入端作为开关模块300的电源输入端连接终端的电源,限流开关320的电源输出端作为开关模块300的电源输出端连接USB接口400的电源输入端,二极管330的阳极连接限流开关320的电源输入端,二极管330的阴极连接限流开关320的电源 输出端。
在USB接口400未连接外部设备时,主设备模块100输出控制信号控制限流开关320断开,使终端的电源经过二极管330向USB接口400供电,由于二极管330存在压降,终端电源经二极管330后,输出给USB接口400的电压降低。当外部设备类型为USB从设备时,需调高USB接口400的输出电压,由主设备模块100输出控制信号至限流开关320,控制限流开关320导通,终端的电源直接供给USB接口400,为外部设备提供足够的工作电压。当主设备模块100判断出外部设备类型为USB主设备时,此时终端和外部设备会同时向USB接口400供电,为避免损坏终端电源或外部设备的电源,主设备模块100输出控制信号到限流开关320,控制限流开关320断开,使终端的电源经过二极管330降压后再输出给USB接口400,由于二极管330存在压降,USB接口400的输出电压小于外部设备的供电电压,可保证外部设备不会损坏,同时二极管330的单向导通特性以及限流开关320具有反向过压保护,可以防止外部设备的输出电压过高,避免了损坏终端的内部电源。
如图2所示,图2为本发明USB接口复用的方法的第一实施例的流程图。本实施例提出的USB接口400复用的方法,包括步骤:
步骤S10,检测USB信号,判断当前接入USB接口400的外部设备类型;
本实施例采用了图1a和/或图1b所示实施例中的USB接口复用的电路,USB接口复用的电路设于终端内,终端可为电脑、电视机、机顶盒等设备。主设备模块100设置为检测USB信号,判断当前接入USB接口400的外部设备类型。如果外部设备为U盘等USB从设备,根据USB规范,外设设备两根USB数据线中的一根线存在1.5KΩ的上拉电阻,上电后,有上拉电阻的那根数据线的电平会被拉高,主设备模块100可检测外设设备的USB数据线中的电平状态,如果外设设备的一根USB数据线的电平为高,则该外部设备类型为USB从设备,否则为USB主设备。
步骤S20,当外部设备类型为USB主设备时,将开关模块300的USB信号开关310切换至从设备模块200,接通从设备模块200与USB接口400之间的通路;
当外部设备类型为USB主设备时,主设备模块100发送控制信号到USB信号开关310,控制USB信号开关310接通从设备模块200与USB接口400之间的通路,使终端通过从设备模块200实现从设备功能,向外部设备提供数据,或供外部设备对终端的USB接口进行调试。
步骤S30,当外部设备类型为USB从设备时,将开关模块300的USB信号开关310切换至主设备模块100,接通主设备模块100与USB接口400之间的通路。
当外部设备类型为USB从设备时,主设备模块100发送控制信号到USB信号开关310,控制USB信号开关310接通主设备模块100与USB接口400之间的通路,使终端通过主设备模块100实现主设备功能,获取外部设备的数据。
本实施例将终端的USB接口同时作为主设备功能接口和从设备功能接口复用,使终端上只需要一个USB接口即可完成主设备功能和从设备功能,为终端与外部设备传输数据提供了 方便,且无须在单板内部单独开发接口,节省了单板内部空间,便于终端的小型化设计。
如图3所示,图3为本发明USB接口复用的方法的第二实施例的流程图。本实施例包括图2所示实施例中的所有步骤,在步骤S30之后还包括:
步骤S31,导通开关模块300的限流开关320,使终端的电源直接向USB接口400供电。
在USB接口400未连接外部设备时,主设备模块100控制开关模块300处于低电压供电模式,主设备模块100输出控制信号控制限流开关320断开,使终端的电源经过二极管330向USB接口400供电,由于二极管330存在压降,终端电源经二极管330后,输出给USB接口400的电压降低。
当外部设备类型为USB从设备时,由于外部USB从设备工作时负载电流会增大,电流越大,电源压降越大,如果开关模块300仍然处于低电压供电模式,将降低后的电压供给USB接口400,当负载电流较大时,终端电源压降过大,USB接口400输出的电压无法满足外部设备的USB规范要求,此时需调高USB接口400的输出电压,由主设备模块100控制开关模块300切换至高电压供电模式,由主设备模块100输出控制信号至限流开关320,控制限流开关320导通,终端的电源直接供给USB接口400,为外部设备提供足够的工作电压。
优选的,在步骤S20之后还包括:
步骤S21,断开开关模块300的限流开关320,使终端的电源经过开关模块300的二极管330向USB接口400供电。
当主设备模块100判断出外部设备类型为USB主设备时,此时终端和外部设备可能会同时向USB接口400供电,如果终端提供的电压过高,则可能会损坏外部设备的电源,反之如果外部设备电压过高,则也可能会损坏终端的电源。因此,此时主设备模块100控制开关模块300切换至低电压供电模式,主设备模块100输出控制信号到限流开关320,控制限流开关320断开,使终端的电源经过二极管330降压后再输出给USB接口400,由于二极管330存在压降,USB接口400的输出电压小于外部设备的供电电压,可保证外部设备不会损坏,同时二极管330的单向导通特性以及限流开关320具有反向过压保护,可以防止外部设备的输出电压过高,避免了损坏终端的内部电源。
本实施例针对USB接口复用时,终端向USB接口供电时存在电压过低或过高的问题,提供了USB接口输出电压可调的模式,在外部设备为从设备时提供足够的工作电压,在外部设备为主设备时有效避免终端本身或外接设备向对端设备提供过高电压造成对端设备损坏的风险,安全性更高。
如图4所示,图4为本发明USB接口复用的装置的实施例的模块示意图。本实施例提出的USB接口复用的装置,包括主设备模块100、从设备模块200、开关模块300和USB接口400,主设备模块100检测USB信号,判断当前接入USB接口400的外部设备类型;当外部设备类型为USB主设备时,主设备模块100控制开关模块300接通从设备模块200与USB接口400之间的通路;当外部设备类型为USB从设备时,主设备模块100控制开关模块300接 通主设备模块100与USB接口400之间的通路。
本实施例采用了图1a和/或图1b所示实施例中的USB接口复用的电路,USB接口复用的电路设于终端内,终端可为电脑、电视机、机顶盒等设备。主设备模块100设置为检测USB信号,判断当前接入USB接口400的外部设备类型。如果外部设备为U盘等USB从设备,根据USB规范,外设设备两根USB数据线中的一根线存在1.5KΩ的上拉电阻,上电后,有上拉电阻的那根数据线的电平会被拉高,主设备模块100可检测外设设备的USB数据线中的电平状态,如果外设设备的一根USB数据线的电平为高,则该外部设备类型为USB从设备,否则为USB主设备。
当外部设备类型为USB主设备时,主设备模块100控制开关模块300接通从设备模块200与USB接口400之间的通路,使终端通过从设备模块200实现从设备功能,向外部设备提供数据,或供外部设备对终端的USB接口进行调试。当外部设备类型为USB从设备时,主设备模块100控制开关模块300接通主设备模块100与USB接口400之间的通路,使终端通过主设备模块100实现主设备功能,获取外部设备的数据。
本实施例将终端的USB接口同时作为主设备功能接口和从设备功能接口复用,使终端上只需要一个USB接口即可完成主设备功能和从设备功能,为终端与外部设备传输数据提供了方便,且无须在单板内部单独开发接口,节省了单板内部空间,便于终端的小型化设计。
优选的,开关模块300包括USB信号开关310;当外部设备类型为USB主设备时,主设备模块100控制开关模块300的USB信号开关310切换至从设备模块200;当外部设备类型为USB从设备时,主设备模块100控制开关模块300的USB信号开关310切换至主设备模块100。
本实施例中,当外部设备类型为USB主设备时,主设备模块100发送控制信号到USB信号开关310,控制USB信号开关310的第二端和第三端导通,接通从设备模块200与USB接口400之间的通路,使终端通过从设备模块200实现从设备功能,向外部设备提供数据,或供外部设备对终端的USB接口进行调试。当外部设备类型为USB从设备时,主设备模块100发送控制信号到USB信号开关310,控制USB信号开关310的第一端和第三端导通,接通主设备模块100与USB接口400之间的通路,使终端通过主设备模块100实现主设备功能,获取外部设备的数据。
优选的,开关模块300还包括限流开关320和二极管330;当外部设备类型为USB从设备时,主设备模块100控制开关模块300的限流开关320导通,使终端的电源直接向USB接口400供电;当外部设备类型为USB主设备时,主设备模块100控制开关模块300的限流开关320断开,使终端的电源经过二极管330向USB接口400供电。
本实施例中,在USB接口400未连接外部设备时,主设备模块100控制开关模块300处于低电压供电模式,主设备模块100输出控制信号控制限流开关320断开,使终端的电源经过二极管330向USB接口400供电,由于二极管330存在压降,终端电源经二极管330后,输出给USB接口400的电压降低。
当外部设备类型为USB从设备时,由于外部USB从设备工作时负载电流会增大,电流越大,电源压降越大,如果开关模块300仍然处于低电压供电模式,将降低后的电压供给USB接口400,当负载电流较大时,终端电源压降过大,USB接口400输出的电压无法满足外部设备的USB规范要求,此时需调高USB接口400的输出电压,由主设备模块100控制开关模块300切换至高电压供电模式,由主设备模块100输出控制信号至限流开关320,控制限流开关320导通,终端的电源直接供给USB接口400,为外部设备提供足够的工作电压。
当主设备模块100判断出外部设备类型为USB主设备时,此时终端和外部设备可能会同时向USB接口400供电,如果终端提供的电压过高,则可能会损坏外部设备的电源,反之如果外部设备电压过高,则也可能会损坏终端的电源。因此,此时主设备模块100控制开关模块300切换至低电压供电模式,主设备模块100输出控制信号到限流开关320,控制限流开关320断开,使终端的电源经过二极管330降压后再输出给USB接口400,由于二极管330存在压降,USB接口400的输出电压小于外部设备的供电电压,可保证外部设备不会损坏,同时二极管330的单向导通特性以及限流开关320具有反向过压保护,可以防止外部设备的输出电压过高,避免了损坏终端的内部电源。
本实施例针对USB接口复用时,终端向USB接口供电时存在电压过低或过高的问题,提供了USB接口输出电压可调的模式,在外部设备为从设备时提供足够的工作电压,在外部设备为主设备时有效避免终端本身或外接设备向对端设备提供过高电压造成对端设备损坏的风险,安全性更高。
工业实用性:通过上述描述可知,本发明将终端的USB接口同时作为主设备功能接口和从设备功能接口复用,使终端上只需要一个USB接口即可完成主设备功能和从设备功能,为终端与外部设备传输数据提供了方便,且无须在单板内部单独开发接口,节省了单板内部空间,便于终端的小型化设计。
以上所述仅为本发明的优选实施例,并非因此限制本发明的专利范围,凡是利用本发明说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本发明的专利保护范围内。

Claims (10)

  1. 一种通用串行总线USB接口复用的电路,包括设备模块、从设备模块、开关模块和USB接口,所述主设备模块的检测端连接所述USB接口的检测信号端,所述主设备模块的第一控制输出端连接所述开关模块的第一控制输入端,所述主设备模块的数据端连接所述开关模块的第一数据端,所述从设备模块的数据端连接所述开关模块的第二数据端,所述开关模块的第三数据端连接所述USB接口的数据端。
  2. 如权利要求1所述的USB接口复用的电路,其中,所述开关模块包括USB信号开关,所述USB信号开关的控制输入端作为所述开关模块的第一控制输入端连接所述主设备模块的第一控制输出端,所述USB信号开关的第一端作为所述开关模块的第一数据端连接所述主设备模块的数据端,所述USB信号开关的第二端作为所述开关模块的第二数据端连接所述从设备模块的数据端,所述USB信号开关的第三端作为所述开关模块的第三数据端连接所述USB接口的数据端。
  3. 如权利要求1或2所述的USB接口复用的电路,其中,所述主设备模块的第二控制输出端连接所述开关模块的第二控制输入端,所述开关模块的电源输入端连接终端的电源,所述开关模块的电源输出端连接所述USB接口的电源输入端。
  4. 如权利要求3所述的USB接口复用的电路,其中,所述开关模块还包括限流开关和与所述限流开关并联的二极管,所述限流开关的控制输入端作为所述开关模块的第二控制输入端连接所述主设备模块的第二控制输出端,所述限流开关的电源输入端作为所述开关模块的电源输入端连接终端的电源,所述限流开关的电源输出端作为所述开关模块的电源输出端连接所述USB接口的电源输入端,所述二极管的阳极连接所述限流开关的电源输入端,所述二极管的阴极连接所述限流开关的电源输出端。
  5. 一种采用如权利要求1至4中任一项所述的通用串行总线USB接口复用的电路实现的USB接口复用的方法,包括步骤:
    检测USB信号,判断当前接入USB接口的外部设备类型;
    当所述外部设备类型为USB主设备时,将开关模块的USB信号开关切换至从设备模块,接通从设备模块与所述USB接口之间的通路;
    当所述外部设备类型为USB从设备时,将开关模块的USB信号开关切换至主设备模块,接通主设备模块与所述USB接口之间的通路。
  6. 如权利要求5所述的USB接口复用的方法,其中,所述当外部设备类型为USB主设备时,将开关模块的USB信号开关切换至从设备模块,接通从设备模块与所述USB接口之间的通路的步骤之后还包括:
    断开开关模块的限流开关,使终端的电源经过所述开关模块的二极管向所述USB接口供电。
  7. 如权利要求5或6所述的USB接口复用的方法,其中,所述当外部设备类型为USB从设 备时,将开关模块的USB信号开关切换至主设备模块,接通主设备模块与所述USB接口之间的通路的步骤之后还包括:
    导通开关模块的限流开关,使终端的电源直接向所述USB接口供电。
  8. 一种采用如权利要求1至4中任一项所述的通用串行总线USB接口复用的电路实现的USB接口复用的装置,包括主设备模块、从设备模块、开关模块和USB接口;
    所述主设备模块检测USB信号,判断当前接入USB接口的外部设备类型;当所述外部设备类型为USB主设备时,所述主设备模块控制所述开关模块接通从设备模块与所述USB接口之间的通路;当所述外部设备类型为USB从设备时,所述主设备模块控制所述开关模块接通主设备模块与所述USB接口之间的通路。
  9. 如权利要求8所述的USB接口复用的装置,其中,所述开关模块包括USB信号开关;当所述外部设备类型为USB主设备时,所述主设备模块控制所述开关模块的USB信号开关切换至从设备模块;当所述外部设备类型为USB从设备时,所述主设备模块控制所述开关模块的USB信号开关切换至主设备模块。
  10. 如权利要求8或9所述的USB接口复用的装置,其中,所述开关模块还包括限流开关和二极管;当所述外部设备类型为USB从设备时,所述主设备模块控制所述开关模块的限流开关导通,使终端的电源直接向所述USB接口供电;当所述外部设备类型为USB主设备时,所述主设备模块控制所述开关模块的限流开关断开,使终端的电源经过所述二极管向所述USB接口供电。
PCT/CN2015/084376 2015-04-23 2015-07-17 Usb接口复用的电路、方法和装置 WO2016169140A1 (zh)

Priority Applications (3)

Application Number Priority Date Filing Date Title
US15/568,603 US10528492B2 (en) 2015-04-23 2015-07-17 Circuit, method and apparatus for USB interface sharing
RU2017138396A RU2684577C1 (ru) 2015-04-23 2015-07-17 Схема, способ и устройство для совместного использования интерфейса usb
EP15889629.0A EP3287905B1 (en) 2015-04-23 2015-07-17 Circuit, method and apparatus for usb interface sharing

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510194930.X 2015-04-23
CN201510194930.XA CN106155967A (zh) 2015-04-23 2015-04-23 Usb接口复用的电路、方法和装置

Publications (1)

Publication Number Publication Date
WO2016169140A1 true WO2016169140A1 (zh) 2016-10-27

Family

ID=57143488

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/084376 WO2016169140A1 (zh) 2015-04-23 2015-07-17 Usb接口复用的电路、方法和装置

Country Status (5)

Country Link
US (1) US10528492B2 (zh)
EP (1) EP3287905B1 (zh)
CN (1) CN106155967A (zh)
RU (1) RU2684577C1 (zh)
WO (1) WO2016169140A1 (zh)

Families Citing this family (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10996729B2 (en) * 2016-07-12 2021-05-04 Hewlett-Packard Development Company, L.P. Balancing a power load among USB ports
US20200132734A1 (en) * 2016-11-23 2020-04-30 Huawei Technologies Co., Ltd. Detection circuit and detection method for on-the-go device, and terminal
CN106774764B (zh) * 2016-12-05 2019-12-27 青岛海信移动通信技术股份有限公司 多电源供电usb接口的实现方法和usb电源
CN107563171B (zh) * 2017-09-11 2020-08-28 英业达科技有限公司 具有生物特征辨识模块的储存装置
CN108429693A (zh) * 2018-02-09 2018-08-21 上海康斐信息技术有限公司 一种调试口和网口复用的路由器及其控制方法
DE102018206934A1 (de) * 2018-05-04 2019-11-07 Continental Automotive Gmbh Gateway zur Datenkommunikation in einem Fahrzeug
CN109086234A (zh) * 2018-07-26 2018-12-25 上海闻泰电子科技有限公司 设备识别方法、装置、识别设备及存储介质
CN108984455A (zh) * 2018-09-21 2018-12-11 深圳市格劳瑞电子有限公司 一种usb接口控制装置及系统
FR3105468B1 (fr) * 2019-12-20 2022-02-11 Ingenico Group Dispositif d’interconnexion de deux terminaux
CN111324565A (zh) * 2020-03-19 2020-06-23 深圳源诚技术有限公司 一种多路usb接口切换系统及方法
CN111581129B (zh) * 2020-03-24 2022-05-31 西安广和通无线通信有限公司 终端主板电路、终端设备和adc接口复用控制方法
CN112579500A (zh) * 2020-12-08 2021-03-30 深圳市道通科技股份有限公司 一种防插错usb接口的提示方法、装置和电子设备

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060123175A1 (en) * 2004-12-03 2006-06-08 C-One Technology Corporation Universal serial bus access device with selectable modes
CN101369259A (zh) * 2008-09-05 2009-02-18 深圳创维数字技术股份有限公司 Usb接口主从设备模式的切换控制方法与装置和电子设备
CN102750248A (zh) * 2012-06-21 2012-10-24 中兴通讯股份有限公司 一种usb设备工作模式切换方法及usb设备
CN103019981A (zh) * 2012-11-16 2013-04-03 深圳市文鼎创数据科技有限公司 信号转接控制方法及信号转接装置

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI295885B (en) 2002-06-03 2008-04-11 Action Star Entpr Co Ltd Ubs sharer for use with an usb device
JP2004287960A (ja) * 2003-03-24 2004-10-14 Fuji Photo Film Co Ltd ホスト/ファンクション装置
TWI272495B (en) * 2005-04-14 2007-02-01 Richtek Technology Corp Configuration device and method for current output at USB port
US7480758B2 (en) * 2007-03-07 2009-01-20 Moai Electronics Corporation Method and apparatus for automatically switching between USB host and device
FR2927182B1 (fr) * 2008-02-05 2010-03-12 Sagem Defense Securite Dispositif de memoire de masse et systeme de stockage
US20100133908A1 (en) * 2008-11-28 2010-06-03 Lite-On It Corp. Usb device with internal assisting power
CN101989246A (zh) * 2009-07-29 2011-03-23 鸿富锦精密工业(深圳)有限公司 可自动切换usb主从设备模式的电子装置
CN103365388B (zh) * 2012-04-09 2017-02-22 华为终端有限公司 一种终端设备的供电方法及其终端设备
CN202651863U (zh) * 2012-06-28 2013-01-02 华为终端有限公司 充电器及充电系统

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060123175A1 (en) * 2004-12-03 2006-06-08 C-One Technology Corporation Universal serial bus access device with selectable modes
CN101369259A (zh) * 2008-09-05 2009-02-18 深圳创维数字技术股份有限公司 Usb接口主从设备模式的切换控制方法与装置和电子设备
CN102750248A (zh) * 2012-06-21 2012-10-24 中兴通讯股份有限公司 一种usb设备工作模式切换方法及usb设备
CN103019981A (zh) * 2012-11-16 2013-04-03 深圳市文鼎创数据科技有限公司 信号转接控制方法及信号转接装置

Also Published As

Publication number Publication date
US10528492B2 (en) 2020-01-07
EP3287905B1 (en) 2019-09-04
CN106155967A (zh) 2016-11-23
US20180121373A1 (en) 2018-05-03
EP3287905A1 (en) 2018-02-28
RU2684577C1 (ru) 2019-04-09
EP3287905A4 (en) 2018-04-18

Similar Documents

Publication Publication Date Title
WO2016169140A1 (zh) Usb接口复用的电路、方法和装置
TWI492044B (zh) 通用序列匯流排裝置的偵測系統及其方法
TW201606513A (zh) 顯示系統與顯示裝置及電視棒
US20210109580A1 (en) Usb device and operation method thereof
JP2016521023A (ja) 高精細度マルチメディアインターフェイスhdmiユニットおよびマルチメディア端末
CN108701106B (zh) 一种数据传输方法及设备
US20150253842A1 (en) Semiconductor device, and power control method for usbotg
US11256225B2 (en) Data transmission apparatus of circuit breaker controller
US10418213B2 (en) Port connection circuit, port connection control method and electronic device
TWI382685B (zh) 用於顯示器設備之電力監測及控制裝置
US10969853B2 (en) USB adapting circuit
TW201534022A (zh) 電子裝置供電系統
US20160274613A1 (en) Interface supply circuit
WO2017215672A1 (zh) Poe系统中的供电方法和供电设备
US20130300214A1 (en) Transmission cable, electronic device using the same, and method for switching operation mode of the electronic device
TWI545429B (zh) 電子裝置及供電介面
CN111966195B (zh) 一种启动控制电路及方法
JP6488208B2 (ja) 周辺装置、周辺装置システムおよび周辺装置の制御方法
CN106855848B (zh) Otg的供电控制系统及方法
US20160197548A1 (en) Anti-leakage supply circuit
US9213383B2 (en) Switching circuit module, computer system, and method for controlling computer system reset thereof
JP6450023B2 (ja) モバイル端末の拡張ベース、および拡張ベースのための電源管理方法
TWI590022B (zh) 電壓轉換電路
WO2018130065A1 (zh) 一种控制双摄像头的电路、移动终端和方法
US9705322B2 (en) DC power supply control system and circuit

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 15889629

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 15568603

Country of ref document: US

NENP Non-entry into the national phase

Ref country code: DE

WWE Wipo information: entry into national phase

Ref document number: 2017138396

Country of ref document: RU