CN105718012A - Method and circuit for automatically switching Vbus voltage in master/slave mode of OTG device - Google Patents

Method and circuit for automatically switching Vbus voltage in master/slave mode of OTG device Download PDF

Info

Publication number
CN105718012A
CN105718012A CN201410718827.6A CN201410718827A CN105718012A CN 105718012 A CN105718012 A CN 105718012A CN 201410718827 A CN201410718827 A CN 201410718827A CN 105718012 A CN105718012 A CN 105718012A
Authority
CN
China
Prior art keywords
voltage
vbus
window comparator
pin
circuit
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
CN201410718827.6A
Other languages
Chinese (zh)
Other versions
CN105718012B (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.)
Xiamen Yaxon Networks Co Ltd
Original Assignee
Xiamen Yaxon Networks 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 Xiamen Yaxon Networks Co Ltd filed Critical Xiamen Yaxon Networks Co Ltd
Priority to CN201410718827.6A priority Critical patent/CN105718012B/en
Publication of CN105718012A publication Critical patent/CN105718012A/en
Application granted granted Critical
Publication of CN105718012B publication Critical patent/CN105718012B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Direct Current Feeding And Distribution (AREA)
  • Manipulation Of Pulses (AREA)

Abstract

The present invention relates to a method for automatically switching a Vbus voltage in a master/slave mode of an OTG device. When an OTG device is in a master mode, a voltage of a usb_id pin outputs a low level via a window comparator, so as to control a switch circuit to be switched on, and a Vbus pin outputs an operating voltage of a slave device; and when the OTG device is in a salve mode, the voltage of the usb_id pin outputs a high level via the window comparator, so as to control the switch circuit to be cut off, and the Vbus pin outputs nothing. A circuit for automatically switching a Vbus voltage in a master/slave mode of an OTG device comprises a window comparator and a switch circuit. A usb_id pin is connected to an access end Vid of the window comparator, and an output end Vout of the window comparator is connected to the switch circuit; when the OTG device is in the master mode, the window comparator controls a Vbus pin of the switch circuit to output an operating voltage of a slave device; and when the OTG is in the slave mode, the window comparator controls the Vbus pin of the switch circuit to output nothing.

Description

