Summary of the invention
For the deficiencies in the prior art, object of the present invention is intended to provide a kind of Multifunctional USB interface circuit that simultaneously can realize master-slave equipment conversion and charge function.
For achieving the above object, the present invention adopts following technical scheme:
A kind of Multifunctional USB interface circuit, comprises the governor circuit be positioned on electronic equipment, OTG booster circuit, USB interface identification circuit and current limliting output power supply circuit; Described OTG booster circuit is that described current limliting output circuit is powered, and the output port of power source of described current limliting output circuit is connected with the power input port of USB interface identification circuit; Described governor circuit passes through the operating state controlling current limliting output power supply circuit, to realize the identification of USB interface identification circuit to the master slave mode of electronic equipment; When electronic equipment is from equipment, USB interface identification circuit is also for being electronic equipment charging by a charging triode, and described governor circuit is also for controlling the operating state of charging triode.
Preferably, described USB interface identification circuit comprises USB3.0 interface socket, resistance R1, resistance R2, resistance R3, resistance R4, diode D1 and diode D2; The power input port of described USB3.0 interface socket is the power input port of USB interface identification circuit, first FPDP of described USB3.0 interface socket is connected with the first data group port of described governor circuit by resistance R1, second FPDP of described USB3.0 interface socket is connected with the second data group port of described governor circuit by resistance R2, the grounding ports ground connection of described USB3.0 interface socket; The ID of described USB3.0 interface socket identifies that port is connected with the positive pole of diode D1, the negative pole of described diode D1 is connected with charging triode, the ID of described USB3.0 interface socket identifies that port is connected with one end of resistance R3, the other end of described resistance R3 is by resistance R4 ground connection, the other end of described resistance R3 is also connected with the negative pole of diode D2, and the positive pole of described diode D2 is connected with the ID detection port of described governor circuit.
Preferably, described USB interface identification circuit also comprises electric capacity C1 and electric capacity C2, and the positive pole of described diode D2 is also by electric capacity C1 ground connection, and the negative pole of described diode D1 is also by electric capacity C2 ground connection.
Preferably, also comprise MINI USB charging identification circuit, described MINI USB charging identification circuit comprises MINI USB charging socket, resistance R5, resistance R6 and resistance R7; The power supply port of described MINI USB charging socket is electronic equipment charging by charging triode, first FPDP of described MINI USB charging socket is connected by resistance R5 and the IO of governor circuit port of powering, second FPDP of described MINI USB charging socket is connected with the charger identification port of governor circuit by resistance R6, and the second FPDP of described MINI USB charging socket is also by resistance R7 ground connection.
Preferably, described MINI USB charging identification circuit also comprises electric capacity C3, and the second FPDP of described MINI USB charging socket is also by electric capacity C3 ground connection.
Preferably, described current limliting output power supply circuit comprises current limiting switch, resistance R8 and resistance R9, the power input port of described current limiting switch is connected with the power output end of OTG booster circuit, the enable port of described current limiting switch is connected with the OTG power supply output control terminal mouth of governor circuit, the grounding ports ground connection of described current limiting switch, the enable port of described current limiting switch is connected with the grounding ports of current limiting switch by resistance R9, the current limliting port of described current limiting switch is connected with the grounding ports of current limiting switch by resistance R8, the output port of power source of described current limiting switch is the output port of power source of current limliting output power supply circuit.
Preferably, described current limliting output power supply circuit also comprises electric capacity C4 and electric capacity C5, and the power input port of described current limiting switch is by electric capacity C4 ground connection, and the output port of power source of described current limiting switch is also by electric capacity C5 ground connection.
Preferably, described governor circuit is provided with a main control chip, and described OTG booster circuit is provided with an OTG boost chip.
Preferably, the model of described main control chip is MT8127 or MT8163, and the model of described boost chip is SY7088.
The present invention also comprises a kind of conversion wire rod, and change one end of wire rod into standard USB2.0 interface, described standard USB2.0 interface is for connecting external equipment; The other end of conversion wire rod is the USB interface matched with the USB interface identification circuit in claim 1.
Beneficial effect of the present invention is as follows:
This Multifunctional USB interface circuit can realize master-slave equipment conversion, when it is arranged on electronic equipment, when being especially arranged on panel computer, panel computer then can read as main equipment and identify USB flash disk, can also realize being read by external computer and identifying as from equipment by conversion wire rod.Meanwhile, when it is from equipment, the main equipment also by outside charges to it.
Embodiment
Below in conjunction with accompanying drawing and embodiment, the present invention is described further:
Refer to Fig. 1, the present invention relates to a kind of Multifunctional USB interface circuit, its better embodiment comprises the governor circuit be positioned on electronic equipment, OTG booster circuit, USB interface identification circuit and current limliting output power supply circuit; OTG booster circuit is that current limliting output circuit is powered, and the output port of power source of current limliting output circuit is connected with the power input port of USB interface identification circuit; Governor circuit passes through the operating state controlling current limliting output power supply circuit, to realize the identification of USB interface identification circuit to the master slave mode of electronic equipment; When electronic equipment is from equipment, USB interface identification circuit is also for being electronic equipment charging by a charging triode, and governor circuit is also for controlling the operating state of charging triode.Wherein, governor circuit can be a main control chip U1, and OTG booster circuit can be an OTG boost chip U2.The model of main control chip U1 can be MT8127 or MT8163.The model of boost chip U2 can be SY7088.Here electronic equipment mainly comprises the panel computer etc. referring to and can do master-slave equipment.
Concrete, USB interface identification circuit comprises USB3.0 interface socket CON1, resistance R1, resistance R2, resistance R3, resistance R4, diode D1 and diode D2; The power input port 1 of USB3.0 interface socket CON1 is the power input port of USB interface identification circuit, first FPDP 2 of USB3.0 interface socket CON1 is connected with the first data group port 2 of main control chip U1 by resistance R1, second FPDP 3 of USB3.0 interface socket CON1 is connected with the second data group port 3 of main control chip U1 by resistance R2, grounding ports 4 ground connection of USB3.0 interface socket CON1; The ID of USB3.0 interface socket CON1 identifies that port 7 is connected with the positive pole 1 of diode D1, the negative pole 2 of diode D1 is connected with charging triode, the ID of USB3.0 interface socket CON1 identifies that port 7 is connected with one end of resistance R3, the other end of resistance R3 is by resistance R4 ground connection, the other end of resistance R3 is also connected with the negative pole 2 of diode D2, and the positive pole 1 of diode D2 is connected with the ID detection port 6 of main control chip U1.Concrete, the model of diode D1 can be 1N5819.The model of diode D2 can be 1N4148.
Preferably, USB interface identification circuit also comprises electric capacity C1 and electric capacity C2, and the positive pole 1 of diode D2 is also by electric capacity C1 ground connection, and the negative pole 2 of diode D1 is also by electric capacity C2 ground connection.
Wherein, as shown in Figure 2, the present invention also comprises a kind of conversion wire rod, the one end of changing wire rod into standard USB2.0 interface 1, standard USB2.0 interface for connecting external equipment; The other end of conversion wire rod is the USB interface matched with USB interface identification circuit.
Further, the one end of changing wire rod can be standard USB2.0 interface 1, and the other end is that the USB interface that matches with USB interface identification circuit can for the USB3.0 interface 2 after improving.In USB3.0 interface 2 after improvement, in the corresponding USB3.0 of connection interface socket CON1, power input port 1 and ID identify that two pins of port 7 are phase short circuits.
When USB3.0 interface socket CON1 is used for changing wire rod to be connected with external equipment by access, USB3.0 interface 2 after improvement is connected with the USB3.0 interface socket CON1 in USB interface identification circuit, standard USB2.0 interface 1 is for connecting external equipment, now this electronic equipment is then defaulted as from equipment by main control chip, so that external equipment reads this electronic equipment.Meanwhile, USB3.0 interface socket also by charging triode be electronic equipment charging, now main control chip can control charge volume size is now 500mA.If the standard USB2.0 interface 1 of conversion wire rod connects is adapter, USB3.0 interface socket is also electronic equipment charging by charging triode, and now main control chip can control charge volume size now is also 500mA.When USB3.0 interface socket CON1 is for reading USB keyboard, USB mouse and USB flash disk etc., then main control chip gives tacit consent to it for main equipment.
Meanwhile, the high frequency E MC index exceeding standard of resistance R1 and resistance R2 for preventing USB3.0 interface socket CON1 and main control chip U1 from carrying out in data transmission procedure.Resistance R3 and resistance R4 can play dividing potential drop effect, and the ID by USB3.0 interface socket CON1 identifies that the level translation of port 7 is main control chip U1 acceptable level.Diode D2 is that an ID identifies diode, and its function allows main control chip U1 externally identify level.Electric capacity C1 is that ID identification is prevented gushing electric capacity, with timely protective circuit.Diode D1 is charging diode, and its effect guides the ID of USB3.0 interface socket CON1 to identify port 7 pairs of electronic equipment chargings.
Multifunctional USB interface circuit in the present invention also comprises MINI USB charging identification circuit, and MINI USB charging identification circuit comprises MINI USB charging socket CON2, resistance R5, resistance R6 and resistance R7; The power supply port one of MINI USB charging socket CON2 is electronic equipment charging by charging triode, first FPDP 2 of MINI USB charging socket CON2 is connected by resistance R5 and the IO of main control chip U1 port 5 of powering, second FPDP 3 of MINI USB charging socket CON2 is connected with the charger identification port 4 of main control chip U1 by resistance R6, and second FPDP 3 of MINI USB charging socket CON2 is also by resistance R7 ground connection.Preferably, MINI USB charging identification circuit also comprises electric capacity C3, and second FPDP 3 of MINI USB charging socket CON2 is also by electric capacity C3 ground connection.
Wherein, MINI USB charging socket CON2 for connecting external charging equipment, and is electronic equipment charging by charging triode.Here external charging equipment can be adapter, is also external computer.When MINI USB charging socket CON2 is that when being electronic equipment charging by Payload attach fitting, the size of its charging current can 1A-1.5A.When MINI USB charging socket CON2 is that when being electronic equipment charging by connection external computer, the size of its charging current then can be restricted to 500mA, in case draw the USB delivery outlet of dead external computer.Meanwhile, diode D1 can also identify port 7 to the ID of USB3.0 interface socket CON1 by anti-electric current of filling with when MINI USB charging socket CON2 charges to electronic equipment.
Current limliting output power supply circuit can also be comprise current limiting switch U3, resistance R8 and resistance R9, the power input port 5 of current limiting switch U3 is connected with the power output end 1 of OTG boost chip U2, the enable port 4 of current limiting switch U3 is connected with the OTG power supply output control terminal mouth 1 of main control chip U1, grounding ports 2 ground connection of current limiting switch U3, the enable port 4 of current limiting switch U3 is connected with the grounding ports 2 of current limiting switch U3 by resistance R9, the current limliting port 3 of current limiting switch U3 is connected with the grounding ports 2 of current limiting switch U3 by resistance R8, the output port of power source 1 of current limiting switch U3 is the output port of power source of current limliting output power supply circuit.Preferably, current limliting output power supply circuit also comprises electric capacity C4 and electric capacity C5, and the power input port 5 of current limiting switch U3 is by electric capacity C4 ground connection, and the output port of power source 1 of current limiting switch U3 is also by electric capacity C5 ground connection.Preferably, the model of current limiting switch can be SY6280.Wherein, resistance R8 is for limiting the cut-off current of current limliting output.Electric capacity C4 and electric capacity C5 all its filter actions.
To sum up, as shown in Figure 1, specific works principle of the present invention is as follows:
Electronic equipment is connected with external equipment by conversion wire rod.This one end of changing wire rod can be USB2.0 interface, the other end can be USB3.0 interface, wherein USB3.0 interface is the USB3.0 interface after improving, and the USB3.0 interface after improvement is for being connected to USB3.0 interface socket CON1, and USB2.0 interface is for being connected to external equipment.Now, power input port 1 and the ID of USB3.0 interface socket CON1 of USB3.0 interface socket CON1 identify port 7 phase short circuit, and namely now A point and G point are subject to external equipment and power, and voltage can be 5V.The 5V voltage of corresponding A point is after resistance R3 and resistance R4 dividing potential drop, the voltage of B point can be 1.8V, now the ID detection port 6 of main control chip U1 detects that B point voltage is high level, the level of the OTG power supply output control terminal mouth 1 of main control chip UI is dragged down subsequently, thus the level of the enable port 4 of current limiting switch U3 is dragged down, now current limiting switch U3 disconnects.Main control chip U1 then assert that electronic equipment connects external equipment, and is in the state read by computer, and namely this electronic equipment enters from equipment state.Now, external equipment is communicated with the main control chip U1 of electronic equipment by first FPDP 2 of USB3.0 interface socket CON1 and the second data group port 3.Meanwhile, the ID of USB3.0 interface socket CON1 identifies that port 7 can also be electronic equipment charging by diode D1 and charging triode successively, and main control chip U1 controls the size of current that charging triode is electronic equipment charging simultaneously, is generally 500mA.
When pull out turn round thread-changing material time, with ID, power input port 1 on USB3.0 interface socket CON1 identifies that port 7 disconnects, the ID of USB3.0 interface socket CON1 identify port 7 due to resistance R4 drop-down after become low level, namely A point is low level, then now the ID detection port 6 of main control chip U1 can detect that B point is also low level, therefore the OTG power supply output control terminal mouth 1 of main control chip U1 exports high level, so current limiting switch U3 is opened, power input port 1 on USB3.0 interface socket CON1 obtains the power output end 1 of current limiting switch U3 through resistance R8 current limliting, the filtered 5V voltage of electric capacity C5.Now, main control chip U1 then assert that electronic equipment is main equipment, and by first FPDP 2 of USB3.0 interface socket CON1 and the second data group port 3 and communicating from equipment of being access in.During this time, if plug USB1.0,2.0 or 3.0 the equipment such as such as keyboard, mouse, USB flash disk, electronic equipment then will read them as main equipment, to realize the function of main equipment.
When electronic equipment utilizes MINI USB charging socket CON2 to charge, because F point connects is that the IO of main control chip U1 powers port 5, therefore the voltage of F point is 5V.When MINI USB charging socket CON2 receives external computer by MINI USB plug conversion line, first FPDP 2 of MINI USB charging socket CON2 and the non-short circuit of the second FPDP 3, then now the charger identification port 4 of main control chip U1 recognizes E point for low level, so time by external computer be electronic equipment charge, namely the power supply port one of MINI USB charging socket CON2 is electronic equipment charging by charging triode, and charging current is now 500mA.If when MINI USB charging socket CON2 receives adapter by MINI USB plug conversion line, and when connecting external power source by adapter, first FPDP 2 and second FPDP 3 short circuit of MINI USB charging socket CON2, then now the charger identification port 4 of main control chip U1 recognizes E point is high level, now then by external power source by adapter be electronic equipment charge, charging current now can be 1A-1.5A.
For a person skilled in the art, according to technical scheme described above and design, other various corresponding change and distortion can be made, and all these change and distortion all should belong within the protection range of the claims in the present invention.