Switching control circuit based on USB interface
Technical Field
The present disclosure relates to electronic circuits, and particularly to a switching control circuit based on a USB interface.
Background
With the development of the internet of things, the requirements of various terminal products on modems with different functions are more and more diversified, and accordingly various modems are also in the coming endlessly. The modems that we often see are NB-IOT, 2G Modem, 3G Modem, 4G LTE Modem, and the current 5G Modem, etc. Besides its own RF interface, these modems also have an external interface, and these interfaces are also abundant. The peripheral equipment comprises an SPI interface, an IIC interface, a PCM interface, a USIM interface, an ETHERNET interface and the like of the peripheral equipment of the module, and also comprises a UART interface, a USB interface, a PCIE interface and the like which are communicated with the main controller.
However, the development expectation of the internet of things brings about an increase in the data transmission and processing amount of the Modem. However, in the interface between the Modem and the host controller, the data amount of the UART interface is limited, and although the data rate of the PCIE interface is high, hot plug is not supported, so that once the host controller and the Modem fail to communicate, the reset of the whole system is required, and the demand of PCIE for LAYOUT is also high. The USB interface supports hot plug and has relatively high transmission rate, especially USB3.0 interface. However, the USB interface is more used for software downloading and comprehensive testing and calibration of the Modem in the use of the general Modem. Therefore, the current Modem has a problem in use: the communication interface between the Modem and the main controller is good for use, but rarely used. At present, UARTs in communication interfaces of the Modem and the main controller are most used.
SUMMERY OF THE UTILITY MODEL
The switching control circuit based on the USB interface realizes rapid protection of overcurrent short circuit and overvoltage short circuit through a discrete circuit, and parameters of protection current and protection voltage can be configured in a hardware mode, so that the requirements of different devices are met.
The technical scheme adopted for solving the technical problems is as follows:
according to an aspect herein, there is provided a switching control circuit based on a USB interface, including: control circuit, switching circuit, wherein, control circuit includes: the transistor VD1, the transistor VD2, the resistor R1, the resistor R2, the resistor R3 and the capacitor C1; the state of the USB interface is detected by controlling the on-off of the triode in the circuit, and the switching of the functions of the USB interface is realized through the switching circuit according to different states of the USB interface.
Optionally, in the control circuit, a gate of the transistor VD1 is connected to one end of the resistor R1, one end of the capacitor C1, a gate of the transistor VD2, a cathode of the diode D2 and one end of the resistor R2, a source of the transistor VD1 is connected to the other end of the resistor R1, the other end of the capacitor C1 and a source of the transistor VD2, the other end of the resistor R2 is connected to one end of the resistor R3 and the node VD, and the other end of the resistor R3 is grounded.
Optionally, the switching circuit comprises: the switch circuit comprises a switch chip U1 and a capacitor C2, wherein a pin 1 of the switch chip U1 is connected with a node Vd, a pin 2 of the switch chip U1 is connected with a power supply terminal VCC and one end of the capacitor C2, and the other end of the capacitor C2 is grounded together with a pin 3 of the switch chip U1.
Optionally, the transistor VD1 and the transistor VD2 are both PMOS transistors.
Optionally, the apparatus further comprises a connection circuit, wherein the connection circuit comprises: the USB connector CON1 and the diode D1, pin 1 of the USB connector CON1 is connected with the positive pole of the diode D1, and the negative pole of the diode D1 is connected with the drain of the triode VD 2.
Optionally, when the USB interface is not connected, the voltage Vb at the positive electrode of the diode D2 is equal to 0V, at this time, the source voltage Vg of the transistor VD1 is equal to the drain voltage Va and is 3.8V, the voltage Vf at the negative electrode of the diode D2 is divided by the resistor R1, the resistor R2 and the resistor R3, so that the voltage difference between Vf and Vg is greater than the conduction voltage of the transistor VD1 and the transistor VD2, the transistor VD1 and the transistor VD2 are turned on, and the drain Vc power supply of the transistor VD2 is equal to Va equal to 3.8V, meanwhile, the voltage VD at the connection between the resistor R2 and the resistor R3 is low, the switching chip U1 defaults to keep the mode and the USB DM/DP of the master controller connected, and at this time, the master controller may detect the insertion of the USB interface.
Optionally, when the USB interface is accessed, the voltage Vb at the positive electrode of the diode D2 is 5V, at this time, the drain voltage Vc of the transistor VD2 is 4.3V, the source voltage Vg of the transistor VD1 is 4.3V, and the drain voltage Va greater than the transistor VD1 is 3.8V, and since Vg-Vf is 0V, the transistor VD1 and the transistor VD2 are not turned on, so the drain voltage Vc of the transistor VD2 is 4.3V, and at the same time, the voltage VD at the connection between the resistor R2 and the resistor R3 is high, and the switching chip U1 switches the Modem USB DM/DP to the external USB connector.
The utility model discloses switching control circuit based on USB interface, this circuit includes: control circuit, switching circuit, wherein, control circuit includes: the transistor VD1, the transistor VD2, the resistor R1, the resistor R2, the resistor R3 and the capacitor C1; the state of the USB interface is detected by controlling the on-off of a triode in the circuit, and the switching of the functions of the USB interface is realized through the switching circuit according to different states of the USB interface; the Modem and the main controller are communicated through the USB through the hardware discrete device, and software downloading, comprehensive testing and calibration of the Modem can be realized through an external USB interface.
Drawings
Fig. 1 is a functional schematic diagram of a switching control circuit based on a USB interface according to an embodiment of the present invention.
Fig. 2 is a circuit diagram of a switching control circuit based on a USB interface according to an embodiment of the present invention;
fig. 3 is a circuit diagram of another switching control circuit based on a USB interface according to an embodiment of the present invention;
fig. 4 is a circuit diagram of another switching control circuit based on a USB interface according to an embodiment of the present invention.
The objects, features, and advantages described herein will be further explained with reference to the accompanying drawings.
Detailed Description
In order to make the technical problems, technical solutions and advantages to be solved by the present invention clearer and more obvious, the present invention is further described in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not restrictive.
Examples
As shown in fig. 1, in this embodiment, a switching control circuit based on a USB interface includes: control circuit, switching circuit, wherein, control circuit includes: the transistor VD1, the transistor VD2, the resistor R1, the resistor R2, the resistor R3 and the capacitor C1; the state of the USB interface is detected by controlling the on-off of the triode in the circuit, and the switching of the functions of the USB interface is realized through the switching circuit according to different states of the USB interface.
In this embodiment, the Modem and the master controller communicate with each other through the USB via the hardware discrete device, and the software download, comprehensive test, and calibration of the Modem can be implemented through the external USB interface.
In this embodiment, when the USB is not plugged in, the host controller can normally load the Modem device through the USB, so as to implement communication between the Modem and the host controller through the USB. When the USB is inserted, the USB interface of the Modem is switched to the external USB connector, so that software downloading, comprehensive testing and calibration of the Modem are realized. And after the Modem finishes software downloading or comprehensive testing and calibration and the external USB is unplugged, the main controller can reload Modem equipment through the USB, so that the communication between the Modem and the main controller through the USB is realized.
In this embodiment, the switching control circuit based on the USB interface is suitable for rapid development of products by common users, and has a simple implementation form and a small difficulty in software development, and compared with PCIE and ETHERNET interfaces, the hardware implementation difficulty of the USB interface is smaller, the PCB layout is simple, and certain advantages are also achieved in hardware cost. But also has certain benefits for the production and after-sale of subsequent products.
As shown in fig. 2, in the present embodiment, in the control circuit, the gate of the transistor VD1 is connected to one end of the resistor R1, one end of the capacitor C1, the gate of the transistor VD2, the cathode of the diode D2 and one end of the resistor R2, the source of the transistor VD1 is connected to the other end of the resistor R1, the other end of the capacitor C1 and the source of the transistor VD2, the other end of the resistor R2 is connected to one end of the resistor R3 and the node VD, and the other end of the resistor R3 is grounded.
As shown in fig. 3, in the present embodiment, the switching circuit includes: the switch circuit comprises a switch chip U1 and a capacitor C2, wherein a pin 1 of the switch chip U1 is connected with a node Vd, a pin 2 of the switch chip U1 is connected with a power supply terminal VCC and one end of the capacitor C2, and the other end of the capacitor C2 is grounded together with a pin 3 of the switch chip U1.
In this embodiment, the transistor VD1 and the transistor VD2 are both PMOS transistors.
As shown in fig. 4, in this embodiment, a connection circuit is further included, and the connection circuit includes: the USB connector CON1 and the diode D1, pin 1 of the USB connector CON1 is connected with the positive pole of the diode D1, and the negative pole of the diode D1 is connected with the drain of the triode VD 2.
In this embodiment, when the USB interface is not connected, the voltage Vb at the positive electrode of the diode D2 is equal to 0V, at this time, the source voltage Vg of the transistor VD1 is equal to the drain voltage Va and is 3.8V, the voltage Vf at the negative electrode of the diode D2 is divided by the resistor R1, the resistor R2 and the resistor R3, so that the voltage difference between Vf and Vg is greater than the conduction voltages of the transistor VD1 and the transistor VD2, the transistor VD1 and the transistor VD2 are turned on, and the drain power Vc of the transistor VD2 is equal to 3.8V, and at the same time, the voltage VD at the connection between the resistor R2 and the resistor R3 is low, the switching chip U1 keeps the default mode m and the USB DM/DP of the master controller connected, and at this time, the master controller can detect the insertion of the USB interface.
In this embodiment, when the USB interface is accessed, the voltage Vb at the positive electrode of the diode D2 is 5V, at this time, the drain voltage Vc of the transistor VD2 is 4.3V, the source voltage Vg of the transistor VD1 is 4.3V, and the drain voltage Va greater than the transistor VD1 is 3.8V, and since Vg-Vf is 0V, the transistor VD1 and the transistor VD2 are not conductive, so the drain voltage Vc of the transistor VD2 is 4.3V, and at the same time, the voltage VD at the connection between the resistor R2 and the resistor R3 is high, and the switching chip U1 switches the mode USB DM/DP to the external USB connector.
The preferred embodiments of the present invention have been described above with reference to the accompanying drawings, without thereby limiting the scope of the invention. Any modification, equivalent replacement and improvement made by those skilled in the art without departing from the scope and spirit of the present invention should be within the scope of the claims of the present invention.