A kind of method of Vbus voltage automatically switched under OTG equipment master slave mode and circuit
Technical field
The present invention relates to the detection field of OTG equipment, more particularly, it relates to a kind of method of Vbus voltage automatically switched under OTG equipment master slave mode and circuit.
Background technology
In prior art, possess the equipment of OTG function by detecting the state of usb_id pin and judge that work is host (holotype/usb_id is unsettled) or device (from pattern/usb_id ground connection/draw high).When working as host, OTG equipment provides Vbus power supply for peripheral hardware and works in holotype, and when working as device, OTG equipment cuts off supply Vbus power supply and works in from pattern.
But, above-mentioned judgment mode needs have Vbus and monitors and power supply circuits (Ldo, current limliting Ic), simultaneously need to software coordinates realizes power switching, and can not accomplish that several usb_id triggers the compatible design of state (high and low, unsettled), under needing the applied environment judging OTG mode of operation quickly and easily, it appears mechanism complexity and cost improve.
Summary of the invention
It is an object of the invention to overcome the deficiencies in the prior art, it is provided that the method for the Vbus voltage under the automatic switchover OTG equipment master slave mode that a kind of pure circuit structure realizes and circuit.
Technical scheme is as follows:
A kind of method of Vbus voltage automatically switched under OTG equipment master slave mode, when OTG equipment is in holotype, the voltage of usb_id pin, through window comparator output low level, controls on-off circuit conducting, and Vbus pin exports from equipment running voltage;When OTG equipment is in from pattern, the voltage of usb_id pin exports high level through window comparator, controls on-off circuit cut-off, and Vbus pin is without output.
As preferably, the voltage of usb_id pin is after electric resistance partial pressure, compare with the low threshold voltage of window comparator, high threshold value, when OTG equipment is in holotype, usb_id pin voltage after dividing potential drop between low threshold voltage and high threshold value, window comparator output low level;When OTG equipment is in from pattern, usb_id pin voltage after dividing potential drop is lower than low threshold voltage or higher than high threshold value, window comparator output high level.
As preferably, on-off circuit includes cascade audion, field effect transistor, and when window comparator exports high level, cascade audion controls field effect transistor cut-off, and Vbus pin is without output voltage;When window comparator output low level, cascade audion controls field effect transistor conducting, and Vbus pin output voltage is as from equipment running voltage.
The circuit of a kind of Vbus voltage automatically switched under OTG equipment master slave mode, including window comparator, on-off circuit, usb_id pin is connected with the incoming end Vid of window comparator, and the output end vo ut of window comparator is connected with on-off circuit;When OTG equipment is in holotype, window comparator controls the Vbus pin of on-off circuit and exports from equipment running voltage;When OTG equipment is in from pattern, window comparator controls the Vbus pin of on-off circuit without output.
As preferably, window comparator includes divider resistance, and after usb_id pin accesses from incoming end Vid, the voltage after electric resistance partial pressure enters the two limit comparison circuit of window comparator from the input Vin of window comparator.
As preferably, on-off circuit includes cascade audion, field effect transistor, and in cascade audion, the colelctor electrode of previous stage is connected with the base stage of rear stage, and the rear colelctor electrode of a pole is connected with the grid of field effect transistor, and the drain electrode of field effect transistor connects Vbus pin.
As preferably, when OTG equipment is in holotype, field effect transistor turns on, and the source electrode of field effect transistor connects running voltage, and the output voltage of Vbus pin is equal to the running voltage being carried in source electrode;When OTG equipment is in from pattern, field effect transistor is ended, and the drain electrode of field effect transistor turns on through body diode reverse with source electrode, and Vbus pin, from main equipment cut-in operation voltage, is that OTG equipment is powered through source electrode.
Beneficial effects of the present invention is as follows:
This method is by building simple and practical circuit structure, window comparator is adopted to coordinate field effect transistor (P-MOSFET), automatically the state detecting usb_id controls the supply of Vbus power supply, and then realize the hardware exchange of OTG equipment master slave mode under triggering state condition of uncertainty, eliminate software judgment mechanism, owing to not needing the cooperation of software judgment mechanism, thus having saved cpu resource.Utilize the P-MOSFET body diode carried, it is achieved equipment working power supply from pattern simultaneously.The present invention is while realizing the judgement of master-slave mode compatibility, coordinate the property (body diode that field effect transistor carries) of simple components and parts, realize device from equipment working power supply pattern, compared with having technology mutually, save power supply and realize departmental cost.
Accompanying drawing explanation
Fig. 1 is the circuit block diagram of the present invention.
Detailed description of the invention
Below in conjunction with drawings and Examples, the present invention is described in further detail.
In the present invention, by detecting the state of usb_id pin, OTG equipment judges that work is host (holotype/usb_id is unsettled) or device (from pattern/usb_id ground connection/draw high).When OTG equipment works as host, OTG equipment provides Vbus power supply for peripheral hardware and works in holotype, and when OTG equipment works as device, OTG equipment cuts off Vbus power supply and supplies and work in from pattern;
The present invention provides a kind of method of Vbus voltage automatically switched under OTG equipment master slave mode, when OTG equipment is in holotype, the voltage of usb_id pin, through window comparator output low level, controls on-off circuit conducting, and Vbus pin exports from equipment running voltage;When OTG equipment is in from pattern, the voltage of usb_id pin exports high level through window comparator, controls on-off circuit cut-off, and Vbus pin is without output.
The voltage of usb_id pin is after electric resistance partial pressure, compare with the low threshold voltage of window comparator, high threshold value, when OTG equipment is in holotype, usb_id pin voltage after dividing potential drop between low threshold voltage and high threshold value, window comparator output low level;When OTG equipment is in from pattern, usb_id pin voltage after dividing potential drop is lower than low threshold voltage or higher than high threshold value, window comparator output high level.
On-off circuit includes cascade audion, field effect transistor, and when window comparator exports high level, cascade audion controls field effect transistor cut-off, and Vbus pin is without output voltage;When window comparator output low level, cascade audion controls field effect transistor conducting, and Vbus pin output voltage is as from equipment running voltage.
The circuit of a kind of Vbus voltage automatically switched under OTG equipment master slave mode, including window comparator, on-off circuit, usb_id pin is connected with the incoming end Vid of window comparator, and the output end vo ut of window comparator is connected with on-off circuit;When OTG equipment is in holotype, window comparator controls the Vbus pin of on-off circuit and exports from equipment running voltage;When OTG equipment is in from pattern, window comparator controls the Vbus pin of on-off circuit without output.
Window comparator includes divider resistance, and after usb_id pin accesses from incoming end Vid, the voltage after electric resistance partial pressure enters the two limit comparison circuit of window comparator from the input Vin of window comparator.
On-off circuit includes cascade audion, field effect transistor, and in cascade audion, the colelctor electrode of previous stage is connected with the base stage of rear stage, and the rear colelctor electrode of a pole is connected with the grid of field effect transistor, and the drain electrode of field effect transistor connects Vbus pin.
When OTG equipment is in holotype, field effect transistor turns on, and the source electrode of field effect transistor connects running voltage, and the output voltage of Vbus pin is equal to the running voltage being carried in source electrode;When OTG equipment is in from pattern, field effect transistor is ended, and the drain electrode of field effect transistor turns on through body diode reverse with source electrode, and Vbus pin, from main equipment cut-in operation voltage, is that OTG equipment is powered through source electrode.
Embodiment
As it is shown in figure 1, window comparator is two limit comparison circuit, mainly include operational amplifier A 1, operational amplifier A 2 is constituted, set the value of reference comparison voltages high threshold value VH and low threshold voltage VL by resistance.Sensitivity as shown in Figure 1, can calculate VL = VCC _ 3 V 3 × R 3 R 1 + R 2 + R 3 = 0.4 V ; VH = VCC _ 3 V 3 R 2 + R 3 R 1 + R 2 + R 3 = 2.8 V .
If Vin<VL or Vin>VH, then Vout exports high level;
If VL≤Vin≤VH, then Vout output low level.
On-off circuit is two-stage rev switch circuitry, mainly includes audion T1, audion T2 and field effect transistor (P-MOSFET) N1.
When Vout is high level, audion T1 turns on, and audion T2 ends, and audion T2 colelctor electrode is pulled to high level, and field effect transistor (P-MOSFET) N1 ends, VBUS_5V0=0V;When field effect transistor (P-MOSFET) N1 ends, owing to field effect transistor (P-MOSFET) N1 carries body diode, drain electrode and source electrode reverse-conducting.When OTG equipment works in from pattern, and when accessing main equipment, VBUS_5V0 obtains running voltage from main equipment, i.e. VBUS_5V0=5V, now, the VCC_5V0 ≈ VBUS_5V0=5V (in practice, the error that the electrical characteristic of components and parts is brought can be ignored) of source electrode it is connected to, arrange in the slave mode thus realizing OTG, external main equipment provide power supply for OTG equipment.
When Vout is low level, audion T1 ends, audion T2 turns on, audion T2 colelctor electrode is pulled down to low level, field effect transistor (P-MOSFET) N1 turns on, VBUS_5V0=5V (standard operating voltage of USB is 5V, and the voltage therefore loaded is final all will export the voltage of 5V at VBUS_5V0).
OTG equipment has two kinds of mode of operations of principal and subordinate, and three kinds of states altogether are specific as follows:
State 1:
When usb_id ground connection, OTG equipment works in from pattern, then Vid=0V, i.e. Vin=0V < VL;
Operational amplifier A 1 output low level, operational amplifier A 2 exports high level;Diode D1 ends, and diode D2 turns on;
Vout exports high level;Audion T1 turns on, and audion T2 ends, and field effect transistor (P-MOSFET) N1 ends;
State 2:
When usb_id draws high, OTG equipment works in from pattern, then Vid=5V,
Operational amplifier A 1 exports high level, operational amplifier A 2 output low level;Diode D1 turns on, and diode D2 ends;
Vout exports high level;Audion T1 turns on, and audion T2 ends, and field effect transistor (P-MOSFET) N1 ends;
Device is worked in from pattern for above-mentioned state 1, state 2, OTG equipment, now field effect transistor (P-MOSFET) N1 cut-off, VBUS_5V0 ≠ VCC_5V0.If now OTG equipment is connected on a main equipment (such as PC), then VBUS_5V0=5V (obtaining from main equipment), body diode by field effect transistor (P-MOSFET) N1 self, drain electrode, source electrode reverse-conducting, generally, Vds ≈ 0.3V, then accurate, VCC_5V0 ≈ 4.7V, OTG device power works, and running voltage is provided by external main equipment.
State 3:
When usb_id is unsettled, OTG equipment works under holotype, then VL < Vid < VH;
Operational amplifier A 1 output low level, operational amplifier A 2 output low level;Diode D1 ends, and diode D2 ends;
Vout output low level;Audion T1 ends, and audion T2 turns on;Field effect transistor (P-MOSFET) N1 turns on;
Working in host holotype for above-mentioned state 3, OTG equipment, now field effect transistor (P-MOSFET) N1 conducting, VBUS_5V0=VCC_5V0=5V, OTG equipment can be that peripheral hardware (from equipment, such as USB flash disk) provides 5V power supply.
Field effect transistor (P-MOSFET) N1 in the present embodiment can also adopt other kinds of metal-oxide-semiconductor to replace, concrete circuit structure, those skilled in the art is on the basis of embodiment disclosed by the invention, characteristic in conjunction with the metal-oxide-semiconductor replaced, all can realize, it is not necessary to carry out creative work.
Above-described embodiment is intended merely to the explanation present invention, and is not used as limitation of the invention.As long as according to the technical spirit of the present invention, above-described embodiment is changed, modification etc. is all by the scope of the claims dropping on the present invention.

