WO2018086458A1 - Usb interface circuit, method and device for usb interface implementation, and computer storage medium - Google Patents

Usb interface circuit, method and device for usb interface implementation, and computer storage medium Download PDF

Info

Publication number
WO2018086458A1
WO2018086458A1 PCT/CN2017/107511 CN2017107511W WO2018086458A1 WO 2018086458 A1 WO2018086458 A1 WO 2018086458A1 CN 2017107511 W CN2017107511 W CN 2017107511W WO 2018086458 A1 WO2018086458 A1 WO 2018086458A1
Authority
WO
WIPO (PCT)
Prior art keywords
usb
voltage
signal line
circuit
port
Prior art date
Application number
PCT/CN2017/107511
Other languages
French (fr)
Chinese (zh)
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 中兴通讯股份有限公司
Publication of WO2018086458A1 publication Critical patent/WO2018086458A1/en

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/38Information transfer, e.g. on bus
    • G06F13/40Bus structure
    • G06F13/4063Device-to-bus 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
    • 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/42Bus transfer protocol, e.g. handshake; Synchronisation
    • 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/42Bus transfer protocol, e.g. handshake; Synchronisation
    • G06F13/4282Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus

Definitions

  • the present invention relates to the field of communications technologies, and in particular, to a USB interface circuit, a USB interface implementation method, apparatus, and computer storage medium.
  • USB Universal Serial Bus
  • USB A type USB interface ie, USB A type port
  • the USB interface acts as a host, and there are many types of connected devices, including printers, mobile hard disks, and card readers.
  • USB type A interface which is a USB host interface for connecting devices such as USB flash drives and printers.
  • CPE products often have another requirement, which requires a USB device interface for connecting to a PC, enabling debugging and downloading of software.
  • the CPE device Since the traditional tpyeA type USB interface can only be used for the USB host interface, in order to connect the PC, the CPE device must add another USB device interface to connect with the PC, which will increase the product cost to a certain extent. To a certain extent, it affects the appearance of the product, that is, the existing tpyeA type USB interface cannot support the connection with the USB device and the USB host at the same time.
  • the embodiment of the invention provides a USB interface circuit, a USB interface implementation method, a device and a computer storage medium. It is desirable to solve the problem that the USB A port cannot simultaneously support the connection with the USB device and the USB host.
  • An embodiment of the present invention provides a USB interface circuit, including:
  • USB A port configured to connect to a USB device or USB host
  • a comparison unit configured to compare the detected VBUS voltage of the USB A-type port with a preset first base voltage, and send the voltage comparison result to the processor
  • the processor is configured to process the signal line D+ and/or the signal line D- according to the voltage comparison result.
  • Another aspect of the embodiments of the present invention provides a method for implementing a USB interface, including:
  • the signal line D+ and/or the signal line D- are processed according to the voltage comparison result to match the USB interface circuit with the USB device or USB host to which the USB A port is connected.
  • Another embodiment of the present invention provides an apparatus for implementing a USB interface, including:
  • a comparison unit configured to compare the detected VBUS voltage of the USB A port with a preset first base voltage
  • the processing unit is configured to process the signal line D+ and/or the signal line D- according to the voltage comparison result to match the USB interface circuit with the USB device or USB host connected to the USB Type A port.
  • a further aspect of the present invention further provides a computer storage medium, wherein the computer storage medium stores computer executable instructions, and the computer executable instructions are used in the implementation method of the USB interface provided by the foregoing technical solution.
  • the VBUS voltage is utilized by using an external USB device and a USB host.
  • the difference is that the USB interface is connected to the USB host or the USB device, and the signal line D+ and/or D- is processed according to whether the USB host or the USB device is connected, so that the USB interface circuit is connected to the USB A port.
  • the USB device or the USB host is matched, so that the same USB interface can simultaneously support the connection with the USB device and the USB host, thereby effectively solving the problem that the existing USB A-type port cannot simultaneously support the connection with the USB device and the USB host. problem.
  • FIG. 1 is a schematic diagram of a USB interface circuit connection according to an embodiment of the present invention.
  • FIG. 2 is a schematic diagram of another USB interface circuit connection according to an embodiment of the present invention.
  • FIG. 3 is a schematic diagram of another USB interface circuit connection according to an embodiment of the present invention.
  • FIG. 4 is a schematic flowchart of a method for implementing a USB interface according to an embodiment of the present invention
  • FIG. 5 is a schematic flowchart diagram of another implementation method of a USB interface according to an embodiment of the present disclosure
  • FIG. 6 is a schematic structural diagram of an apparatus for implementing a USB interface according to an embodiment of the present invention.
  • the present invention provides a USB interface circuit and a method for sharing a USB interface between a USB device and a USB host, and the present invention implements the problem that the existing USB A-type port cannot support the connection with the USB device and the USB host at the same time. For example, by using the difference between the external USB device and the USB host on the VBUS voltage, it is recognized whether the USB interface is connected to the USB host or the USB device, and according to whether the USB host or the USB device is connected to the signal line D+ and/or D-. Processing, so that the USB interface circuit is matched with the USB device or USB host connected to the USB A port, so that the same USB interface can simultaneously support the connection with the USB device and the USB host, thereby effectively solving the existing USB A type.
  • the port cannot support the connection with the USB device and the USB host at the same time.
  • the embodiment of the invention provides a USB interface circuit.
  • the USB interface circuit includes:
  • USB A port configured to connect to a USB device or USB host
  • a comparison unit configured to compare the detected VBUS voltage of the USB A port with a preset first base voltage, and send the voltage comparison result to the processor
  • the processor is configured to process the signal line D+ and/or the signal line D- according to the voltage comparison result.
  • USB interface is connected to the USB host or the USB device, and according to whether the USB host or the USB device is connected to the signal line.
  • D+ and/or signal line D- are processed to match the USB interface circuit with the USB device or USB host connected to the USB A port, so that the same USB interface can simultaneously support the connection with the USB device and the USB host, and thus It effectively solves the problem that the existing USB A-type port cannot simultaneously support the connection with the USB device and the USB host.
  • the VBUS can be a power line of the USB A port, and can be configured to provide a working power by a USB device or a USB host connected by a USB A port, for example, to provide an operating voltage.
  • a USB device connected to a USB A port can also be referred to as a USB external device.
  • the embodiment of the present invention utilizes the low voltage requirement of the low power device to generate the VBUS voltage characteristic that not only conforms to the USB specification but also differs from the ordinary USB port, and utilizes the external connection by modifying the electrical characteristics of the USB interface.
  • the difference between the USB device and the USB host on the VBUS voltage identifies whether the USB interface is connected to a USB host or a USB device.
  • the USB device only transmits information and power through the USB port, and the corresponding computing work is completed by the computer, such as a USB flash drive, a USB interface printer, and the like.
  • the USB device may be connected to the processor through the USB A port. External electronic device.
  • the USB host is a USB interface. In addition to powering and transmitting information, the rest of the computing functions are done by itself, such as computers.
  • the processor determines whether the USB A port is connected to a USB device or a USB host according to the voltage comparison result, and when the USB device is determined, the signal line is pulled through a pull-down resistor circuit. D+ and signal line D- are pulled low. When it is judged to be a USB host, the signal line D+ or D- is pulled high by a pull-up resistor circuit.
  • the pulling down the signal line D+ and the signal line D by the pull-down resistor circuit may include: pulling down the signal line D+ and the signal line D to the low-lowed electrical signal through the pull-down resistor circuit, for example, The voltage at which the signal line D+ and the signal line D are pulled low by the pull-down resistor circuit is pulled low.
  • the pulling up the signal line D+ or D by the pull-up resistor circuit may include: increasing the electrical signal to the signal line D+ or D through the pull-up resistor circuit, for example, boosting the signal line D+ or D through the pull-up resistor circuit To the voltage.
  • the signal line D+ or the signal line D- is connected to the ground through a pull-down resistor circuit, and when the USB host is determined, the signal line D+ is pulled through the pull-up resistor circuit.
  • D-data transmission is connected to a high voltage power supply.
  • the voltage of the high voltage power supply is higher than the voltage of the ground.
  • the high voltage power source may be a power source having an output voltage greater than a preset voltage, for example, a power source having a voltage greater than 1.2V or 0V.
  • the first base voltage is 4.4 to 4.75V
  • the second base voltage is 4.75 to 5.25V.
  • the circuit of the embodiment of the present invention further includes a DC power DC/DC circuit
  • the DC/DC circuit is respectively connected to the processor and the USB A-type port, configured to output the first base voltage, and, under the trigger of the processor, convert the first base voltage into a second base voltage;
  • the processor is further configured to determine the USB A port according to the voltage comparison result When a USB device is connected, the DC/DC circuit is triggered to perform voltage conversion.
  • the first base voltage is different from the second base voltage.
  • the second base voltage is 4.75 to 5.25V.
  • the embodiment of the present invention is a DC/DC circuit capable of outputting a first base voltage (4.4 to 4.75 V, that is, a voltage of a USB device) and a second base voltage (4.75 to 5.25 V, that is, a voltage of a USB host), in processing
  • a first base voltage 4.4 to 4.75 V, that is, a voltage of a USB device
  • a second base voltage 4.75 to 5.25 V, that is, a voltage of a USB host
  • the circuit of the present invention further includes: a current limiting anti-backflow circuit; the current limiting anti-backflow circuit connecting the DC/DC circuit to the USB A port.
  • the USB protocol stipulates that the device is considered to be a low-power device by default before the enumeration is recognized as a high-power device.
  • the required current does not exceed 100 mA, and the supported operating voltage can be as low as 4.4V. Therefore, the embodiment of the present invention sets a special USB type A USB interface, and the initial voltage of the VBUS is between 4.4V and 4.75V.
  • the interface can internally switch the VBUS voltage to above 4.75V to meet the power supply requirements of the high-power device.
  • the host interface will output a voltage higher than 4.75V to reach the type A USB interface, and raise the VBUS voltage on the interface to 4.75V or higher.
  • the pull-up resistor can be connected to the D+/D- and the protocol stack can be switched to allow the device to Enter the USB device mode to communicate with the external host.
  • the USB type A type USB interface can be as shown in Fig. 2.
  • the USB interface defaults to the host mode.
  • the DC/DC outputs 4.5V voltage, and the switch control signal turns on the first resistor R1 and the second resistor R2, and disconnects the third resistor R3.
  • the following description is based on the difference in the identity of the peer end of the USB interface.
  • the 4.5V power supply on the USB interface VBUS of the embodiment of the present invention supplies power to the inserted USB device through the type A type USB interface, and after the USB device is powered on, the D+ or D- is pulled according to the protocol.
  • the level of the processor inside the interface of the present invention after identifying the level signal, sends a voltage control signal to switch the output voltage to 5.0V, and the subsequent workflow is exactly the same as the standard USB specification. Since the VBUS voltage has been switched to the standard 5.0V voltage, the USB protocol can be followed, regardless of whether a low-power device or a high-power device is inserted.
  • the USB device When the user unplugs the USB device, it can be detected by the host according to the USB communication specification. At this time, the VBUS voltage is re-switched to 4.5V by the voltage control signal, and the initial state is returned.
  • the two VBUS power supplies are shorted together because both sides are USB hosts. Since the VBUS default voltage (4.5V) of the USB interface of the present invention is lower than the VBUS voltage (4.75 to 5.25V) on the common interface, the VBUS current of the external USB host will flow into the device, and the VBUS on the USB interface of the device is raised. Voltage, (due to the internal anti-current circuit of the device, it will not damage DC/DC). Inside the device, the comparison portion can detect the rise of the voltage, thereby judging that the USB interface has been connected to the external USB host.
  • the device After judging that there is an external host connection, the device switches the internal protocol stack into the USB device mode, and through the switch control signal, disconnects the resistors R1 and R2 from the USB signal line, and turns R3 on D+. Since the R3 is turned on, the D+ signal is pulled up, and the externally inserted host recognizes the signal, determines that a USB full-speed device is inserted, and then performs device identification and enumeration according to the USB specification. After the enumeration is successful, the inserted host and the device exchange data through the USB interface to complete the required services. After the user may unplug this USB host, the device can check The VBUS voltage is measured to reduce the switching protocol stack to the host state. At this time, the VBUS voltage on the interface is powered by the internal DC/DC, and the output is 4.5V, returning to the initial state.
  • the USB interface identification and enumeration process of the present invention is similar to the insertion of the USB device, and the 4.5V power supply on the local VBUS supplies power to the HUB through the type A interface. After power-on, the USB HUB will raise the D+ level. After the processor recognizes the level signal, it sends a voltage control signal to switch the output VBUS voltage to 5.0V. Other aspects are no different from the standard agreement.
  • the comparing portion of the embodiment of the present invention may be specifically configured as a comparator or an analog-to-digital converter (ADC) to implement a function of comparing differences on the VBUS voltage.
  • ADC analog-to-digital converter
  • FIG. 2 is a schematic diagram of another USB interface circuit connection according to an embodiment of the present invention. As shown in FIG. 2, the non-inverting input terminal of the comparator of the embodiment of the present invention is connected to a USB A-type port, and the reverse input terminal and the DC/DC circuit are connected.
  • the output end is connected to the processor, for comparing a VBUS voltage of the USB A-type port with a first base voltage of the DC/DC circuit, and transmitting a voltage comparison result to the processor; the processor According to the voltage comparison result, it is judged whether it is a USB host or a USB device, and when it is determined that it is a USB host, the signal line D+ or the signal line D- is pulled up by the pull-up resistor circuit, and when the USB device is determined, the signal is pulled through the pull-down resistor circuit. Line D+ and signal line D- are pulled low and the first base voltage of the DC/DC circuit is converted to a second base voltage.
  • the initial voltage of the VBUS of the USB interface of the present invention is between 4.4V and 4.75V.
  • the comparator recognizes the VBUS voltage and sends the voltage comparison result.
  • the processor determines, according to the voltage comparison result, that the interface is inserted into the USB device, triggers the DC/DC circuit to perform voltage conversion, raises the VBUS voltage to above 4.75V, and satisfies the power supply requirement of the high-power device, and at D+/ Connect the pull-up resistor on the D- and switch the protocol stack to let the device enter the USB device mode to communicate with the external host. That is, after power-on, the USB interface defaults to the host mode.
  • the DC/DC outputs 5V voltage, and the switch control signal turns on R1 and R2, disconnect R3.
  • the two VBUS power supplies are shorted together because both sides are USB hosts.
  • the default VBUS voltage of this interface (4.5V) is lower than the VBUS voltage (4.75 to 5.25V) on the common interface, so the VBUS current of the external USB host will flow into the device and raise the VBUS voltage on the USB interface of the device.
  • the device contains an anti-current back-up circuit that does not damage the DC/DC). Inside the device, the rise of the voltage can be detected by the comparator, thereby judging that the USB interface has been connected to an external USB host.
  • the internal protocol stack is switched to enter the USB device mode, and the connection between the resistors R1 and R2 and the USB signal line is cut off by the switch control signal, and R3 is connected to D+. Since the R3 is turned on, the D+ signal is pulled up, and the externally inserted host recognizes the signal, determines that a USB full-speed device is inserted, and then performs device identification and enumeration according to the USB specification. After the enumeration is successful, the inserted host and the device exchange data through the USB interface to complete the required services.
  • the device can detect the decrease of the VBUS voltage, thereby switching the protocol stack to the host state. At this time, the VBUS voltage on the interface is powered by the internal DC/DC, and the output is 4.5V, and the return is performed. To the initial state.
  • FIG. 3 is a schematic diagram of another USB interface circuit connection according to an embodiment of the present invention.
  • FIG. 3 of the present invention performs all functions of the comparator of FIG. 2 through an analog-to-digital converter ADC, and optionally, the present invention.
  • the analog-to-digital converter ADC of the embodiment is respectively connected to the USB A port and the processor, and compares the VBUS voltage of the USB A port with the first base voltage of the DC/DC circuit, and sends the voltage comparison result to The processor determines whether the USB host or the USB device is based on the voltage comparison result, and when the USB host is determined, the signal line D+ or D- is connected to the high voltage through the pull-up resistor circuit, and the determination is USB. In the case of the device, the signal lines D+ and D- are pulled high by a pull-down resistor circuit, and the first base voltage of the DC/DC circuit is converted to a second base voltage.
  • USB interface circuit of the invention On many CPE devices that handle wireless, wired and fiber access, it is often necessary to provide a USB A-type interface to the user, and an external USB device such as a USB flash drive and a printer. In addition to this, you need a USB interface, working in USB device mode, after connecting to the PC, for debugging and downloading upgrades. On this type of device, we can use the USB A-type interface of the present invention, and only need one interface to realize the above two functions at the same time, which saves cost and volume, especially when the number of USB ports of the CPE internal processor is limited. When you can save the relevant circuit of the USB interface expansion.
  • the type A USB interface defaults to the host mode.
  • the interface supplies power, identifies, and enumerates the inserted user USB device through VBUS to complete the required service.
  • the special features of this interface can also be opened to users.
  • the CPE device After the user connects to the PC, the CPE device also works in the USB device mode. The user can directly access the Internet through the USB cable or access the stored content inside the CPE.
  • USB type A USB interface is widely used on the current PC, and only the host mode is supported. If the technology of the present invention can be used to transform it into an OTG interface, high-speed interconnection between two PCs without using other switching devices can be realized, and the storage of another PC can be accessed at a high speed on one PC. Storage space, practical. Since this interconnect does not require an IP address, it is faster and more convenient than a network cable.
  • a type A USB interface supports the OTG (On-The-Go) function by means of color or characters. If the OTG is supported, the interface can be directly connected to the host interface of other devices. In this case, the local device will be regarded as a USB device externally connected to the USB host interface of the other device. If the type A type USB interface described in the present invention is interconnected, since the VBUS voltages on both sides are lower than the threshold of 4.75V after the interconnection, the insertion of the other party cannot be recognized, so that the host mode is maintained. The insertion of the other party could not be recognized. But this will not cause damage to the interface, compared to the traditional type A USB interface, is also an improvement. The traditional type A USB host interface is interconnected, which may cause damage to the interface.
  • USB interface circuit of the embodiment of the present invention on a tablet computer: since a large number of existing USB devices are type A type plugs, such as a U disk, a U key, etc., the type A type USB interface is also retained on the tablet computer. Necessary. In fact, a significant portion of the tablets currently on sale retain a type A USB interface, such as Microsoft's SURFACE series. However, the tablet computer has high requirements for portability. If the interface supports the OTG mode at the same time, the two functions of connecting the computer and connecting the peripheral device can be realized by one interface, which is very advantageous for controlling the size.
  • USB interface is connected to the USB host or the USB device, and according to whether the USB host or the USB device is connected to the signal line.
  • D+ and/or D- are processed to match the USB interface circuit with the USB device or USB host connected to the USB A port, so that the same USB interface can simultaneously support the connection with the USB device and the USB host, thereby effectively solving the problem.
  • the existing USB A-type port cannot support the connection with the USB device and the USB host at the same time.
  • An embodiment of the present invention provides a method for implementing a USB interface.
  • the method package is provided. include:
  • S402. Process the signal line D+ and/or the signal line D- according to the voltage comparison result, so that the USB interface circuit matches the USB device or the USB host connected to the USB Type A port.
  • the invention recognizes whether the USB interface is connected to the USB host or the USB device by using the difference between the external USB device and the USB host on the VBUS voltage, and according to whether the USB host or the USB device is connected to the signal line D+ and/or D- Processing to match the USB interface circuit to the USB device or USB host connected to the USB A port, so that the same USB interface can simultaneously support the connection with the USB device and the USB host, thereby effectively solving the existing USB A.
  • the port cannot support the connection to the USB device and the USB host at the same time.
  • the step S402 processes the signal line D+ and/or the signal line D- according to the voltage comparison result, for example, adjusting the voltage value on the signal line D+ and/or the signal line D-, so that the D of the USB interface
  • the voltage on the signal line matches the voltage required by the currently connected device.
  • the device can be an external USB device, or a USB host.
  • the electrical signal herein is not limited to a voltage, and in some embodiments, may be a current.
  • the D signal line here includes: a signal line D+ and a signal line D-.
  • the step S402 of the present invention specifically includes: determining, according to the voltage comparison result, whether the USB A port is connected to a USB device or a USB host, and when determining that the USB device is a USB device, the signal line D+ is pulled through a pull-down resistor circuit. And the signal line D- is pulled low, and when it is judged to be the USB host, the signal line D+ or the signal line D- is pulled up by the pull-up resistor circuit.
  • the present invention connects the signal lines D+ and D- to the ground through a pull-down resistor circuit when determining that it is a USB device, and connects the signal line D+ or D- with a high voltage through the pull-up resistor circuit when determining that the USB host is a USB host. Power connection.
  • the method of the embodiment of the present invention further includes: outputting the first base voltage by using a DC/DC circuit, and determining, by the voltage comparison result, that the USB A port is connected to a USB device.
  • the output of the DC/DC circuit converts the first base voltage into a second base voltage; wherein the second base voltage is 4.75 to 5.25V.
  • the embodiment of the present invention connects the DC/DC circuit to the processor and the USB A port, and the DC/DC circuit outputs the first base voltage, and when the processor triggers, the first Converting a base voltage to a second base voltage; the processor triggering the DC/DC circuit to perform voltage conversion when determining that the USB A port is connected to the USB device according to the voltage comparison result.
  • the embodiment of the present invention is a DC/DC circuit capable of outputting a first base voltage (4.4 to 4.75 V, that is, a voltage of a USB device) and a second base voltage (4.75 to 5.25 V, that is, a voltage of a USB host), in processing
  • a first base voltage 4.4 to 4.75 V, that is, a voltage of a USB device
  • a second base voltage 4.75 to 5.25 V, that is, a voltage of a USB host
  • FIG. 5 is a schematic flowchart of another method for sharing a USB interface between a USB device and a USB host according to an embodiment of the present invention. As shown in FIG. 5, the method includes:
  • the high level may be a level higher than a preset reference level.
  • switching VBUS voltage is 5V; switching VBUS voltage to 5V can be: switching the voltage on VBUS to 5V;
  • S511 working as a USB peripheral, cooperate with the host to complete the identification and enumeration of peripherals;
  • An embodiment of the present invention provides an apparatus for implementing a USB interface.
  • the apparatus includes:
  • the comparison unit configured to compare the detected VBUS voltage of the USB A-type port with a preset first base voltage; the comparison unit may include: a comparator or a comparison circuit having a comparison function
  • the processing unit is configured to process the signal line D+ and/or the signal line D- according to the voltage comparison result to match the USB interface circuit with the USB device or USB host connected to the USB Type A port.
  • the processing unit can include a processor or processing circuitry.
  • the processor can include a central processing unit, a microprocessor, a digital signal processor, an application processor, a programmable array, an application processor, or an application specific integrated circuit.
  • the USB interface is connected to the USB host or the USB device, and according to whether the USB host or the USB device is connected to the signal line D+ and/or D- is processed to match the USB interface circuit with the USB device or USB host connected to the USB A port, so that the same USB interface can simultaneously support the connection with the USB device and the USB host, thereby effectively solving the existing
  • the USB Type A port cannot support the connection to the USB device and the USB host at the same time.
  • the processing unit of the embodiment of the present invention is further configured to determine, according to the voltage comparison result, whether the USB A port is connected to a USB device or a USB host, and when determining that the USB device is a pull-down resistor The circuit pulls the signal line D+ and the signal line D- low, in the judgment is When the USB host is used, the signal line D+ or the signal line D- is pulled up by the pull-up resistor circuit.
  • the processing unit of the embodiment of the present invention is further configured to: when determining that the USB device is connected to the USB A-type interface, connect the signal lines D+ and D- to the ground through a pull-down resistor circuit, and determine the USB A type.
  • the signal line D+ or D- is connected to the high voltage power supply through a pull-up resistor circuit.
  • the device further includes: a DC power supply unit; the DC power supply unit configured to output the first base voltage, and when the voltage comparison result determines that the USB A port is connected When it is a USB device, the output first base voltage is converted into a second base voltage.
  • a DC power supply unit configured to output the first base voltage, and when the voltage comparison result determines that the USB A port is connected When it is a USB device, the output first base voltage is converted into a second base voltage.
  • the embodiment of the present invention connects the DC/DC circuit to the processor and the USB A port, and the DC/DC circuit outputs the first base voltage, and when the processor triggers, the first The base voltage is converted into a second base voltage; the processor is further configured to trigger the DC/DC circuit to perform voltage conversion when determining that the USB A port is connected to the USB device according to the voltage comparison result.
  • the embodiment of the present invention is a DC/DC circuit capable of outputting a first base voltage (4.4 to 4.75 V) and a second base voltage (4.75 to 5.25 V), when the processor determines that the USB A port is connected to a USB device.
  • the DC/DC circuit can be switched to the voltage of the USB host to match the connected USB device.
  • the USB interface is connected to the USB host or the USB device, and according to whether the USB host or the USB device is connected to the signal line D+ and / Or D- processing to match the USB interface circuit with the USB device or USB host connected to the USB A port, so that the same USB interface can simultaneously support the connection with the USB device and the USB host, thereby effectively solving the existing of The USB Type A port cannot support the connection to the USB device and the USB host at the same time.
  • the embodiment of the present invention further provides a computer storage medium, where the computer executable medium stores computer executable instructions, and the computer executable instructions are executed by a processor or the like, and the foregoing one or more embodiments may be implemented.
  • the implementation of the provided USB interface is not limited to, but not limited to, USB 2.0
  • the computer storage medium provided by the embodiment of the invention includes: a mobile storage device, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and the like, which can store program codes. Medium.
  • the computer storage medium can be a non-transitory storage medium.
  • the non-transitory storage medium herein may also be referred to as a non-volatile storage medium.
  • the VBUS voltage of the USB A port is detected, and the comparison result is compared with the first base voltage to obtain a comparison result; and then the processor determines, according to the comparison result, that the current connection is to the USB.
  • the A-port connected device is a USB peripheral or a USB host, so that the signal line D+ and/or the signal line D- can be output to the currently connected device by adjusting the electrical signal on the signal line D+ and/or the signal line D-.
  • the compatible electric signal enables the USB A-type port to be adapted to both the USB peripheral device and the USB host, thereby solving the problem of the limitation of the use of the USB A-type port, and expanding the USB A-type port.

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)
  • Information Transfer Systems (AREA)
  • Power Sources (AREA)

Abstract

A universal serial bus (USB) interface circuit, a USB interface implementation method, and a device. The USB interface implementation method comprises: utilizing a difference between a VBUS voltage of an external USB device and a VBUS voltage of an external USB host to identify that a USB interface is connected to a USB host or a USB device, and processing, according to whether the USB interface is connected to a USB host or a USB device, signals on a signal line D+ and/or a signal line D-. Also provided is a computer storage medium.

Description

USB接口电路、USB接口实现方法、装置和存储介质USB interface circuit, USB interface implementation method, device and storage medium
本申请基于申请号为201610998004.2、申请日为2016年11月11日的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此引入本申请作为参考。The present application is based on a Chinese patent application filed on Jan. 11, 2016, the filing date of
技术领域Technical field
本发明涉及通信技术领域,特别是涉及一种USB接口电路、USB接口的实现方法、装置和计算机存储介质。The present invention relates to the field of communications technologies, and in particular, to a USB interface circuit, a USB interface implementation method, apparatus, and computer storage medium.
背景技术Background technique
通用串行总线(Universal Serial Bus,USB)接口,可连接计算机系统与外部设备的一种串口总线标准,在电脑和通信终端产品上的使用由来已久。其中,电脑和客户终端设备(Customer Premise Equipment,CPE)上,USB类型(type A)型USB接口(即,USB A型口)非常通用,它能够在一个接口上实现对设备的供电和通信。在这些应用中,USB接口作为主机,连接的设备的种类很多,包括打印机,移动硬盘,读卡器等。Universal Serial Bus (USB) interface, a serial bus standard that can be connected to computer systems and external devices. It has been used for a long time in computer and communication terminal products. Among them, on the computer and customer premises equipment (CPE), the USB type (type A) type USB interface (ie, USB A type port) is very common, and it can realize power supply and communication to the device on one interface. In these applications, the USB interface acts as a host, and there are many types of connected devices, including printers, mobile hard disks, and card readers.
CPE产品,很多配有USB type A型接口,它是一个USB主机接口,用于连接诸如U盘,打印机等设备。但CPE产品经常还有另外一种需求,就是需要一个USB设备接口,用于连接PC机,实现调试和下载软件等功能。Many CPE products are equipped with a USB type A interface, which is a USB host interface for connecting devices such as USB flash drives and printers. However, CPE products often have another requirement, which requires a USB device interface for connecting to a PC, enabling debugging and downloading of software.
由于传统的tpyeA型USB接口只能用于USB主机接口,为了连接PC机,CPE设备就必须增加另外一个USB设备接口来跟PC机连接,这会在一定程度上提高产品成本,也会在一定程度上影响产品外观,也就是说,现有的tpyeA型USB接口不能同时支持与USB设备和USB主机的连接。 Since the traditional tpyeA type USB interface can only be used for the USB host interface, in order to connect the PC, the CPE device must add another USB device interface to connect with the PC, which will increase the product cost to a certain extent. To a certain extent, it affects the appearance of the product, that is, the existing tpyeA type USB interface cannot support the connection with the USB device and the USB host at the same time.
发明内容Summary of the invention
本发明实施例提供了一种USB接口电路、USB接口的实现方法、装置和计算机存储介质,期望解决USB A型口不能同时支持与USB设备和USB主机的连接的问题。The embodiment of the invention provides a USB interface circuit, a USB interface implementation method, a device and a computer storage medium. It is desirable to solve the problem that the USB A port cannot simultaneously support the connection with the USB device and the USB host.
本发明实施例一方面提供了一种USB接口电路,包括:An embodiment of the present invention provides a USB interface circuit, including:
USB A型口,配置为与USB设备或者USB主机连接;USB A port configured to connect to a USB device or USB host;
比较部,配置为将检测到的USB A型口的VBUS电压与预设的第一基础电压进行比较,并将电压比较结果发送给所述处理器;a comparison unit configured to compare the detected VBUS voltage of the USB A-type port with a preset first base voltage, and send the voltage comparison result to the processor;
所述处理器,配置为根据所述电压比较结果对信号线D+和/或信号线D-进行处理。The processor is configured to process the signal line D+ and/or the signal line D- according to the voltage comparison result.
本发明实施例另一方面提供了一种USB接口的实现方法,包括:Another aspect of the embodiments of the present invention provides a method for implementing a USB interface, including:
将检测到的USB A型口的VBUS电压与预设的第一基础电压进行比较;Comparing the detected VBUS voltage of the USB A port with a preset first base voltage;
根据所述电压比较结果对信号线D+和/或信号线D-进行处理,以使USB接口电路与USB A型口连接的USB设备或USB主机相匹配。The signal line D+ and/or the signal line D- are processed according to the voltage comparison result to match the USB interface circuit with the USB device or USB host to which the USB A port is connected.
本发明实施例再一方面提供了一种USB接口的实现装置,包括:Another embodiment of the present invention provides an apparatus for implementing a USB interface, including:
比较单元,配置为将检测到的USB A型口的VBUS电压与预设的第一基础电压进行比较;a comparison unit configured to compare the detected VBUS voltage of the USB A port with a preset first base voltage;
处理单元,配置为根据所述电压比较结果对信号线D+和/或信号线D-进行处理,以使USB接口电路与USB A型口连接的USB设备或USB主机相匹配。The processing unit is configured to process the signal line D+ and/or the signal line D- according to the voltage comparison result to match the USB interface circuit with the USB device or USB host connected to the USB Type A port.
本发明实施例又一方面还提供一种计算机存储介质,所述计算机存储介质中存储有计算机可执行指令,所述计算机可执行指令用于前述技术方案提供的USB接口的实现方法。A further aspect of the present invention further provides a computer storage medium, wherein the computer storage medium stores computer executable instructions, and the computer executable instructions are used in the implementation method of the USB interface provided by the foregoing technical solution.
在本发明实施例中,通过利用外接的USB设备和USB主机在VBUS电压 上的差异,识别出USB接口连接的是USB主机还是USB设备,并根据连接的是USB主机还是USB设备对信号线D+和/或D-进行处理,以使USB接口电路与USB A型口连接的USB设备或USB主机相匹配,从而使同一个USB接口同时能够支持与USB设备和USB主机的连接,进而有效解决了现有的USB A型口不能同时支持与USB设备和USB主机的连接的问题。In the embodiment of the present invention, the VBUS voltage is utilized by using an external USB device and a USB host. The difference is that the USB interface is connected to the USB host or the USB device, and the signal line D+ and/or D- is processed according to whether the USB host or the USB device is connected, so that the USB interface circuit is connected to the USB A port. The USB device or the USB host is matched, so that the same USB interface can simultaneously support the connection with the USB device and the USB host, thereby effectively solving the problem that the existing USB A-type port cannot simultaneously support the connection with the USB device and the USB host. problem.
附图说明DRAWINGS
图1是本发明实施例提供的一种USB接口电路连接示意图;1 is a schematic diagram of a USB interface circuit connection according to an embodiment of the present invention;
图2是本发明实施例提供的另一种USB接口电路连接示意图;2 is a schematic diagram of another USB interface circuit connection according to an embodiment of the present invention;
图3是本发明实施例提供的再一种USB接口电路连接示意图;FIG. 3 is a schematic diagram of another USB interface circuit connection according to an embodiment of the present invention; FIG.
图4是本发明实施例提供的一种USB接口的实现方法的流程示意图;4 is a schematic flowchart of a method for implementing a USB interface according to an embodiment of the present invention;
图5是本发明实施例提供的另一种USB接口的实现方法的流程示意图;FIG. 5 is a schematic flowchart diagram of another implementation method of a USB interface according to an embodiment of the present disclosure;
图6是本发明实施例提供的一种USB接口的实现装置的结构示意图。FIG. 6 is a schematic structural diagram of an apparatus for implementing a USB interface according to an embodiment of the present invention.
具体实施方式detailed description
由于现有的USB A型口不能同时支持与USB设备和USB主机的连接的问题,因此,本发明实施例提供了一种USB接口电路及USB设备与USB主机共用USB接口的方法,本发明实施例通过利用外接的USB设备和USB主机在VBUS电压上的差异,识别出USB接口连接的是USB主机还是USB设备,并根据连接的是USB主机还是USB设备对信号线D+和/或D-进行处理,以使USB接口电路与USB A型口连接的USB设备或USB主机相匹配,从而使同一个USB接口同时能够支持与USB设备和USB主机的连接,进而有效解决了现有的USB A型口不能同时支持与USB设备和USB主机的连接的问题。以下结合附图以及实施例,对本发明实施例进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不 限定本发明。The present invention provides a USB interface circuit and a method for sharing a USB interface between a USB device and a USB host, and the present invention implements the problem that the existing USB A-type port cannot support the connection with the USB device and the USB host at the same time. For example, by using the difference between the external USB device and the USB host on the VBUS voltage, it is recognized whether the USB interface is connected to the USB host or the USB device, and according to whether the USB host or the USB device is connected to the signal line D+ and/or D-. Processing, so that the USB interface circuit is matched with the USB device or USB host connected to the USB A port, so that the same USB interface can simultaneously support the connection with the USB device and the USB host, thereby effectively solving the existing USB A type. The port cannot support the connection with the USB device and the USB host at the same time. The embodiments of the present invention are further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not The invention is defined.
本发明实施例提供了一种USB接口电路,参见图1,该USB接口电路包括:The embodiment of the invention provides a USB interface circuit. Referring to FIG. 1, the USB interface circuit includes:
USB A型口,配置为与USB设备或者USB主机连接;USB A port configured to connect to a USB device or USB host;
比较部,配置为将检测到的USB A型口的VBUS电压与预设的第一基础电压进行比较,并将电压比较结果发送给处理器;a comparison unit configured to compare the detected VBUS voltage of the USB A port with a preset first base voltage, and send the voltage comparison result to the processor;
所述处理器,配置为根据所述电压比较结果对信号线D+和/或信号线D-进行处理。The processor is configured to process the signal line D+ and/or the signal line D- according to the voltage comparison result.
也就是说,本发明实施例通过利用外接的USB设备和USB主机在VBUS电压上的差异,识别出USB接口连接的是USB主机还是USB设备,并根据连接的是USB主机还是USB设备对信号线D+和/或信号线D-进行处理,以使USB接口电路与USB A型口连接的USB设备或USB主机相匹配,从而使同一个USB接口同时能够支持与USB设备和USB主机的连接,进而有效解决了现有的USB A型口不能同时支持与USB设备和USB主机的连接的问题。That is to say, in the embodiment of the present invention, by using the difference between the external USB device and the USB host on the VBUS voltage, it is recognized whether the USB interface is connected to the USB host or the USB device, and according to whether the USB host or the USB device is connected to the signal line. D+ and/or signal line D- are processed to match the USB interface circuit with the USB device or USB host connected to the USB A port, so that the same USB interface can simultaneously support the connection with the USB device and the USB host, and thus It effectively solves the problem that the existing USB A-type port cannot simultaneously support the connection with the USB device and the USB host.
所述VBUS可为所述USB A型口的电源线,可以配置为由USB A型口连接的USB设备或USB主机提供工作电源,例如,提供工作电压。USB A型口连接的USB设备还可称为USB外设备。The VBUS can be a power line of the USB A port, and can be configured to provide a working power by a USB device or a USB host connected by a USB A port, for example, to provide an operating voltage. A USB device connected to a USB A port can also be referred to as a USB external device.
即,本发明实施例是利用低功率设备对电压要求较低的特性,产生出不仅符合USB规范,而且还跟普通USB口有差异的VBUS电压的特性,通过改造USB接口的电器特性,利用外接的USB设备和USB主机在VBUS电压上的差异,识别出USB接口连接的是USB主机还是USB设备。That is, the embodiment of the present invention utilizes the low voltage requirement of the low power device to generate the VBUS voltage characteristic that not only conforms to the USB specification but also differs from the ordinary USB port, and utilizes the external connection by modifying the electrical characteristics of the USB interface. The difference between the USB device and the USB host on the VBUS voltage identifies whether the USB interface is connected to a USB host or a USB device.
需要说明的是,本发明实施例USB设备只是通过USB口传输信息和供电,由计算机完成相应的计算工作,比如U盘、USB接口的打印机,等等。在本实施例中,所述USB设备可为通过所述USB A型口连接到所述处理器 的外接的电子设备。It should be noted that, in the embodiment of the present invention, the USB device only transmits information and power through the USB port, and the corresponding computing work is completed by the computer, such as a USB flash drive, a USB interface printer, and the like. In this embodiment, the USB device may be connected to the processor through the USB A port. External electronic device.
USB主机是USB接口除了供电和传输信息,剩下的计算功能都是其自身完成的,如电脑等等。The USB host is a USB interface. In addition to powering and transmitting information, the rest of the computing functions are done by itself, such as computers.
可选地,本发明实施例所述处理器是根据所述电压比较结果判断所述USB A型口连接的是USB设备还是USB主机,并在判断是USB设备时,通过下拉电阻电路将信号线D+和信号线D-拉低,在判断是USB主机时,通过上拉电阻电路将信号线D+或D-拉高。Optionally, the processor according to the embodiment of the present invention determines whether the USB A port is connected to a USB device or a USB host according to the voltage comparison result, and when the USB device is determined, the signal line is pulled through a pull-down resistor circuit. D+ and signal line D- are pulled low. When it is judged to be a USB host, the signal line D+ or D- is pulled high by a pull-up resistor circuit.
在本实施例中,所述通过下拉电阻电路将信号线D+和信号线D至拉低,可包括:通过下拉电阻电路将信号线D+和信号线D至拉低的电信号拉低,例如,拉低通过下拉电阻电路将信号线D+和信号线D至拉低的电压。所述通过上拉电阻电路将信号线D+或D至拉高,可包括:通过上拉电阻电路将信号线D+或D至的电信号提高,例如,通过上拉电阻电路提升信号线D+或D至的电压。In this embodiment, the pulling down the signal line D+ and the signal line D by the pull-down resistor circuit may include: pulling down the signal line D+ and the signal line D to the low-lowed electrical signal through the pull-down resistor circuit, for example, The voltage at which the signal line D+ and the signal line D are pulled low by the pull-down resistor circuit is pulled low. The pulling up the signal line D+ or D by the pull-up resistor circuit may include: increasing the electrical signal to the signal line D+ or D through the pull-up resistor circuit, for example, boosting the signal line D+ or D through the pull-up resistor circuit To the voltage.
可选地,本发明实施例是在判断是USB设备时,通过下拉电阻电路将信号线D+或信号线D-与地连接,并在判断是USB主机时,通过上拉电阻电路将信号线D+或D-数据传输与高压电源连接。Optionally, in the embodiment of the present invention, when the USB device is determined, the signal line D+ or the signal line D- is connected to the ground through a pull-down resistor circuit, and when the USB host is determined, the signal line D+ is pulled through the pull-up resistor circuit. Or D-data transmission is connected to a high voltage power supply.
在本实施例中高压电源的电压高于地的电压。所述高压电源可为输出电压大于预设电压的电源,例如,大于1.2V或0V的电压的电源。In this embodiment, the voltage of the high voltage power supply is higher than the voltage of the ground. The high voltage power source may be a power source having an output voltage greater than a preset voltage, for example, a power source having a voltage greater than 1.2V or 0V.
可选地,本发明实施例所述第一基础电压为4.4至4.75V,所述第二基础电压为4.75至5.25V。Optionally, in the embodiment of the present invention, the first base voltage is 4.4 to 4.75V, and the second base voltage is 4.75 to 5.25V.
可选地,本发明实施例所述的电路还设有直流电源DC/DC电路;Optionally, the circuit of the embodiment of the present invention further includes a DC power DC/DC circuit;
所述DC/DC电路分别与处理器以及USB A型口连接,配置为输出所述第一基础电压,并在所述处理器触发下,将所述第一基础电压变换为第二基础电压;The DC/DC circuit is respectively connected to the processor and the USB A-type port, configured to output the first base voltage, and, under the trigger of the processor, convert the first base voltage into a second base voltage;
所述处理器,还配置为当根据所述电压比较结果判断所述USB A型口 连接的是USB设备时,触发所述DC/DC电路进行电压变换。The processor is further configured to determine the USB A port according to the voltage comparison result When a USB device is connected, the DC/DC circuit is triggered to perform voltage conversion.
在本发明实施例中,所述第一基础电压与所述第二基础电压不同。In an embodiment of the invention, the first base voltage is different from the second base voltage.
其中,第二基础电压为4.75至5.25V。Wherein, the second base voltage is 4.75 to 5.25V.
例如,本发明实施例是的DC/DC电路能够输出第一基础电压(4.4至4.75V,即USB设备的电压)和第二基础电压(4.75至5.25V,即USB主机的电压),在处理器判断USB A型口连接的是USB设备时,DC/DC电路能够切换为USB主机的电压,以与连接的USB设备相匹配。For example, the embodiment of the present invention is a DC/DC circuit capable of outputting a first base voltage (4.4 to 4.75 V, that is, a voltage of a USB device) and a second base voltage (4.75 to 5.25 V, that is, a voltage of a USB host), in processing When it is determined that the USB A port is connected to a USB device, the DC/DC circuit can be switched to the voltage of the USB host to match the connected USB device.
可选地,本发明所述的电路还包括:限流防倒灌电路;所述限流防倒灌电路将所述DC/DC电路与USB A型口连接。Optionally, the circuit of the present invention further includes: a current limiting anti-backflow circuit; the current limiting anti-backflow circuit connecting the DC/DC circuit to the USB A port.
举例说明,USB协议对主机的VBUS输出的最低电压,具体要求是高功率端口最低4.75V至5.25V,低功率端口为4.4V至5.25V。USB协议还规定,设备在枚举完成被识别为高功率设备之前,默认被视为低功率设备,其所需电流不超过100mA,并且支持的工作电压,最低可以到4.4V。因此,本发明实施例设置一个特殊的USB类型(type)A型USB接口,其VBUS的初始电压介于4.4V和4.75V之间。当此接口上插入一个USB设备后,由于USB设备在枚举成功前都默认是低功率设备,所以这不会影响USB设备的识别和枚举。在识别到插入的是USB设备之后,本接口内部可以切换VBUS电压到4.75V以上,以满足高功率设备的供电需求。For example, the lowest voltage of the USB protocol to the host's VBUS output, the specific requirements are high power port minimum 4.75V to 5.25V, low power port is 4.4V to 5.25V. The USB protocol also stipulates that the device is considered to be a low-power device by default before the enumeration is recognized as a high-power device. The required current does not exceed 100 mA, and the supported operating voltage can be as low as 4.4V. Therefore, the embodiment of the present invention sets a special USB type A USB interface, and the initial voltage of the VBUS is between 4.4V and 4.75V. When a USB device is plugged into this interface, since the USB device defaults to a low-power device before the enumeration succeeds, this does not affect the identification and enumeration of the USB device. After identifying that the USB device is plugged in, the interface can internally switch the VBUS voltage to above 4.75V to meet the power supply requirements of the high-power device.
如果上述接口和一个标准的USB主机接口连接,则该主机接口会输出高于4.75V的电压到达此type A型USB接口,并抬高该接口上的VBUS电压到4.75V以上。这个较高的VBUS电压被处理器识别之后,就可以判断出对端不是一个USB设备,而是一个USB主机,随后就可以在D+/D-上接入上拉电阻并切换协议栈,让设备进入USB设备模式跟外接的主机进行通信。If the above interface is connected to a standard USB host interface, the host interface will output a voltage higher than 4.75V to reach the type A USB interface, and raise the VBUS voltage on the interface to 4.75V or higher. After the higher VBUS voltage is recognized by the processor, it can be judged that the opposite end is not a USB device, but a USB host, and then the pull-up resistor can be connected to the D+/D- and the protocol stack can be switched to allow the device to Enter the USB device mode to communicate with the external host.
USB type A型USB接口可如图2所示,图2中,R1=R2=15k,R3=1.5k。 上电后,USB接口默认处于主机模式,此时DC/DC输出4.5V电压,开关控制信号接通第一电阻R1和第二电阻R2,断开第三电阻R3。下面根据USB接口对端身份的不同,分别描述。The USB type A type USB interface can be as shown in Fig. 2. In Fig. 2, R1 = R2 = 15k and R3 = 1.5k. After power-on, the USB interface defaults to the host mode. At this time, the DC/DC outputs 4.5V voltage, and the switch control signal turns on the first resistor R1 and the second resistor R2, and disconnects the third resistor R3. The following description is based on the difference in the identity of the peer end of the USB interface.
当插入USB设备时,本发明实施例的USB接口VBUS上的4.5V电源通过type A型USB接口给所插入的USB设备供电,而USB设备在上电后,会根据协议拉高D+或D-的电平,本发明的接口内部的处理器在识别到此电平信号后,会发送电压控制信号切换输出电压到5.0V,此后的工作流程则跟标准的USB规范做法完全一致。由于VBUS电压已经切换为标准的5.0V电压,所以就能够遵循USB协议,无论所插入的是低功率设备还是高功率设备都能兼容。When the USB device is inserted, the 4.5V power supply on the USB interface VBUS of the embodiment of the present invention supplies power to the inserted USB device through the type A type USB interface, and after the USB device is powered on, the D+ or D- is pulled according to the protocol. The level of the processor inside the interface of the present invention, after identifying the level signal, sends a voltage control signal to switch the output voltage to 5.0V, and the subsequent workflow is exactly the same as the standard USB specification. Since the VBUS voltage has been switched to the standard 5.0V voltage, the USB protocol can be followed, regardless of whether a low-power device or a high-power device is inserted.
当用户拔掉此USB设备后,按照USB通信规范,能够被主机检测到,此时通过电压控制信号重新切换VBUS电压到4.5V,返回初始状态。When the user unplugs the USB device, it can be detected by the host according to the USB communication specification. At this time, the VBUS voltage is re-switched to 4.5V by the voltage control signal, and the initial state is returned.
当插入普通的USB主机接口的后,因为两侧都是USB主机,其两路VBUS电源会短接在一起。由于本发明的USB接口的VBUS默认电压(4.5V)低于普通接口上的VBUS电压(4.75至5.25V),所以外部USB主机的VBUS电流会流入本设备,抬高本设备USB接口上的VBUS电压,(由于设备内部包含防电流倒灌的电路,并不会损坏DC/DC)。在本设备内部,通过比较部能够检测到该电压的升高,从而判断出USB接口已经跟外部的USB主机连接。When plugged into a normal USB host interface, the two VBUS power supplies are shorted together because both sides are USB hosts. Since the VBUS default voltage (4.5V) of the USB interface of the present invention is lower than the VBUS voltage (4.75 to 5.25V) on the common interface, the VBUS current of the external USB host will flow into the device, and the VBUS on the USB interface of the device is raised. Voltage, (due to the internal anti-current circuit of the device, it will not damage DC/DC). Inside the device, the comparison portion can detect the rise of the voltage, thereby judging that the USB interface has been connected to the external USB host.
判断有外部主机连接后,本设备切换内部的协议栈进入USB设备模式,并通过开关控制信号,切断电阻R1和R2与USB信号线的连接,并将R3接通在D+上。由于R3的接通,拉高了D+信号,外部插入的主机会识别出该信号,判断出有USB全速设备插入,随后按照USB规范,完成设备的识别和枚举。在枚举成功后,所插入的主机和本设备之间通过USB接口交换数据,完成所需的业务。在用户可能会拔掉此USB主机后,本设备能够检 测到VBUS电压的降低,从而切换协议栈为主机状态,此时接口上的VBUS电压改由内部的DC/DC供电,输出4.5V,返回到初始状态。After judging that there is an external host connection, the device switches the internal protocol stack into the USB device mode, and through the switch control signal, disconnects the resistors R1 and R2 from the USB signal line, and turns R3 on D+. Since the R3 is turned on, the D+ signal is pulled up, and the externally inserted host recognizes the signal, determines that a USB full-speed device is inserted, and then performs device identification and enumeration according to the USB specification. After the enumeration is successful, the inserted host and the device exchange data through the USB interface to complete the required services. After the user may unplug this USB host, the device can check The VBUS voltage is measured to reduce the switching protocol stack to the host state. At this time, the VBUS voltage on the interface is powered by the internal DC/DC, and the output is 4.5V, returning to the initial state.
当插入USB HUB,即标准的USB HUB上行端口插入后,本发明的USB接口识别和枚举过程跟插入USB设备类似,本机VBUS上的4.5V电源会通过type A型接口给HUB供电,而上电后的USB HUB会拉高D+电平,继而处理器识别到此电平信号后,发送电压控制信号,切换输出的VBUS电压到5.0V。其他方面跟标准的协议并无差异。When the USB HUB is inserted, that is, the standard USB HUB uplink port is inserted, the USB interface identification and enumeration process of the present invention is similar to the insertion of the USB device, and the 4.5V power supply on the local VBUS supplies power to the HUB through the type A interface. After power-on, the USB HUB will raise the D+ level. After the processor recognizes the level signal, it sends a voltage control signal to switch the output VBUS voltage to 5.0V. Other aspects are no different from the standard agreement.
可选地,本发明实施例的所述比较部可具体设置为比较器或模数转换器(Analog-to-Digital Converter,ADC)来实现比较VBUS电压上的差异的功能。Optionally, the comparing portion of the embodiment of the present invention may be specifically configured as a comparator or an analog-to-digital converter (ADC) to implement a function of comparing differences on the VBUS voltage.
图2是本发明实施例的另一种USB接口电路连接示意图,如图2所示,本发明实施例的比较器的同相输入端与USB A型口连接,反向输入端与DC/DC电路连接,输出端与所述处理器连接,用于将USB A型口的VBUS电压与所述DC/DC电路的第一基础电压进行比较,并将电压比较结果发送给所述处理器;处理器根据电压比较结果判断是USB主机还是USB设备,并在判定是USB主机时,通过上拉电阻电路将信号线D+或信号线D-拉高,在判定是USB设备时,通过下拉电阻电路将信号线D+和信号线D-拉低,并将所述DC/DC电路的第一基础电压变换为第二基础电压。2 is a schematic diagram of another USB interface circuit connection according to an embodiment of the present invention. As shown in FIG. 2, the non-inverting input terminal of the comparator of the embodiment of the present invention is connected to a USB A-type port, and the reverse input terminal and the DC/DC circuit are connected. Connecting, the output end is connected to the processor, for comparing a VBUS voltage of the USB A-type port with a first base voltage of the DC/DC circuit, and transmitting a voltage comparison result to the processor; the processor According to the voltage comparison result, it is judged whether it is a USB host or a USB device, and when it is determined that it is a USB host, the signal line D+ or the signal line D- is pulled up by the pull-up resistor circuit, and when the USB device is determined, the signal is pulled through the pull-down resistor circuit. Line D+ and signal line D- are pulled low and the first base voltage of the DC/DC circuit is converted to a second base voltage.
可选地,起始时,本发明的USB接口的VBUS的初始电压介于4.4V和4.75V之间,当此接口上插入一个USB设备后,比较器识别VBUS电压,并将电压比较结果发送给处理器,处理器根据电压比较结果判断接口插入的是USB设备后,通过触发DC/DC电路进行电压变换,抬高VBUS电压到4.75V以上,满足高功率设备的供电需求,并在D+/D-上接入上拉电阻并切换协议栈,让设备进入USB设备模式跟外接的主机进行通信。即,上电后,USB接口默认处于主机模式,此时DC/DC输出5V电压,开关控制信号接通R1和 R2,断开R3。Optionally, at the beginning, the initial voltage of the VBUS of the USB interface of the present invention is between 4.4V and 4.75V. When a USB device is inserted into the interface, the comparator recognizes the VBUS voltage and sends the voltage comparison result. To the processor, the processor determines, according to the voltage comparison result, that the interface is inserted into the USB device, triggers the DC/DC circuit to perform voltage conversion, raises the VBUS voltage to above 4.75V, and satisfies the power supply requirement of the high-power device, and at D+/ Connect the pull-up resistor on the D- and switch the protocol stack to let the device enter the USB device mode to communicate with the external host. That is, after power-on, the USB interface defaults to the host mode. At this time, the DC/DC outputs 5V voltage, and the switch control signal turns on R1 and R2, disconnect R3.
在用户插入普通的USB主机接口的后,因为两侧都是USB主机,其两路VBUS电源会短接在一起。本接口的VBUS默认电压(4.5V)低于普通接口上的VBUS电压(4.75至5.25V),所以外部USB主机的VBUS电流会流入本设备,抬高本设备USB接口上的VBUS电压,(由于设备内部包含防电流倒灌的电路,并不会损坏DC/DC)。在本设备内部,通过比较器能够检测到该电压的升高,从而判断出USB接口已经跟外部的USB主机连接。处理器判断有外部主机连接后,切换内部的协议栈进入USB设备模式,并通过开关控制信号,切断电阻R1和R2与USB信号线的连接,并将R3接通在D+上。由于R3的接通,拉高了D+信号,外部插入的主机会识别出该信号,判断出有USB全速设备插入,随后按照USB规范,完成设备的识别和枚举。在枚举成功后,所插入的主机和本设备之间通过USB接口交换数据,完成所需的业务。After the user plugs in the normal USB host interface, the two VBUS power supplies are shorted together because both sides are USB hosts. The default VBUS voltage of this interface (4.5V) is lower than the VBUS voltage (4.75 to 5.25V) on the common interface, so the VBUS current of the external USB host will flow into the device and raise the VBUS voltage on the USB interface of the device. The device contains an anti-current back-up circuit that does not damage the DC/DC). Inside the device, the rise of the voltage can be detected by the comparator, thereby judging that the USB interface has been connected to an external USB host. After the processor determines that there is an external host connection, the internal protocol stack is switched to enter the USB device mode, and the connection between the resistors R1 and R2 and the USB signal line is cut off by the switch control signal, and R3 is connected to D+. Since the R3 is turned on, the D+ signal is pulled up, and the externally inserted host recognizes the signal, determines that a USB full-speed device is inserted, and then performs device identification and enumeration according to the USB specification. After the enumeration is successful, the inserted host and the device exchange data through the USB interface to complete the required services.
在用户可能会拔掉此USB主机后,本设备能够检测到VBUS电压的降低,从而切换协议栈为主机状态,此时接口上的VBUS电压改由内部的DC/DC供电,输出4.5V,返回到初始状态。After the user may unplug the USB host, the device can detect the decrease of the VBUS voltage, thereby switching the protocol stack to the host state. At this time, the VBUS voltage on the interface is powered by the internal DC/DC, and the output is 4.5V, and the return is performed. To the initial state.
图3是本发明实施例的再一种USB接口电路连接示意图,相对于图2,本发明图3是通过模数转换器ADC来完成图2中比较器的所有功能,可选地,本发明实施例的模数转换器ADC,分别与USB A型口以及处理器连接,用于将USB A型口的VBUS电压与DC/DC电路的第一基础电压进行比较,并将电压比较结果发送给所述处理器;所述处理器根据电压比较结果判断是USB主机还是USB设备,并在判定是USB主机时,通过上拉电阻电路将信号线D+或D-与高电压连接,在判定是USB设备时,通过下拉电阻电路将信号线D+和D-拉高,并将所述DC/DC电路的第一基础电压变换为第二基础电压。 3 is a schematic diagram of another USB interface circuit connection according to an embodiment of the present invention. With respect to FIG. 2, FIG. 3 of the present invention performs all functions of the comparator of FIG. 2 through an analog-to-digital converter ADC, and optionally, the present invention. The analog-to-digital converter ADC of the embodiment is respectively connected to the USB A port and the processor, and compares the VBUS voltage of the USB A port with the first base voltage of the DC/DC circuit, and sends the voltage comparison result to The processor determines whether the USB host or the USB device is based on the voltage comparison result, and when the USB host is determined, the signal line D+ or D- is connected to the high voltage through the pull-up resistor circuit, and the determination is USB. In the case of the device, the signal lines D+ and D- are pulled high by a pull-down resistor circuit, and the first base voltage of the DC/DC circuit is converted to a second base voltage.
可选地,本领域的技术人员可以根据本发明的比较器的例子进行理解,在此不再详细赘述。Alternatively, those skilled in the art can understand according to the example of the comparator of the present invention, and details are not described herein again.
为了更好的对本发明所述的接口进行说明,下面将通过几个具体应用的例子对本发明进行解释和说明:In order to better illustrate the interface of the present invention, the present invention will be explained and illustrated by way of several specific application examples:
本发明的USB接口电路在CPE上的应用:在很多处理无线、有线和光纤接入的CPE设备上,经常需要提供USB A型接口给用户,外接U盘和打印机等USB设备。除此之外还需要一个USB接口,工作在USB设备模式下,连接PC机后,用于调试和下载升级。在这种类型设备上,我们可以使用本发明的USB A型接口,只需要1个接口就能够同时实现上述2个功能,节省了成本和体积,尤其是当CPE内部处理器的USB口数量有限时,可以省掉USB接口扩展的相关电路。The application of the USB interface circuit of the invention on the CPE: On many CPE devices that handle wireless, wired and fiber access, it is often necessary to provide a USB A-type interface to the user, and an external USB device such as a USB flash drive and a printer. In addition to this, you need a USB interface, working in USB device mode, after connecting to the PC, for debugging and downloading upgrades. On this type of device, we can use the USB A-type interface of the present invention, and only need one interface to realize the above two functions at the same time, which saves cost and volume, especially when the number of USB ports of the CPE internal processor is limited. When you can save the relevant circuit of the USB interface expansion.
该type A型USB接口默认为主机模式,当用户插入USB设备后,该接口通过VBUS对所插入的用户USB设备供电、识别和枚举,完成所需业务。The type A USB interface defaults to the host mode. When the user inserts the USB device, the interface supplies power, identifies, and enumerates the inserted user USB device through VBUS to complete the required service.
当售后或者研发人员需要调试或者下载时,可以直接将该接口连接到PC机的type A型USB接口。此时,因为PC机的默认VBUS电压比本CPE设备高,本CPE会按照前面描述的方法,切换为USB设备模式,实现调试或者下载升级的功能。When the after-sales or R & D personnel need to debug or download, you can directly connect the interface to the type A USB interface of the PC. At this time, because the default VBUS voltage of the PC is higher than that of the CPE device, the CPE will switch to the USB device mode according to the method described above, and implement the function of debugging or downloading and upgrading.
当然,这个接口的特殊功能也可以开放给用户。用户在连接PC机后,本CPE设备也是工作在USB设备模式下,用户可以直接通过USB线缆上网或者访问CPE内部的存储内容。Of course, the special features of this interface can also be opened to users. After the user connects to the PC, the CPE device also works in the USB device mode. The user can directly access the Internet through the USB cable or access the stored content inside the CPE.
本发明实施例的USB接口电路在PC机和平板电脑上的应用:当前的PC机上大量使用USB type A型USB接口,仅支持主机模式。如果能使用本发明技术将其改造为OTG接口,则可以实现两台PC机之间不通过其他交换设备的高速互连,能够在一个PC机上高速访问另外一个PC机的存 储空间,实用性强。由于这个互连不需要设置IP地址,它比网线互连还要快捷方便。The application of the USB interface circuit of the embodiment of the invention on a PC and a tablet computer: a USB type A USB interface is widely used on the current PC, and only the host mode is supported. If the technology of the present invention can be used to transform it into an OTG interface, high-speed interconnection between two PCs without using other switching devices can be realized, and the storage of another PC can be accessed at a high speed on one PC. Storage space, practical. Since this interconnect does not require an IP address, it is faster and more convenient than a network cable.
在一些实施例中,可以用颜色或者字符等手段标注出某个type A型USB接口是否支持OTG(On-The-Go)功能。如果支持OTG,则表示该接口可以直连到其他设备的主机接口上,此时本机将被视为上述其他设备USB主机接口上外挂的USB设备。如果本发明所描述的type A型USB接口互连,则由于在互连后,两侧的VBUS电压都低于4.75V的门限,均无法识别到对方的插入,所以都会保持在主机模式下,无法识别出对方的插入。但这样也不会造成接口的损坏,相对于传统的type A型USB接口,也是一个进步。传统的type A型USB主机接口互连,有可能导致接口的损坏。In some embodiments, it is possible to indicate whether a type A USB interface supports the OTG (On-The-Go) function by means of color or characters. If the OTG is supported, the interface can be directly connected to the host interface of other devices. In this case, the local device will be regarded as a USB device externally connected to the USB host interface of the other device. If the type A type USB interface described in the present invention is interconnected, since the VBUS voltages on both sides are lower than the threshold of 4.75V after the interconnection, the insertion of the other party cannot be recognized, so that the host mode is maintained. The insertion of the other party could not be recognized. But this will not cause damage to the interface, compared to the traditional type A USB interface, is also an improvement. The traditional type A USB host interface is interconnected, which may cause damage to the interface.
本发明实施例的USB接口电路在平板电脑上的应用:由于现存的大量的USB设备都是使用的type A型插头,如U盘,U key等,平板电脑上保留type A型USB接口也是很有必要的。事实上,目前在售的平板电脑,就有相当一部分保留了type A型USB接口,如微软的SURFACE系列。但平板电脑对便携的要求很高,如果该接口同时支持OTG模式,就能用一个接口实现连接电脑和连接外设这两种功能,对控制尺寸非常有利。The application of the USB interface circuit of the embodiment of the present invention on a tablet computer: since a large number of existing USB devices are type A type plugs, such as a U disk, a U key, etc., the type A type USB interface is also retained on the tablet computer. Necessary. In fact, a significant portion of the tablets currently on sale retain a type A USB interface, such as Microsoft's SURFACE series. However, the tablet computer has high requirements for portability. If the interface supports the OTG mode at the same time, the two functions of connecting the computer and connecting the peripheral device can be realized by one interface, which is very advantageous for controlling the size.
总体来说,本发明实施例通过利用外接的USB设备和USB主机在VBUS电压上的差异,识别出USB接口连接的是USB主机还是USB设备,并根据连接的是USB主机还是USB设备对信号线D+和/或D-进行处理,以使USB接口电路与USB A型口连接的USB设备或USB主机相匹配,从而使同一个USB接口同时能够支持与USB设备和USB主机的连接,进而有效解决了现有的USB A型口不能同时支持与USB设备和USB主机的连接的问题。Generally, in the embodiment of the present invention, by using the difference between the external USB device and the USB host on the VBUS voltage, it is recognized whether the USB interface is connected to the USB host or the USB device, and according to whether the USB host or the USB device is connected to the signal line. D+ and/or D- are processed to match the USB interface circuit with the USB device or USB host connected to the USB A port, so that the same USB interface can simultaneously support the connection with the USB device and the USB host, thereby effectively solving the problem. The existing USB A-type port cannot support the connection with the USB device and the USB host at the same time.
本发明实施例提供了一种USB接口的实现方法,参见图4,该方法包 括:An embodiment of the present invention provides a method for implementing a USB interface. Referring to FIG. 4, the method package is provided. include:
S401、将检测到的USB A型口的VBUS电压与预设的第一基础电压进行比较;S401. Compare the detected VBUS voltage of the USB A port with a preset first base voltage;
S402、根据所述电压比较结果对信号线D+和/或信号线D-进行处理,以使USB接口电路与USB A型口连接的USB设备或USB主机相匹配。S402. Process the signal line D+ and/or the signal line D- according to the voltage comparison result, so that the USB interface circuit matches the USB device or the USB host connected to the USB Type A port.
本发明通过利用外接的USB设备和USB主机在VBUS电压上的差异,识别出USB接口连接的是USB主机还是USB设备,并根据连接的是USB主机还是USB设备对信号线D+和/或D-进行处理,以使USB接口电路与USB A型口连接的USB设备或USB主机相匹配,从而使同一个USB接口同时能够支持与USB设备和USB主机的连接,进而有效解决了现有的USB A型口不能同时支持与USB设备和USB主机的连接的问题。The invention recognizes whether the USB interface is connected to the USB host or the USB device by using the difference between the external USB device and the USB host on the VBUS voltage, and according to whether the USB host or the USB device is connected to the signal line D+ and/or D- Processing to match the USB interface circuit to the USB device or USB host connected to the USB A port, so that the same USB interface can simultaneously support the connection with the USB device and the USB host, thereby effectively solving the existing USB A. The port cannot support the connection to the USB device and the USB host at the same time.
在本实施例中所述步骤S402根据电压比较结果对信号线D+和/或信号线D-进行处理,例如,调整信号线D+和/或信号线D-上的电压值,使得USB接口的D信号线上的电压与当前连接的设备所需的电压相匹配。这里的设备可为外接的USB设备,或USB主机。这里的电信号不限于电压,在一些实施例中,还可以是电流。这里的D信号线包括:信号线D+和信号线D-。In the embodiment, the step S402 processes the signal line D+ and/or the signal line D- according to the voltage comparison result, for example, adjusting the voltage value on the signal line D+ and/or the signal line D-, so that the D of the USB interface The voltage on the signal line matches the voltage required by the currently connected device. The device here can be an external USB device, or a USB host. The electrical signal herein is not limited to a voltage, and in some embodiments, may be a current. The D signal line here includes: a signal line D+ and a signal line D-.
例如,本发明实施所述步骤S402具体包括:根据所述电压比较结果判断所述USB A型口连接的是USB设备还是USB主机,并在判断是USB设备时,通过下拉电阻电路将信号线D+和信号线D-拉低,在判断是USB主机时,通过上拉电阻电路将信号线D+或信号线D-拉高。For example, the step S402 of the present invention specifically includes: determining, according to the voltage comparison result, whether the USB A port is connected to a USB device or a USB host, and when determining that the USB device is a USB device, the signal line D+ is pulled through a pull-down resistor circuit. And the signal line D- is pulled low, and when it is judged to be the USB host, the signal line D+ or the signal line D- is pulled up by the pull-up resistor circuit.
可选地,本发明是在判断是USB设备时,通过下拉电阻电路将信号线D+和D-与地连接,在判断是USB主机时,通过上拉电阻电路将信号线D+或D-与高压电源连接。Optionally, the present invention connects the signal lines D+ and D- to the ground through a pull-down resistor circuit when determining that it is a USB device, and connects the signal line D+ or D- with a high voltage through the pull-up resistor circuit when determining that the USB host is a USB host. Power connection.
可选地,本发明实施例所述的方法还包括:通过DC/DC电路输出所述第一基础电压,当所述电压比较结果判断所述USB A型口连接的是USB设 备时,所述DC/DC电路输出的将第一基础电压变换为第二基础电压;其中,第二基础电压为4.75至5.25V。Optionally, the method of the embodiment of the present invention further includes: outputting the first base voltage by using a DC/DC circuit, and determining, by the voltage comparison result, that the USB A port is connected to a USB device. In standby mode, the output of the DC/DC circuit converts the first base voltage into a second base voltage; wherein the second base voltage is 4.75 to 5.25V.
可选地,本发明实施例通过将DC/DC电路分别与处理器以及USB A型口连接,DC/DC电路输出所述第一基础电压,并在所述处理器触发下,将所述第一基础电压变换为第二基础电压;所述处理器在根据所述电压比较结果判断所述USB A型口连接的是USB设备时,触发所述DC/DC电路进行电压变换。Optionally, the embodiment of the present invention connects the DC/DC circuit to the processor and the USB A port, and the DC/DC circuit outputs the first base voltage, and when the processor triggers, the first Converting a base voltage to a second base voltage; the processor triggering the DC/DC circuit to perform voltage conversion when determining that the USB A port is connected to the USB device according to the voltage comparison result.
例如,本发明实施例是的DC/DC电路能够输出第一基础电压(4.4至4.75V,即USB设备的电压)和第二基础电压(4.75至5.25V,即USB主机的电压),在处理器判断USB A型口连接的是USB设备时,DC/DC电路能够切换为USB主机的电压,以与连接的USB设备相匹配。For example, the embodiment of the present invention is a DC/DC circuit capable of outputting a first base voltage (4.4 to 4.75 V, that is, a voltage of a USB device) and a second base voltage (4.75 to 5.25 V, that is, a voltage of a USB host), in processing When it is determined that the USB A port is connected to a USB device, the DC/DC circuit can be switched to the voltage of the USB host to match the connected USB device.
图5是本发明实施例的另一种USB设备与USB主机共用USB接口的方法的流程示意图,如图5所示,该方法包括:FIG. 5 is a schematic flowchart of another method for sharing a USB interface between a USB device and a USB host according to an embodiment of the present invention. As shown in FIG. 5, the method includes:
S501、USB上电开机;S501, USB power on;
S502、VBUS默认输出4.5V,接通下拉电阻R1和R2;S502, VBUS default output 4.5V, turn on the pull-down resistors R1 and R2;
S503、判断D+/D-电平,有高电平进入S504,否则进入S508;所述高电平可为高于预设参考电平的电平。S503, judging the D+/D-level, having a high level to enter S504, otherwise entering S508; the high level may be a level higher than a preset reference level.
S504、切换VBUS电压为5V;切换VBUS电压为5V可为:将VBUS上的电压切换为5V;S504, switching VBUS voltage is 5V; switching VBUS voltage to 5V can be: switching the voltage on VBUS to 5V;
S505、作为USB主机工作识别和枚举外设;S505, working as a USB host to identify and enumerate peripherals;
S506、通过USB接口传输数据;S506. Transmitting data through a USB interface;
S507、拔掉USB线缆,USB通信终止,返回S502;S507, unplug the USB cable, the USB communication is terminated, and return to S502;
S508、检测VBUS电压;S508, detecting a VBUS voltage;
S509、判断VBUS电压是否高于4.5V,如果是,则进入下一步,否则进入S502; S509, determining whether the VBUS voltage is higher than 4.5V, and if so, proceeding to the next step, otherwise proceeding to S502;
S510、有主机接入,断开电阻R1和R2,接通R3;S510, having host access, disconnecting resistors R1 and R2, and turning on R3;
S511、作为USB外设工作,配合主机完成外设的识别和枚举;S511, working as a USB peripheral, cooperate with the host to complete the identification and enumeration of peripherals;
S512、本设备和所插入的主机通过USB接口传输数据;S512, the device and the inserted host transmit data through the USB interface;
S513、拔掉USB线缆,USB通信终止,返回S502。S513. Unplug the USB cable, the USB communication is terminated, and the process returns to S502.
本发明实施例中的相关内容可参照电路实施例和装置实施部分进行理解,在此不再赘述。The related content in the embodiments of the present invention can be understood by referring to the circuit embodiment and the device implementation part, and details are not described herein again.
本发明实施例提供了一种USB接口的实现装置,参见图6,该装置包括:An embodiment of the present invention provides an apparatus for implementing a USB interface. Referring to FIG. 6, the apparatus includes:
比较单元,配置为将检测到的USB A型口的VBUS电压与预设的第一基础电压进行比较;所述比较单元可包括:比较器或具有比较功能的比较电路a comparison unit configured to compare the detected VBUS voltage of the USB A-type port with a preset first base voltage; the comparison unit may include: a comparator or a comparison circuit having a comparison function
处理单元,配置为根据所述电压比较结果对信号线D+和/或信号线D-进行处理,以使USB接口电路与USB A型口连接的USB设备或USB主机相匹配。所述处理单元可包括:处理器或处理电路。所述处理器可包括:中央处理器、微处理器、数字信号处理器、应用处理器、可编程阵列、应用处理器或专用集成电路等。The processing unit is configured to process the signal line D+ and/or the signal line D- according to the voltage comparison result to match the USB interface circuit with the USB device or USB host connected to the USB Type A port. The processing unit can include a processor or processing circuitry. The processor can include a central processing unit, a microprocessor, a digital signal processor, an application processor, a programmable array, an application processor, or an application specific integrated circuit.
本发明实施例通过利用外接的USB设备和USB主机在VBUS电压上的差异,识别出USB接口连接的是USB主机还是USB设备,并根据连接的是USB主机还是USB设备对信号线D+和/或D-进行处理,以使USB接口电路与USB A型口连接的USB设备或USB主机相匹配,从而使同一个USB接口同时能够支持与USB设备和USB主机的连接,进而有效解决了现有的USB A型口不能同时支持与USB设备和USB主机的连接的问题。In the embodiment of the present invention, by using the difference between the external USB device and the USB host on the VBUS voltage, it is recognized whether the USB interface is connected to the USB host or the USB device, and according to whether the USB host or the USB device is connected to the signal line D+ and/or D- is processed to match the USB interface circuit with the USB device or USB host connected to the USB A port, so that the same USB interface can simultaneously support the connection with the USB device and the USB host, thereby effectively solving the existing The USB Type A port cannot support the connection to the USB device and the USB host at the same time.
可选地,本发明实施例的所述处理单元,还配置为根据所述电压比较结果判断所述USB A型口连接的是USB设备还是USB主机,并在判断是USB设备时,通过下拉电阻电路将信号线D+和信号线D-拉低,在判断是 USB主机时,通过上拉电阻电路将信号线D+或信号线D-拉高。Optionally, the processing unit of the embodiment of the present invention is further configured to determine, according to the voltage comparison result, whether the USB A port is connected to a USB device or a USB host, and when determining that the USB device is a pull-down resistor The circuit pulls the signal line D+ and the signal line D- low, in the judgment is When the USB host is used, the signal line D+ or the signal line D- is pulled up by the pull-up resistor circuit.
可选地,本发明实施例的处理单元,还配置为在判断与USB A型接口连接的是USB设备时,通过下拉电阻电路将信号线D+和D-与地连接,在判断与USB A型接口连接的是USB主机时,通过上拉电阻电路将信号线D+或D-与高压电源连接。Optionally, the processing unit of the embodiment of the present invention is further configured to: when determining that the USB device is connected to the USB A-type interface, connect the signal lines D+ and D- to the ground through a pull-down resistor circuit, and determine the USB A type. When the interface is connected to a USB host, the signal line D+ or D- is connected to the high voltage power supply through a pull-up resistor circuit.
可选地,本发明实施例所述的装置还包括:直流电源单元;所述直流电源单元,配置为输出所述第一基础电压,当所述电压比较结果判断所述USB A型口连接的是USB设备时,将输出的第一基础电压变换为第二基础电压。Optionally, the device according to the embodiment of the present invention further includes: a DC power supply unit; the DC power supply unit configured to output the first base voltage, and when the voltage comparison result determines that the USB A port is connected When it is a USB device, the output first base voltage is converted into a second base voltage.
可选地,本发明实施例通过将DC/DC电路分别与处理器以及USB A型口连接,DC/DC电路输出所述第一基础电压,并在所述处理器触发下,将所述第一基础电压变换为第二基础电压;所述处理器,还配置为在根据所述电压比较结果判断所述USB A型口连接的是USB设备时,触发所述DC/DC电路进行电压变换。Optionally, the embodiment of the present invention connects the DC/DC circuit to the processor and the USB A port, and the DC/DC circuit outputs the first base voltage, and when the processor triggers, the first The base voltage is converted into a second base voltage; the processor is further configured to trigger the DC/DC circuit to perform voltage conversion when determining that the USB A port is connected to the USB device according to the voltage comparison result.
例如,本发明实施例是的DC/DC电路能够输出第一基础电压(4.4至4.75V)和第二基础电压(4.75至5.25V),在处理器判断USB A型口连接的是USB设备时,DC/DC电路能够切换为USB主机的电压,以与连接的USB设备相匹配。For example, the embodiment of the present invention is a DC/DC circuit capable of outputting a first base voltage (4.4 to 4.75 V) and a second base voltage (4.75 to 5.25 V), when the processor determines that the USB A port is connected to a USB device. The DC/DC circuit can be switched to the voltage of the USB host to match the connected USB device.
本发明实施例中的相关内容可参照电路实施例和方法实施部分进行理解,在此不再赘述。The related content in the embodiments of the present invention can be understood by referring to the circuit embodiment and the method implementation part, and details are not described herein again.
本发明实施例中通过利用外接的USB设备和USB主机在VBUS电压上的差异,识别出USB接口连接的是USB主机还是USB设备,并根据连接的是USB主机还是USB设备对信号线D+和/或D-进行处理,以使USB接口电路与USB A型口连接的USB设备或USB主机相匹配,从而使同一个USB接口同时能够支持与USB设备和USB主机的连接,进而有效解决了现有的 USB A型口不能同时支持与USB设备和USB主机的连接的问题。In the embodiment of the present invention, by using the difference between the external USB device and the USB host on the VBUS voltage, it is recognized whether the USB interface is connected to the USB host or the USB device, and according to whether the USB host or the USB device is connected to the signal line D+ and / Or D- processing to match the USB interface circuit with the USB device or USB host connected to the USB A port, so that the same USB interface can simultaneously support the connection with the USB device and the USB host, thereby effectively solving the existing of The USB Type A port cannot support the connection to the USB device and the USB host at the same time.
本发明实施例还提供一种计算机存储介质,所述计算机存储介质中存储有计算机可执行指令,所述计算机可执行指令被处理器等设备执行后,可实现前述的一个或多个实施例中提供的USB接口的实现方法。The embodiment of the present invention further provides a computer storage medium, where the computer executable medium stores computer executable instructions, and the computer executable instructions are executed by a processor or the like, and the foregoing one or more embodiments may be implemented. The implementation of the provided USB interface.
本发明实施例提供的计算机存储介质包括:移动存储设备、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。可选为,所述计算机存储介质可为非瞬间存储介质。这里的非瞬间存储介质又可以称为非易失性存储介质。The computer storage medium provided by the embodiment of the invention includes: a mobile storage device, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and the like, which can store program codes. Medium. Optionally, the computer storage medium can be a non-transitory storage medium. The non-transitory storage medium herein may also be referred to as a non-volatile storage medium.
尽管为示例目的,已经公开了本发明的优选实施例,本领域的技术人员将意识到各种改进、增加和取代也是可能的,因此,本发明的范围应当不限于上述实施例。While the preferred embodiments of the present invention have been disclosed for purposes of illustration, those skilled in the art will recognize that various modifications, additions and substitutions are possible, and the scope of the invention should not be limited to the embodiments described above.
工业实用性Industrial applicability
本发明实施例中,会检测USB A型口的VBUS电压,根据该电压与第一基础电压进行比较,获得一个比较结果;再由处理器根据该比较结果,由处理器判断出当前连接到USB A型口连接的设备是USB外设还是USB主机,从而通过调整信号线D+和/或信号线D-上的电信号,能够使得信号线D+和/或信号线D-输出与当前连接的设备相适配的电信号,从而使得USB A型口既可以适配于USB外设,也可以适配于USB主机,从而解决USB A型口的使用局限性大的问题,拓展了USB A型口的可连接设备,具有积极的工业效果。且通过检测VBUS的电压及比较,并通过信号线D+和/或信号线D-上的电信号的调整即可,具有实现简便,在工业上可广泛使用的特点,故工业上可实现性强。 In the embodiment of the present invention, the VBUS voltage of the USB A port is detected, and the comparison result is compared with the first base voltage to obtain a comparison result; and then the processor determines, according to the comparison result, that the current connection is to the USB. Whether the A-port connected device is a USB peripheral or a USB host, so that the signal line D+ and/or the signal line D- can be output to the currently connected device by adjusting the electrical signal on the signal line D+ and/or the signal line D-. The compatible electric signal enables the USB A-type port to be adapted to both the USB peripheral device and the USB host, thereby solving the problem of the limitation of the use of the USB A-type port, and expanding the USB A-type port. Connectable devices with positive industrial effects. And by detecting the voltage and comparison of the VBUS, and adjusting the electrical signal on the signal line D+ and/or the signal line D-, it has the characteristics of simple implementation, wide use in the industry, and thus industrially achievable. .

Claims (16)

  1. 一种USB接口电路,包括:A USB interface circuit comprising:
    USB A型口,配置为与USB设备或者USB主机连接;USB A port configured to connect to a USB device or USB host;
    比较部,配置为将检测到的USB A型口的VBUS电压与预设的第一基础电压进行比较,并将电压比较结果发送给处理器;a comparison unit configured to compare the detected VBUS voltage of the USB A port with a preset first base voltage, and send the voltage comparison result to the processor;
    所述处理器,配置为根据所述电压比较结果对信号线D+和/或信号线D-进行处理。The processor is configured to process the signal line D+ and/or the signal line D- according to the voltage comparison result.
  2. 根据权利要求1所述的USB接口电路,其中,The USB interface circuit according to claim 1, wherein
    所述处理器,还配置为根据所述电压比较结果判断所述USB A型口连接的是USB设备还是USB主机,并在判断是USB设备时,通过下拉电阻电路将信号线D+和信号线D-拉低,在判断是USB主机时,通过上拉电阻电路将信号线D+或信号线D-拉高。The processor is further configured to determine, according to the voltage comparison result, whether the USB A-type port is connected to a USB device or a USB host, and when determining that the USB device is a USB device, the signal line D+ and the signal line D are connected through a pull-down resistor circuit. - Pull low, when the USB host is judged, the signal line D+ or the signal line D- is pulled up by the pull-up resistor circuit.
  3. 根据权利要求2所述的USB接口电路,其中,所述USB接口电路还包括:直流电源DC/DC电路;The USB interface circuit according to claim 2, wherein the USB interface circuit further comprises: a DC power supply DC/DC circuit;
    所述DC/DC电路,分别与所述处理器以及USB A型口连接,配置为输出所述第一基础电压,并在所述处理器触发下,将所述第一基础电压变换为第二基础电压;The DC/DC circuit is respectively connected to the processor and the USB A port, configured to output the first base voltage, and after the processor is triggered, convert the first base voltage into a second Base voltage
    所述处理器,还配置为当根据所述电压比较结果判断所述USB A型口连接的是USB设备时,触发所述DC/DC电路进行电压变换。The processor is further configured to trigger the DC/DC circuit to perform voltage conversion when it is determined that the USB A port is connected to the USB device according to the voltage comparison result.
  4. 根据权利要求3所述的USB接口电路,其中,The USB interface circuit according to claim 3, wherein
    所述第一基础电压为4.4至4.75V,所述第二基础电压为4.75至5.25V。The first base voltage is 4.4 to 4.75 V, and the second base voltage is 4.75 to 5.25 V.
  5. 根据权利要求3所述的USB接口电路,其中,所述USB接口电路还包括:限流防倒灌电路;The USB interface circuit of claim 3, wherein the USB interface circuit further comprises: a current limiting anti-backflow circuit;
    所述限流防倒灌电路将所述DC/DC电路与USB A型口连接。 The current limiting anti-backflow circuit connects the DC/DC circuit to a USB Type A port.
  6. 根据权利要求3所述的USB接口电路,其中,所述比较部包括:比较器;The USB interface circuit according to claim 3, wherein the comparing portion comprises: a comparator;
    所述比较器的同相输入端与USB A型口连接,反向输入端与DC/DC电路连接,输出端与所述处理器连接,配置为将USB A型口的VBUS电压与所述DC/DC电路的第一基础电压进行比较,并将电压比较结果发送给所述处理器;The non-inverting input of the comparator is connected to the USB A port, the inverting input is connected to the DC/DC circuit, and the output is connected to the processor, and configured to connect the VBUS voltage of the USB A port with the DC/ Comparing the first base voltage of the DC circuit, and transmitting the voltage comparison result to the processor;
    所述处理器,还配置为根据电压比较结果判断是USB主机还是USB设备,并在判定是USB主机时,通过上拉电阻电路将信号线D+或信号线D-拉高,在判定是USB设备时,通过下拉电阻电路将信号线D+和信号线D-拉低,并将所述DC/DC电路的第一基础电压变换为第二基础电压。The processor is further configured to determine whether the USB host or the USB device is based on the voltage comparison result, and when the USB host is determined, the signal line D+ or the signal line D- is pulled up by the pull-up resistor circuit, and the USB device is determined to be At this time, the signal line D+ and the signal line D- are pulled low by a pull-down resistor circuit, and the first base voltage of the DC/DC circuit is converted into a second base voltage.
  7. 根据权利要求3所述的USB接口电路,其中,所述比较部包括:模数转换器;The USB interface circuit according to claim 3, wherein the comparing portion comprises: an analog to digital converter;
    所述模数转换器ADC,分别与USB A型口以及处理器连接,配置为将USB A型口的VBUS电压与DC/DC电路的第一基础电压进行比较,并将电压比较结果发送给所述处理器;The analog-to-digital converter ADC is respectively connected to the USB A-type port and the processor, and is configured to compare the VBUS voltage of the USB A-type port with the first basic voltage of the DC/DC circuit, and send the voltage comparison result to the Processor
    所述处理器,还配置为根据电压比较结果判断是USB主机还是USB设备,并在判定是USB主机时,通过上拉电阻电路将信号线D+或信号线D-拉高,在判定是USB设备时,通过下拉电阻电路将信号线D+和信号线D-拉低,并将所述DC/DC电路的第一基础电压变换为第二基础电压。The processor is further configured to determine whether the USB host or the USB device is based on the voltage comparison result, and when the USB host is determined, the signal line D+ or the signal line D- is pulled up by the pull-up resistor circuit, and the USB device is determined to be At this time, the signal line D+ and the signal line D- are pulled low by a pull-down resistor circuit, and the first base voltage of the DC/DC circuit is converted into a second base voltage.
  8. 一种USB接口的实现方法,包括:A method for implementing a USB interface includes:
    将检测到的USB A型口的VBUS电压与预设的第一基础电压进行比较;Comparing the detected VBUS voltage of the USB A port with a preset first base voltage;
    根据所述电压比较结果对信号线D+和/或信号线D-进行处理,信号线D以使USB接口电路与USB A型口连接的USB设备或USB主机相匹配。The signal line D+ and/or the signal line D- are processed according to the voltage comparison result, and the signal line D is matched with a USB device or a USB host that connects the USB interface circuit to the USB Type A port.
  9. 根据权利要求8所述的方法,其中,所述根据所述电压比较结果对 信号线D+和/或信号线D-进行处理,包括:The method of claim 8 wherein said comparing according to said voltage comparison result The signal line D+ and/or the signal line D- are processed, including:
    根据所述电压比较结果判断所述USB A型口连接的是USB设备还是USB主机,并在判断是USB设备时,通过下拉电阻电路将信号线D+和信号线D-拉低,在判断是USB主机时,通过上拉电阻电路将信号线D+或信号线D-拉高。Determining, according to the voltage comparison result, whether the USB A port is connected to a USB device or a USB host, and when determining that the USB device is a USB device, pulling down the signal line D+ and the signal line D- through a pull-down resistor circuit, determining that the USB is At the time of the host, the signal line D+ or the signal line D- is pulled high by the pull-up resistor circuit.
  10. 根据权利要求9所述的方法,其中,所述方法还包括:通过DC/DC电路输出所述第一基础电压,当所述电压比较结果判断所述USB A型口连接的是USB设备时,所述DC/DC电路输出的将所述第一基础电压变换为第二基础电压。The method according to claim 9, wherein the method further comprises: outputting the first base voltage through a DC/DC circuit, and when the voltage comparison result determines that the USB A port is connected to a USB device, The output of the DC/DC circuit converts the first base voltage into a second base voltage.
  11. 根据权利要求9所述的方法,其中,The method of claim 9 wherein
    所述第一基础电压为4.4至4.75V,所述第二基础电压为4.75至5.25V。The first base voltage is 4.4 to 4.75 V, and the second base voltage is 4.75 to 5.25 V.
  12. 一种USB接口的实现装置,其中,包括:A device for implementing a USB interface, comprising:
    比较单元,配置为将检测到的USB A型口的VBUS电压与预设的第一基础电压进行比较;a comparison unit configured to compare the detected VBUS voltage of the USB A port with a preset first base voltage;
    处理单元,配置为根据所述电压比较结果对信号线D+和/或信号线D-进行处理,以使USB接口电路与USB A型口连接的USB设备或USB主机相匹配。The processing unit is configured to process the signal line D+ and/or the signal line D- according to the voltage comparison result to match the USB interface circuit with the USB device or USB host connected to the USB Type A port.
  13. 根据权利要求12所述的装置,其中,The device according to claim 12, wherein
    所述处理单元,还配置为根据所述电压比较结果判断所述USB A型口连接的是USB设备还是USB主机,并在判断是USB设备时,通过下拉电阻电路将信号线D+和信号线D-拉低,在判断是USB主机时,通过上拉电阻电路将信号线D+或信号线D-拉高。The processing unit is further configured to determine, according to the voltage comparison result, whether the USB A port is connected to a USB device or a USB host, and when determining that the device is a USB device, the signal line D+ and the signal line D are connected through a pull-down resistor circuit. - Pull low, when the USB host is judged, the signal line D+ or the signal line D- is pulled up by the pull-up resistor circuit.
  14. 根据权利要求13所述的装置,其中,所述USB接口的实现装置还包括:直流电源单元;The device according to claim 13, wherein the implementation device of the USB interface further comprises: a DC power supply unit;
    所述直流电源单元,配置为输出所述第一基础电压,当所述电压比较 结果判断所述USB A型口连接的是USB设备时,将输出的第一基础电压变换为第二基础电压。The DC power supply unit is configured to output the first base voltage when the voltage is compared As a result, it is judged that when the USB A port is connected to the USB device, the output first base voltage is converted into the second base voltage.
  15. 根据权利要求14所述的装置,其中,The device according to claim 14, wherein
    所述第一基础电压为4.4至4.75V,所述第二基础电压为4.75至5.25V。The first base voltage is 4.4 to 4.75 V, and the second base voltage is 4.75 to 5.25 V.
  16. 一种计算机存储介质,所述计算机存储介质中存储有计算机可执行指令,所述计算机可执行指令用于执行权利要求8至11任一项提供的USB接口的实现方法。 A computer storage medium having stored therein computer executable instructions for performing the method of implementing the USB interface provided by any one of claims 8 to 11.
PCT/CN2017/107511 2016-11-11 2017-10-24 Usb interface circuit, method and device for usb interface implementation, and computer storage medium WO2018086458A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610998004.2 2016-11-11
CN201610998004.2A CN108073537A (en) 2016-11-11 2016-11-11 Usb circuit, the implementation method of USB interface and device

Publications (1)

Publication Number Publication Date
WO2018086458A1 true WO2018086458A1 (en) 2018-05-17

Family

ID=62110172

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/107511 WO2018086458A1 (en) 2016-11-11 2017-10-24 Usb interface circuit, method and device for usb interface implementation, and computer storage medium

Country Status (2)

Country Link
CN (1) CN108073537A (en)
WO (1) WO2018086458A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111159083A (en) * 2019-12-20 2020-05-15 惠州华阳通用电子有限公司 USB master-slave mode switching method, system, storage medium and terminal
CN113452361A (en) * 2020-03-27 2021-09-28 瑞昱半导体股份有限公司 Universal serial bus signal output circuit with reverse flow current prevention mechanism
CN117155370A (en) * 2023-10-27 2023-12-01 成都爱旗科技有限公司 Anti-backflow circuit

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109032985B (en) * 2018-06-27 2021-06-29 维沃移动通信有限公司 Signal transmission device, terminal and signal transmission method
CN108920397B (en) * 2018-07-02 2020-09-22 Oppo(重庆)智能科技有限公司 Device identification method and device, storage medium and electronic device
CN109189707A (en) * 2018-08-24 2019-01-11 Oppo广东移动通信有限公司 The detection circuit and detection method of USB device type
CN109344016B (en) * 2018-08-31 2022-01-04 珠海全志科技股份有限公司 USB device capable of switching between host and device modes and switching method
CN109557846B (en) * 2018-11-22 2021-06-22 青岛海信移动通信技术股份有限公司 Detection identification circuit, detection identification method thereof and electronic equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060075152A1 (en) * 2004-09-20 2006-04-06 Xiaoming Zhu USB attach detection for USB 1.1 and USB OTG devices
CN101221546A (en) * 2007-01-12 2008-07-16 奇岩电子股份有限公司 Device for automatically detecting universal serial bus main unit or peripherals
CN103106167A (en) * 2013-01-22 2013-05-15 矽力杰半导体技术(杭州)有限公司 Universal Serial Bus (USB) equipment and control method thereof

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060075152A1 (en) * 2004-09-20 2006-04-06 Xiaoming Zhu USB attach detection for USB 1.1 and USB OTG devices
CN101221546A (en) * 2007-01-12 2008-07-16 奇岩电子股份有限公司 Device for automatically detecting universal serial bus main unit or peripherals
CN103106167A (en) * 2013-01-22 2013-05-15 矽力杰半导体技术(杭州)有限公司 Universal Serial Bus (USB) equipment and control method thereof

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111159083A (en) * 2019-12-20 2020-05-15 惠州华阳通用电子有限公司 USB master-slave mode switching method, system, storage medium and terminal
CN113452361A (en) * 2020-03-27 2021-09-28 瑞昱半导体股份有限公司 Universal serial bus signal output circuit with reverse flow current prevention mechanism
CN113452361B (en) * 2020-03-27 2024-04-05 瑞昱半导体股份有限公司 Universal serial bus signal output circuit with reverse current prevention mechanism
CN117155370A (en) * 2023-10-27 2023-12-01 成都爱旗科技有限公司 Anti-backflow circuit
CN117155370B (en) * 2023-10-27 2024-02-02 成都爱旗科技有限公司 Anti-backflow circuit

Also Published As

Publication number Publication date
CN108073537A (en) 2018-05-25

Similar Documents

Publication Publication Date Title
WO2018086458A1 (en) Usb interface circuit, method and device for usb interface implementation, and computer storage medium
US7480758B2 (en) Method and apparatus for automatically switching between USB host and device
US10002061B2 (en) USB interface detector
KR102468187B1 (en) Eletronic device and external device charging method thereof
US9418032B2 (en) Adaptive accessory detection and mode negotiation
TWI393009B (en) Data sharing and transfer systems and methods
US8862790B2 (en) Method for identifying version type of windows operating system on a host by a USB device
US7085876B2 (en) USB controlling apparatus for data transfer between computers and method for the same
US10241935B2 (en) Portable device, cable assembly, and USB system
US7523338B2 (en) Apparatus and method to support USB enumeration of a bus powered handheld device
US7293118B1 (en) Apparatus and method for dynamically providing hub or host operations
TWI492044B (en) System for detecting universal serial bus (usb) device and method thereof
WO2013168289A1 (en) Electronic device and control method therefor
US20120290761A1 (en) USB Converter and Related Method
KR101906829B1 (en) A method and apparatus to control a mode of a device
CN110231861A (en) For providing the method and apparatus of power to electronic equipment
TWI579684B (en) Computing device, method of providing power supply feedback and related computer readable medium
WO2017063459A1 (en) Usb control apparatus and device
US20200166980A1 (en) Intelligent storage device and method for accessing intelligent storage device
US20020084988A1 (en) Apparatus and method for automatically detecting USB mode and PS/2 mode computer keyboard
CN109557846B (en) Detection identification circuit, detection identification method thereof and electronic equipment
US20220413580A1 (en) Power adapters
US8205108B2 (en) Method and module for power detection and peripheral apparatus using the same
WO2017182001A1 (en) Method and device for interface configuration, and computer storage medium
CN111400225A (en) USB switching 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: 17869297

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17869297

Country of ref document: EP

Kind code of ref document: A1