CN1916879A - USB device and method capable of automatic sensing mode of USB - Google Patents

USB device and method capable of automatic sensing mode of USB Download PDF

Info

Publication number
CN1916879A
CN1916879A CN 200510090791 CN200510090791A CN1916879A CN 1916879 A CN1916879 A CN 1916879A CN 200510090791 CN200510090791 CN 200510090791 CN 200510090791 A CN200510090791 A CN 200510090791A CN 1916879 A CN1916879 A CN 1916879A
Authority
CN
China
Prior art keywords
usb
host
port
usb device
function
Prior art date
Legal status (The legal status 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 status listed.)
Granted
Application number
CN 200510090791
Other languages
Chinese (zh)
Other versions
CN100375073C (en
Inventor
邓桂椿
刘名哲
王经楷
赵奕禄
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Sunplus Technology Co Ltd
Original Assignee
Sunplus Technology Co Ltd
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 Sunplus Technology Co Ltd filed Critical Sunplus Technology Co Ltd
Priority to CNB2005100907912A priority Critical patent/CN100375073C/en
Publication of CN1916879A publication Critical patent/CN1916879A/en
Application granted granted Critical
Publication of CN100375073C publication Critical patent/CN100375073C/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Transfer Systems (AREA)

Abstract

A USB unit enabling to automatically detect USB mode is prepared as judging whether USB unit is host function or unit function according electric signal at two connected ports and utilizing a built-in or external switch to switch USB signal to proper connection port.

Description

USB device and method capable of automatic sensing mode of USB
Technical field
The present invention belongs to USB (universal serial bus) (USB, Universal Serial Bus) technical field, refers to a kind of USB devices and methods therefor with automatic sensing mode of USB especially.
Background technology
Existing universal serial bus technology can only be distinguished main frame (Host) function and device (Device) function.Personal computer or set-top box (STB, Set-top box) belong to host function.Big thumb brother (Thumb Drive) and MP3 player then belong to apparatus function, and host function and apparatus function role to each other can't exchange.
Fig. 1 one has the calcspar of the USB device 100 of host function and apparatus function simultaneously.Cooperate a host port 120 to realize host function with a host entity layer 110 in this USB device 100, host port 120 can be A type socket (A receptacle) or small-sized A type socket (mini-Areceptacle).And utilize another device entity layer 130 to cooperate a device port 140 to come the implement device function, device port 140 can be A type plug (A plug), Type B socket (B receptacle) or small-sized Type B socket (mini-B receptacle).Yet owing to use two physical layers, not only area increases, and causes cost to increase simultaneously.And in the practical application, host function and apparatus function can not move simultaneously.The action of one group object layer promptly only arranged at every turn, thereby cause waste.
In the OTG of USB (On-The-Go) specification, an OTG-USB device can switch between host function and apparatus function.Yet, in the OTG of USB (On-The-Go) specification defined Mini-AB cable but can't with prior USB cable compatibility.The user must provide many cables for oneself and could be connected with other OTG-USB device or existing USB device, makes troubles therefore for user's use.
At the problems referred to above, Fig. 2 one has the calcspar of the USB device 200 of A type and Type B socket simultaneously.This USB device 200 is made up of an OTG physical layer 210, a host port 220, a device port 230, switch 240,250 and 260 of thumb-acting switch (DIP switch).When thumb-acting switch 260 was positioned at primary importance, the DP of OTG physical layer 210, DM signal connected as for host port 220, realize host function with this.When thumb-acting switch 260 was positioned at the second place, the DP of OTG physical layer 210, DM signal connected as for device port 230, with this implement device function.Though this need not to provide for oneself two cables, be to carry out host function or apparatus function yet the user need know USB device 200, and thumb-acting switch 260 is pushed the appropriate location.Increased the not convenient property of using thus.So this USB device with host function and apparatus function still has and improves the space.
Summary of the invention
The purpose of this invention is to provide a kind of USB device, provide the problem that two cables could be connected with other OTG-USB device or existing USB device for oneself to solve existing need with Auto-Sensing.
According to characteristics of the present invention, be to propose a kind of USB (universal serial bus) (USB) device, it has host function and apparatus function, and this device comprises a physical layer, a host port, a device port, reaches a switch.This physical layer is in order to sending and receiving USB electric signal, and switches this USB electric signal.This host port has the USB pin, in order to connecting a USB device, and sending and receiving USB electric signal.This device port has the USB pin, in order to connecting a usb host, and sending and receiving USB electric signal.This switch is connected to this physical layer, host port and device port, is connected to the USB pin of this host port with the USB electric signal with this physical layer, or the USB electric signal of this physical layer is connected to the USB pin of device port; Wherein, this physical layer judges that according to the electric signal of host port and device port USB pin this USB device is host function or apparatus function, and utilizes switch that the usb signal of physical layer is switched to corresponding hookup mechanism.
Another characteristics according to the present invention, it is the method that proposes a kind of automatic sensing mode of USB, with detecting USB device is host mode or device pattern, and this USB device has a host port and a device port, and this method comprises (A) this USB device is set at host function; (B) judge whether this host port has a USB device to connect or whether device port is connected to a usb host, if there is not execution in step (A); (C) if step (B) judges that host port is connected to the USB device or device port is connected to usb host, judge it is which port has online deciding to switch to host function or apparatus function again; (D) if step (C) judges that this USB device is an apparatus function, with this USB device switch to apparatus function up to the online disconnection of main frame resumes step (A); (E) if step (C) judges that this USB device is a host function, with this USB device switch to host function up to the online disconnection of device resumes step (A).
Use the present invention, the user need not to provide for oneself cable and also can be connected with other OTG-USB device or prior USB main frame or device; But the pattern of the present invention's Auto-Sensing and setting USB device need not the user and gets involved simultaneously, has increased the convenience that uses.
Description of drawings
Fig. 1 is existing calcspar with USB device of host function and apparatus function;
Fig. 2 is existing calcspar with USB device of host port and device port;
But Fig. 3 is the calcspar of the USB device of the present invention's automatic sensing mode of USB;
Fig. 4 is the process flow diagram of a preferred embodiment of the present invention;
The process flow diagram of another preferred embodiment of Fig. 5 the present invention.
Embodiment
The present invention is a kind of uSB device and method capable of automatic sensing mode of USB, it is according to the electric signal on host port and the device port, judge that the USB device is host function or apparatus function, and utilize built-in or external switch that usb signal is switched to suitable port.Above-mentioned action need not the user and gets involved, so can increase the convenience of use.
Relevant preferred embodiment explanation of the present invention please be with reference to Fig. 3.It is host function or apparatus function in order to detect a USB device 300, and utilizes switch that usb signal is switched to suitable port.This USB device 300 comprises a host port 310, a device port 320, a switch 330, a host port power enable circuit 340, a device port power sensor detecting circuit 350 and an OTG physical layer 360.
When this USB device 300 was host function, host port 310 was the USB device of apparatus function (figure does not show) in order to connect one.This host port 310 can be A type socket (A receptacle) or small-sized A type socket (Mini-A receptacles).
When this USB device 300 was apparatus function, device port 320 was in order to connect a usb host (figure does not show).This device port 320 can be Type B socket (B receptacle), small-sized Type B socket (Mini-B receptacles) or A type plug (A plug).
When control signal switch switches to position 1 with switch 330, the DP and the DM signal that are connected to host port 310 with DP and DM signal with this OTG physical layer 360.When control signal switch switches to position 2 with switch 330, the DP and the DM signal that are connected to device port 320 with DP and DM signal with this OTG physical layer 360.
Host port power enable circuit 340 is connected to this host port 310 and physical layer 360, so that the power supply of the USB device that is connected in host port 310 to be provided.This host port power enable circuit 340 provides a control circuit of can main control system port 310 power supplys whether supplying with.This circuit 340 is made up of a PMOS transistor M1 and the 3rd resistance R 3.When OTG physical layer 360 judges that this USB device 300 is host function, export the control signal hos.drv_vbus_enb of an electronegative potential.The control signal hos.drv_vbus_enb of this electronegative potential can make PMOS transistor M1 conducting.This moment, power vd D5V can offer USB device (figure does not show) use of apparatus function via the VBUS of host port 310.
Device port electric power detecting (dividing potential drop) circuit 350 is that the VBUS of the 5V that provided by main frame comes arrangement for detecting port 320 whether to be connected to main frame.Bleeder circuit 350 is mainly used in and produces physical layer 360 receptible current potentials, in order to avoid too high voltage damages physical layer 360.This circuit 350 is made up of one first resistance R 1 and one second resistance R 2, the USB device (figure does not show) whether it connects a host function in order to detect this device port 320.When this device port 320 connected the USB device of a host function, the VBUS signal of device port 320 can become noble potential.Via bleeder circuit 350, when signal dev.vbus was noble potential, this USB device 300 of OTG physical layer 360 decidables was an apparatus function.This moment, OTG physical layer 360 output high impedances were to control signal hos.drv_vbus_enb, allow the 3rd resistance R 3 that this transistor M1 is closed, and output control signal switch, with the DM of this OTG physical layer 360, DM, the DP signal that the DP signal is connected to this device port 320.
But Fig. 4 is the process flow diagram of the present invention's automatic sensing mode of USB method.In step S410, carry out initialization, the control signal hos.drv_vbus_enb of OTG physical layer 360 output electronegative potentials is with PMOS transistor M1 conducting, and USB device 300 is a host function at this moment.
In step S420, judge host port 310 or whether device port 320 connects the USB device, execution in step S430 then when being connected with the USB device, if not, resumes step S410 then.Among the step S420, judge whether dev.vbus is whether noble potential (1) or the DM that judges host port 310 or DP signal are not electronegative potential (0).
In step S430, judge that USB device 300 is host function or apparatus function.Whether the dev.vbus of its preferential judgment means port is noble potential (1), if, execution in step S440 then, if not, execution in step S470 then.In step S440, expression USB device 300 is an apparatus function, so OTG physical layer 360 output high impedance control signal hos.drv_vbus_enb allow the 3rd resistance R 3 that PMOS transistor M1 is closed.In step S450, USB device 300 actuating unit function operations.In step S460, judge whether dev.vbus is electronegative potential (0), if the usb host that is connected on the device port 320 of expression is pulled out, execution in step S410 then, if not, resumes step S450.
In step S470, expression USB device 300 is a host function, thus the control signal hos.drv_vbus_enb of OTG physical layer 360 output electronegative potentials, with PMOS transistor M1 conducting.In step S480, USB device 300 is carried out the operation of host function.In step S490, judge whether the USB device be connected on the host port 310 is pulled out, if, execution in step S410 then, if not, resumes step S480.
But Fig. 5 is another embodiment process flow diagram of the present invention's automatic sensing mode of USB method.Itself and the main difference of Fig. 4 are among the step S530, preferentially judge that with the DM or the DP signal of host port 310 USB device 300 is host function or apparatus function.
In sum, the present invention judges that USB device 300 is host function or apparatus function, and utilizes built-in or external switch 330 that usb signal is switched to suitable port according to the electric signal on host port 310 and the device port 320.Above-mentioned action need not the user and gets involved.Simultaneously, the user need not to provide for oneself cable and also can be connected with other OTG-USB device or prior USB main frame or device, so can increase the convenience in the use.
Above-mentioned preferred embodiment only is to give an example for convenience of description, and the interest field that the present invention advocated should be as the criterion so that claims are described certainly, but not only limits to the foregoing description.

Claims (15)

1. a USB (universal serial bus) (USB) is installed, and it has host function and apparatus function, and this device comprises:
One physical layer in order to sending and receiving USB electric signal, and switches this USB electric signal;
One host port has the USB pin, in order to connecting a USB device, and sending and receiving USB electric signal;
One device port has the USB pin, in order to connecting a usb host, and sending and receiving USB electric signal; And
One switch is connected to this physical layer, host port and device port, is connected to the USB pin of host port with the USB electric signal with this physical layer, or the USB electric signal of this physical layer is connected to the USB pin of device port;
Wherein, this physical layer judges that according to the electric signal of host port and device port USB pin this USB device is host function or apparatus function, and utilizes switch that the usb signal of physical layer is switched to corresponding hookup mechanism.
2. USB device as claimed in claim 1 wherein more comprises:
One device port power sensor detecting circuit, it is connected to this device port and physical layer, whether is connected to this usb host to detect this device port.
3. USB device as claimed in claim 1 wherein more comprises:
One host port power enable circuit, it is connected to this host port and physical layer, so that the power supply of the USB device that is connected in host port to be provided.
4. USB device as claimed in claim 1, wherein, this physical layer is an OTG (On-The-Go) physical layer.
5. USB device as claimed in claim 1, wherein, this switch is built in this physical layer in being.
6. USB device as claimed in claim 1, wherein, this host port be selected from one of following: A type socket, small-sized A type socket.
7. USB device as claimed in claim 1, wherein, this device port be selected from one of following: Type B socket, small-sized Type B socket, A type plug.
8. the method for an automatic sensing mode of USB is host mode or device pattern to detect a USB device, and this USB device has host port and device port, and this method comprises:
(A) this USB device is set at host function;
(B) judge whether host port and device port are connected to one the one USB device, if there is not execution in step (A);
(C) be connected to a USB device if step (B) is judged, judge that again this USB device is host function or apparatus function; And
(D) if step (C) judges that this USB device is an apparatus function, switches to apparatus function with this USB device.
9. method as claimed in claim 8 wherein more comprises the following step:
(E) judge whether a USB device still connects, if, resumes step (D), if not, execution in step (A).
10. method as claimed in claim 8 wherein more comprises the following step:
(F) if step (C) judges that this USB device is a host function, switches to host function with this USB device.
11. method as claimed in claim 10 wherein more comprises the following step:
(G) judge whether a USB device still connects, if, resumes step (F), if not, execution in step (A).
12. method as claimed in claim 8, wherein, it is one of following that this host port is selected from: A type socket, small-sized A type socket.
13. method as claimed in claim 8, wherein, it is one of following that this device port system is selected from: Type B socket, small-sized Type B socket, A type plug.
14. method as claimed in claim 9, wherein, a USB device is a host function.
15. method as claimed in claim 11, wherein, a USB device is an apparatus function.
CNB2005100907912A 2005-08-16 2005-08-16 USB device and method capable of automatic sensing mode of USB Expired - Fee Related CN100375073C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB2005100907912A CN100375073C (en) 2005-08-16 2005-08-16 USB device and method capable of automatic sensing mode of USB

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB2005100907912A CN100375073C (en) 2005-08-16 2005-08-16 USB device and method capable of automatic sensing mode of USB

Publications (2)

Publication Number Publication Date
CN1916879A true CN1916879A (en) 2007-02-21
CN100375073C CN100375073C (en) 2008-03-12

Family

ID=37737877

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2005100907912A Expired - Fee Related CN100375073C (en) 2005-08-16 2005-08-16 USB device and method capable of automatic sensing mode of USB

Country Status (1)

Country Link
CN (1) CN100375073C (en)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101359316B (en) * 2007-08-03 2010-06-30 联芯科技有限公司 Method and apparatus for implementing general-purpose serial bus USB OTG
CN102004553A (en) * 2010-10-27 2011-04-06 苏州达方电子有限公司 Keyboard
CN103852682A (en) * 2012-11-28 2014-06-11 联发科技股份有限公司 Detecting circuit and related circuit detecting method
CN105808488A (en) * 2014-12-31 2016-07-27 新加坡商华科全球股份有限公司 Electronic device and power supply control method
WO2016154811A1 (en) * 2015-03-27 2016-10-06 周正贤 Removable storage apparatus having otg function
CN102750248B (en) * 2012-06-21 2017-11-10 中兴通讯股份有限公司 A kind of USB device Working mode switching method and USB device
CN107818064A (en) * 2016-09-14 2018-03-20 展汇科技股份有限公司 Support the operation method of the hub of the USB of principal and subordinate's conversion
CN108549612A (en) * 2018-03-20 2018-09-18 青岛海信移动通信技术股份有限公司 A kind of method and USB controller of adjustment operating mode
US10193286B2 (en) 2015-07-30 2019-01-29 Asustek Computer Inc. Electronic device and control method thereof
CN109344016A (en) * 2018-08-31 2019-02-15 珠海全志科技股份有限公司 Can the USB device switched between host and equipment mode and switching method

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6732218B2 (en) * 2002-07-26 2004-05-04 Motorola, Inc. Dual-role compatible USB hub device and method
JP2004157604A (en) * 2002-11-01 2004-06-03 Matsushita Electric Ind Co Ltd Usb peripheral control method and device

Cited By (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101359316B (en) * 2007-08-03 2010-06-30 联芯科技有限公司 Method and apparatus for implementing general-purpose serial bus USB OTG
CN102004553A (en) * 2010-10-27 2011-04-06 苏州达方电子有限公司 Keyboard
CN102750248B (en) * 2012-06-21 2017-11-10 中兴通讯股份有限公司 A kind of USB device Working mode switching method and USB device
US9588859B2 (en) 2012-11-28 2017-03-07 Mediatek Inc. Detecting circuit and related circuit detecting method
CN103852682A (en) * 2012-11-28 2014-06-11 联发科技股份有限公司 Detecting circuit and related circuit detecting method
CN103852682B (en) * 2012-11-28 2016-10-05 联发科技股份有限公司 Circuit for detecting and circuit detecting method
CN105808488B (en) * 2014-12-31 2019-07-02 新加坡商华科全球股份有限公司 Electronic device and its power source supplying controlling method
CN105808488A (en) * 2014-12-31 2016-07-27 新加坡商华科全球股份有限公司 Electronic device and power supply control method
WO2016154811A1 (en) * 2015-03-27 2016-10-06 周正贤 Removable storage apparatus having otg function
US10193286B2 (en) 2015-07-30 2019-01-29 Asustek Computer Inc. Electronic device and control method thereof
CN107818064A (en) * 2016-09-14 2018-03-20 展汇科技股份有限公司 Support the operation method of the hub of the USB of principal and subordinate's conversion
CN107818064B (en) * 2016-09-14 2021-03-09 展汇科技股份有限公司 Operation method of universal serial bus concentrator supporting master-slave conversion
CN108549612A (en) * 2018-03-20 2018-09-18 青岛海信移动通信技术股份有限公司 A kind of method and USB controller of adjustment operating mode
CN108549612B (en) * 2018-03-20 2021-03-19 青岛海信移动通信技术股份有限公司 Method for adjusting working mode and USB controller
CN109344016A (en) * 2018-08-31 2019-02-15 珠海全志科技股份有限公司 Can the USB device switched between host and equipment mode and switching method
CN109344016B (en) * 2018-08-31 2022-01-04 珠海全志科技股份有限公司 USB device capable of switching between host and device modes and switching method

Also Published As

Publication number Publication date
CN100375073C (en) 2008-03-12

Similar Documents

Publication Publication Date Title
CN1916879A (en) USB device and method capable of automatic sensing mode of USB
CN108666826B (en) Adapter, terminal equipment and adapter system
US8205018B2 (en) Method and apparatus for implementing a limited functionality embedded universal serial bus (USB) host controller on a fully functional downstream USB port
CN1175337C (en) Portable electronic equipment with shared serial bus connector
US20040088449A1 (en) USB unit control method and a USB unit controller
US20170364465A1 (en) Techniques for establishing an external interface and a network interface within a connector
CN101526930A (en) USB interface master-slave machine detection device and detection method
US20060080490A1 (en) USB controller with intelligent transmission mode switching function and the operating method thereof
US9219339B2 (en) Computer host power management system having extension cord sockets
CN103237189A (en) Electronic equipment, MHL (mobile high-definition link) connector, MHL system and connector detection method
CN103096210B (en) Signal connection module, electronic device and connector identification method
CN110597475B (en) Automatic switching control system and method for medical display with multiple network ports and multiple hosts
CN100489825C (en) Expansion module and expansion method of general serial bus connection port
CN105302518A (en) Computer equipment and control method thereof
US10802991B2 (en) Pluggable module identification system
CN102999144A (en) USB (Universal Serial Bus) power supply circuit and device as well as power supply method
CN104914933A (en) Control circuit and driving method of touch all-in-one machine external equipment
CN101387914A (en) Wire-controlled apparatus and control method thereof
CN104182189A (en) Electronic equipment and information-processing method
CN103049419A (en) Dual computer system
WO2010108551A1 (en) Power management
CN200944652Y (en) Circuit and television for detecting output of the availability of interface signal
CN1301469C (en) Control circuit and method of double hot plug-in IDE devices
JP2001177543A (en) Device and system for bus connection
CN1285992C (en) Computer I/O port selector and selection method

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20080312

Termination date: 20170816