Claims (7)

1. the method for the Vbus voltage automatically switched under OTG equipment master slave mode, it is characterized in that, when OTG equipment is in holotype, the voltage of usb_id pin is through window comparator output low level, controlling on-off circuit conducting, Vbus pin exports from equipment running voltage;When OTG equipment is in from pattern, the voltage of usb_id pin exports high level through window comparator, controls on-off circuit cut-off, and Vbus pin is without output.
2. the method for the Vbus voltage under automatic switchover OTG equipment master slave mode according to claim 1, it is characterized in that, the voltage of usb_id pin is after electric resistance partial pressure, compare with the low threshold voltage of window comparator, high threshold value, when OTG equipment is in holotype, the voltage of the usb_id pin after dividing potential drop between low threshold voltage and high threshold value, window comparator output low level;The voltage of the usb_id pin after dividing potential drop is lower than low threshold voltage or higher than high threshold value, window comparator output high level.
3. the method for the Vbus voltage under automatic switchover OTG equipment master slave mode according to claim 1, it is characterized in that, on-off circuit includes cascade audion, field effect transistor, when window comparator exports high level, cascade audion controls field effect transistor cut-off, and Vbus pin is without output voltage;When window comparator output low level, cascade audion controls field effect transistor conducting, and Vbus pin output voltage is as from equipment running voltage.
4. the circuit of the Vbus voltage automatically switched under OTG equipment master slave mode, it is characterised in that including window comparator, on-off circuit, usb_id pin is connected with the incoming end Vid of window comparator, and the output end vo ut of window comparator is connected with on-off circuit;When OTG equipment is in holotype, window comparator controls the Vbus pin of on-off circuit and exports from equipment running voltage;When OTG equipment is in from pattern, window comparator controls the Vbus pin of on-off circuit without output.
5. the circuit of the Vbus voltage under automatic switchover OTG equipment master slave mode according to claim 4, it is characterized in that, window comparator includes divider resistance, after usb_id pin accesses from incoming end Vid, the voltage after electric resistance partial pressure enters the two limit comparison circuit of window comparator from the input Vin of window comparator.
6. the circuit of the Vbus voltage under automatic switchover OTG equipment master slave mode according to claim 4, it is characterized in that, on-off circuit includes cascade audion, field effect transistor, in cascade audion, the colelctor electrode of previous stage is connected with the base stage of rear stage, the rear colelctor electrode of a pole is connected with the grid of field effect transistor, and the drain electrode of field effect transistor connects Vbus pin.
7. the circuit of the Vbus voltage under automatic switchover OTG equipment master slave mode according to claim 6, it is characterized in that, when OTG equipment is in holotype, field effect transistor turns on, the source electrode of field effect transistor connects running voltage, and the output voltage of Vbus pin is equal to the running voltage being carried in source electrode;When OTG equipment is in from pattern, field effect transistor is ended, the drain electrode of field effect transistor and source electrode reverse-conducting, and Vbus pin, from main equipment cut-in operation voltage, is that OTG equipment is powered through source electrode.
CN201410718827.6A 2014-12-02 2014-12-02 Method and circuit for automatically switching Vbus voltage in master-slave mode of OTG (on-the-go) equipment Active CN105718012B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410718827.6A CN105718012B (en) 2014-12-02 2014-12-02 Method and circuit for automatically switching Vbus voltage in master-slave mode of OTG (on-the-go) equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410718827.6A CN105718012B (en) 2014-12-02 2014-12-02 Method and circuit for automatically switching Vbus voltage in master-slave mode of OTG (on-the-go) equipment

Publications (2)

Publication Number Publication Date
CN105718012A true CN105718012A (en) 2016-06-29
CN105718012B CN105718012B (en) 2020-02-18

Family

ID=56146260

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410718827.6A Active CN105718012B (en) 2014-12-02 2014-12-02 Method and circuit for automatically switching Vbus voltage in master-slave mode of OTG (on-the-go) equipment

Country Status (1)

Country Link
CN (1) CN105718012B (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106855848A (en) * 2017-03-13 2017-06-16 山东和远智能科技股份有限公司 The electric power supply control system and method for OTG
CN107480086A (en) * 2017-08-04 2017-12-15 青岛海信移动通信技术股份有限公司 Support circuit, terminal and its control method of OTG functions
CN110932712A (en) * 2018-09-19 2020-03-27 青岛海信移动通信技术股份有限公司 Interface circuit of connector and electronic device
CN111339007A (en) * 2020-02-28 2020-06-26 深圳市广和通无线股份有限公司 USB device control method and device, computer device and storage medium
CN112086830A (en) * 2020-07-23 2020-12-15 福建联迪商用设备有限公司 Data line circuit communicating with Apple equipment
CN112234704A (en) * 2020-10-12 2021-01-15 维沃移动通信有限公司 Flash lamp power supply switching circuit, flash lamp control method and electronic equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1212392A (en) * 1997-09-23 1999-03-31 微星科技股份有限公司 Method for protecting CPU against damage owing to overvoltage and overcurrent
JP2004094495A (en) * 2002-08-30 2004-03-25 Seiko Epson Corp Data transfer controller, electronic apparatus, and power source switching method
CN102150143A (en) * 2008-09-09 2011-08-10 飞思卡尔半导体公司 Adaptive feedback and power control for usb devices
CN103365388A (en) * 2012-04-09 2013-10-23 华为终端有限公司 Power supply method of terminal device and terminal device
CN203387203U (en) * 2013-05-09 2014-01-08 上海斐讯数据通信技术有限公司 Charging switching system possessing USB on-the-go (OTG) function

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1212392A (en) * 1997-09-23 1999-03-31 微星科技股份有限公司 Method for protecting CPU against damage owing to overvoltage and overcurrent
JP2004094495A (en) * 2002-08-30 2004-03-25 Seiko Epson Corp Data transfer controller, electronic apparatus, and power source switching method
CN102150143A (en) * 2008-09-09 2011-08-10 飞思卡尔半导体公司 Adaptive feedback and power control for usb devices
CN103365388A (en) * 2012-04-09 2013-10-23 华为终端有限公司 Power supply method of terminal device and terminal device
CN203387203U (en) * 2013-05-09 2014-01-08 上海斐讯数据通信技术有限公司 Charging switching system possessing USB on-the-go (OTG) function

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106855848A (en) * 2017-03-13 2017-06-16 山东和远智能科技股份有限公司 The electric power supply control system and method for OTG
CN106855848B (en) * 2017-03-13 2023-05-09 和远智能科技股份有限公司 OTG power supply control system and method
CN107480086A (en) * 2017-08-04 2017-12-15 青岛海信移动通信技术股份有限公司 Support circuit, terminal and its control method of OTG functions
CN107480086B (en) * 2017-08-04 2020-11-03 青岛海信移动通信技术股份有限公司 Terminal and control method thereof
CN110932712A (en) * 2018-09-19 2020-03-27 青岛海信移动通信技术股份有限公司 Interface circuit of connector and electronic device
CN110932712B (en) * 2018-09-19 2023-05-05 青岛海信移动通信技术有限公司 Interface circuit of connector and electronic device
CN111339007A (en) * 2020-02-28 2020-06-26 深圳市广和通无线股份有限公司 USB device control method and device, computer device and storage medium
CN111339007B (en) * 2020-02-28 2021-10-08 深圳市广和通无线股份有限公司 USB device control method and device, computer device and storage medium
CN112086830A (en) * 2020-07-23 2020-12-15 福建联迪商用设备有限公司 Data line circuit communicating with Apple equipment
CN112234704A (en) * 2020-10-12 2021-01-15 维沃移动通信有限公司 Flash lamp power supply switching circuit, flash lamp control method and electronic equipment

Also Published As

Publication number Publication date
CN105718012B (en) 2020-02-18

Similar Documents

Publication Publication Date Title
CN105718012A (en) Method and circuit for automatically switching Vbus voltage in master/slave mode of OTG device
CN104345867B (en) Field device
CN105794111B (en) Electric current is controlled during powered up and down sequence
CN102779085A (en) Control circuit of indicator light
CN101359247B (en) Power adapter circuit for motherboard
CN112380080B (en) USB equipment detection system and method
US20100220506A1 (en) Control circuit for switching power supply
TW201339772A (en) Electronic device and its power control circuit
US20140001852A1 (en) Power sequence circuit
CN203368422U (en) Chip enabling signal delay control circuit
CN110323825B (en) Power circuit switching device and method and Internet of things equipment
CN102081418A (en) Linear constant voltage control circuit
CN103576816A (en) Startup and shutdown control circuit
CN103376873A (en) Minimum load current adapter circuit and mainboard
US20130300213A1 (en) Identification circuit
US10389169B2 (en) VBUS power switch
TW201416845A (en) Motherboard
CN106209050B (en) Low-cost low-power consumption electronic switch circuit
CN101459389A (en) Host board voltage regulating circuit
CN102375129A (en) Power supply testing circuit
CN203368331U (en) Switch power supply with input under-voltage protection function
US20160274613A1 (en) Interface supply circuit
CN102937829A (en) Energy-saving management circuit
EP3297166A1 (en) Method and apparatus for achieving switching
CN203535416U (en) A digital signal processing chip power supply circuit

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant