Circuit and method for realizing signal switching through single micro USB interface
By designing a circuit with a single Micro USB interface, utilizing a Micro USB protection module and a signal source expansion module, and combining voltage, crystal oscillator, or voltage divider resistors to identify the signal source, the switching of multiple signal sources is realized, solving the problems of area and width occupied in existing technologies, and achieving efficient utilization and management of the circuit board.
Patent Information
- Application Number
- CN202211393359.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-08
- Publication Date
- 2026-02-06
- Estimated Expiration
- 2042-11-08
AI Technical Summary
Existing Micro USB interfaces require multiple connectors when multiple signal sources are needed, which occupies circuit board area and increases circuit board width, and lacks an effective signal switching solution.
Design a circuit with a single Micro USB interface, including a Micro USB protection module and a signal source expansion module. Through the combination of a Micro USB first connector and a second connector, an MCU and a switching unit, the signal source is identified by voltage, crystal oscillator or voltage divider resistor, and the signal source is switched.
This design enables the connection of signal sources from different devices to the same Micro USB interface, saving circuit board length and width, and reserving a path for backend management. The design principle is reliable and the structure is simple.
Smart Images

Figure CN115687204B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of USB interface, and particularly relates to a circuit and method for realizing signal switching of a single Micro USB interface. BACKGROUND
[0002] USB is the abbreviation of Universal Serial Bus, that is, a universal serial bus.
[0003] MCU is the abbreviation of Micro Controller Unit, that is, a micro controller unit.
[0004] Mini USB, also known as mini USB, is a USB interface standard. Standard USB, Mini USB and Micro USB are the most common USB interfaces. Compared with the standard USB, the Mini USB is smaller and is suitable for small electronic devices such as mobile devices.
[0005] Micro USB is a portable version of the USB 2.0 standard, which is smaller than the Mini USB interface used by some mobile phones. Micro USB is the next generation specification of Mini USB.
[0006] The existing Micro USB interface adopts a connector to connect a signal source. If multiple signal sources are needed, multiple connectors need to be used. Multiple connectors will inevitably occupy more circuit board area, and when the circuit board width is sufficient to place multiple connectors, the circuit board width also needs to be increased.
[0007] This is the deficiency of the prior art. Therefore, it is necessary to provide a circuit and method for realizing signal switching of a single Micro USB interface to solve the above-mentioned defects in the prior art. SUMMARY
[0008] In view of the above-mentioned defects in the prior art that the existing Micro USB interface adopts a single connector to connect a signal source, and multiple connectors need to be placed when multiple signal sources are needed, which not only occupies the circuit board area but also needs to increase the circuit board width, the application provides a circuit and method for realizing signal switching of a single Micro USB interface to solve the above-mentioned technical problems.
[0009] In the first aspect, the application provides a circuit for realizing signal switching of a single Micro USB interface, which comprises a Micro USB protection module and a Micro USB signal source expansion module.
[0010] The Micro USB protection module comprises a Micro USB first connector and a signal source distinguishing unit, and the Micro USB first connector is connected with the signal source distinguishing unit;
[0011] The Micro USB signal source expansion module comprises a Micro USB second connector, an MCU and a switch unit;
[0012] The Micro USB second connector is connected with the MCU and the switch unit, the MCU is connected with the switch unit through a signal source identification pin, and the switch unit is connected with a plurality of signal sources;
[0013] The Micro USB first connector is plugged with the Micro USB second connector;
[0014] The signal source distinguishing unit sends a signal source distinguishing signal to the Micro USB second connector through the Micro USB first connector;
[0015] The MCU identifies the signal source distinguishing signal from the Micro USB second connector, and then sends a signal source identification signal to the switch unit to identify the corresponding signal source.
[0016] Further, the Micro USB first connector and the Micro USB second connector are both provided with a voltage pin, a ground pin, a signal source distinguishing pin, a positive data pin and a negative data pin;
[0017] The voltage pin of the Micro USB first connector is connected with the voltage pin of the Micro USB second connector, the ground pin of the Micro USB first connector is connected with the ground pin of the Micro USB second connector, the signal source distinguishing pin of the Micro USB first connector is connected with the signal source distinguishing pin of the Micro USB second connector, the first data pin of the Micro USB first connector is connected with the first data pin of the Micro USB second connector, and the second data pin of the Micro USB first connector is connected with the second data pin of the Micro USB second connector;
[0018] The first data pin and the second data pin of the Micro USB second connector are both connected with the switch unit.
[0019] Further, the MCU is provided with an analog-digital conversion pin, a first identification pin and a second identification pin;
[0020] The signal source distinguishing pin of the Micro USB first connector is connected with the signal source distinguishing unit, and the signal source distinguishing pin of the Micro USB second connector is connected with the analog-digital conversion pin of the MCU;
[0021] The first identification pin and the second identification pin of the MCU are connected with the switch unit.
[0022] Further, the signal source includes a USB signal source, a UART signal source and an I2C signal source.
[0023] The USB signal source includes a positive data terminal and a negative data terminal, and the positive data terminal and the negative data terminal are connected with the switch unit.
[0024] The UART signal source includes a transmitting data terminal and a receiving data terminal, and the transmitting data terminal and the receiving data terminal are connected with the switch unit.
[0025] The I2C signal source includes a data terminal and a clock terminal, and the data terminal and the clock terminal are connected with the switch unit.
[0026] Further, the signal source distinguishing unit includes a first resistor and a second resistor.
[0027] The first end of the first resistor is connected with a voltage source, the second end of the second resistor is grounded, the second end of the first resistor is connected with the first end of the second resistor and connected with the Micro USB first connector.
[0028] The MCU obtains the voltage division value of the voltage source by the first resistor and the second resistor through the Micro USB second connector, so as to control the switch unit to select the corresponding signal source through the signal source identification pin.
[0029] Further, the signal source distinguishing unit includes a crystal oscillator.
[0030] The first end of the crystal oscillator is connected with a voltage source, the second end of the crystal oscillator is connected with the Micro USB first connector, and the third end of the crystal oscillator is grounded.
[0031] The MCU obtains the frequency value of the crystal oscillator through the Micro USB second connector, so as to control the switch unit to select the corresponding signal source through the signal source identification pin.
[0032] In a second aspect, the present application provides a signal switching method based on the single Micro USB interface of the first aspect, including the following steps:
[0033] S1. Setting electronic components for distinguishing signal sources in the signal source distinguishing unit of the Micro USB protection module.
[0034] S2. The MCU obtains the function value of the electronic components through the plugging of the Micro USB first connector and the Micro USB second connector, and compares the function value with the pre-stored signal source types in the MCU to determine the target signal source type.
[0035] S3. MCU controls the switch unit to select the signal source of the same kind as the target signal source through the first identification pin and the second identification pin.
[0036] Further, in step S1, a voltage source is arranged in the signal source distinguishing unit of the Micro USB protection module, and a voltage dividing resistor is arranged to divide the voltage of the voltage source.
[0037] In step S2, the MCU acquires the resistance value of the voltage dividing resistor and the voltage value of the voltage source, and compares them with the threshold voltage values stored in the MCU in advance to determine the kind of the target signal source.
[0038] Further, in step S1, a crystal oscillator is arranged in the signal source distinguishing unit of the Micro USB protection module.
[0039] In step S2, the MCU acquires the frequency value of the crystal oscillator, and compares it with the frequency ranges stored in the MCU in advance to determine the kind of the target signal source.
[0040] Further, in step S1, the electronic component is also used for user customization to reserve the interface of the Micro USB interface for background management.
[0041] The present application has the advantages of
[0042] The circuit and method for signal switching of the single Micro USB interface provided by the present application realize that the same Micro USB interface can be used as the signal source of different devices, save the length and width of the circuit board, and reserve the path for background management.
[0043] In addition, the present application has reliable design principle, simple structure, and very wide application prospect.
[0044] Therefore, compared with the prior art, the present application has outstanding and substantial characteristics and significant progress, and the beneficial effects of the implementation are also obvious. BRIEF DESCRIPTION OF DRAWINGS
[0045] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed to be used in the embodiments or prior art description will be briefly introduced as follows, and obviously, other drawings can also be obtained by those skilled in the art without creative labor on the premise of the drawings.
[0046] Figure 1 is the connection schematic diagram of the circuit embodiment 1 for signal switching of the single Micro USB interface of the present application.
[0047] Figure 2is the connection schematic diagram of the circuit embodiment 3 of the single Micro USB interface for realizing signal switching of the application.
[0048] Figure 3 is the connection schematic diagram of the circuit embodiment 4 of the single Micro USB interface for realizing signal switching of the application.
[0049] Figure 4 is the method flow schematic diagram of the single Micro USB interface for realizing signal switching of the application.
[0050] Figure 5 is the corresponding table of the voltage dividing resistor and the signal source in the method embodiment 6 of the single Micro USB interface for realizing signal switching of the application.
[0051] Figure 6 is the corresponding table of the crystal oscillator and the signal source in the method embodiment 7 of the single Micro USB interface for realizing signal switching of the application.
[0052] In the figure, 1-Micro USB protection module; 1.1-Micro USB first connector; 1.2-signal source distinguishing unit; 2-Micro USB signal source expansion module; 2.1-Micro USB second connector; 2.2-MCU; 2.3-switching unit; 2.4-signal source; 2.4.1-USB signal source; 2.4.2-UART signal source; 2.4.3-I2C signal source; 2.4.4-; VCC-voltage pin; GND-ground pin; D1-first data pin; D2-second data pin; ADC-analog-digital conversion pin; P1-first identification pin; P2-second identification pin; D+-positive data end; D— negative data end; TX-transmitting data end; RX-receiving data end; DATA-data end; CLK-clock end; ID-resistance distinguishing pin; FID-crystal oscillator distinguishing pin; R1-first resistance; R2-second resistance; X1-crystal oscillator; P5V-voltage source. DETAILED DESCRIPTION
[0053] In order to make the person in the art better understand the technical solutions in the application, the technical solutions in the embodiments of the application will be described clearly and completely below in combination with the drawings in the embodiments of the application. Obviously, the described embodiments are only part of the embodiments of the application, rather than all the embodiments. Based on the embodiments in the application, all the other embodiments obtained by the person in the art without creative labor should belong to the protection scope of the application.
[0054] Embodiment 1:
[0055] As Figure 1As shown in the figure, the present application provides a single Micro USB interface to realize signal switching circuit, including Micro USB protection module 1 and Micro USB signal source expansion module 2;
[0056] Micro USB protection module 1 includes Micro USB first connector 1.1 and signal source distinguishing unit 1.2, Micro USB first connector 1.1 is connected with signal source distinguishing unit 1.2;
[0057] Micro USB signal source expansion module 2 includes Micro USB second connector 2.1, MCU 2.2 and switch unit 2.3;
[0058] Micro USB second connector 2.1 is connected with MCU 2.2 and switch unit 2.3, MCU 2.2 is connected with switch unit 2.3 through signal source identification pin, and switch unit 2.3 is connected with a plurality of signal sources 2.4;
[0059] Micro USB first connector 1.1 is plugged with Micro USB second connector 2.1;
[0060] Signal source distinguishing unit 1.2 sends signal source distinguishing signal to Micro USB second connector 2.1 through Micro USB first connector 1.1;
[0061] MCU 2.2 identifies signal source distinguishing signal from Micro USB second connector 2.1, and then sends signal source identification signal to switch unit 2.3, to identify corresponding signal source 2.4.
[0062] The single Micro USB interface to realize signal switching circuit provided by the present application realizes that the same Micro USB interface is used as the signal source of different devices, saves the length and width of the circuit board, and can reserve a path for background management.
[0063] Embodiment 2:
[0064] As Figure 1 As shown in the figure, the present application provides a single Micro USB interface to realize signal switching circuit, including Micro USB protection module 1 and Micro USB signal source expansion module 2;
[0065] Micro USB protection module 1 includes Micro USB first connector 1.1 and signal source distinguishing unit 1.2, Micro USB first connector 1.1 is connected with signal source distinguishing unit 1.2;
[0066] The Micro USB signal source extension module 2 comprises a Micro USB second connector 2.1, an MCU 2.2 and a switch unit 2.3;
[0067] The Micro USB second connector 2.1 is connected with the MCU 2.2 and the switch unit 2.3, the MCU 2.2 is connected with the switch unit 2.3 through a signal source identification pin, and the switch unit 2.3 is connected with a plurality of signal sources 2.4;
[0068] The Micro USB first connector 1.1 is plugged with the Micro USB second connector 2.1;
[0069] The signal source distinguishing unit 1.2 sends a signal source distinguishing signal to the Micro USB second connector 2.1 through the Micro USB first connector 1.1;
[0070] The MCU 2.2 identifies the signal source distinguishing signal from the Micro USB second connector 2.1, and then sends a signal source identification signal to the switch unit 2.3 to identify the corresponding signal source 2.4;
[0071] The Micro USB first connector 1.1 and the Micro USB second connector 2.1 are both provided with a voltage pin VCC, a ground pin GND, a signal source distinguishing pin, a first data pin D1 and a second data pin D2;
[0072] The voltage pin VCC of the Micro USB first connector 1.1 is connected with the voltage pin VCC of the Micro USB second connector 2.1, the ground pin GND of the Micro USB first connector 1.1 is connected with the ground pin GND of the Micro USB second connector 2.1, the signal source distinguishing pin of the Micro USB first connector 1.1 is connected with the signal source distinguishing pin of the Micro USB second connector 2.1, the first data pin D1 of the Micro USB first connector 1.1 is connected with the first data pin D1 of the Micro USB second connector 2.1, and the second data pin D2 of the Micro USB first connector 1.1 is connected with the second data pin D2 of the Micro USB second connector 2.1;
[0073] The first data pin D1 and the second data pin D2 of the Micro USB second connector 2.1 are both connected with the switch unit 2.3;
[0074] The MCU 2.2 is provided with an analog-to-digital conversion pin ADC, a first identification pin P1 and a second identification pin P2;
[0075] The signal source distinguishing pin of the Micro USB first connector 1.1 is connected with the signal source distinguishing unit 1.2, and the signal source distinguishing pin of the Micro USB second connector 2.1 is connected with the analog-digital conversion pin ADC of the MCU 2.2;
[0076] The first identification pin P1 and the second identification pin P2 of the MCU 2.2 are connected with the switch unit 2.3;
[0077] The signal source 2.4 includes a USB signal source 2.4.1, a UART signal source 2.4.2 and an I2C signal source 2.4.3;
[0078] The USB signal source 2.4.1 includes a positive data end D+ and a negative data end D-, and the positive data end D+ and the negative data end D- are connected with the switch unit 2.3;
[0079] The UART signal source 2.4.3 includes a transmitting data end TX and a receiving data end RX, and the transmitting data end TX and the receiving data end RX are connected with the switch unit 2.3;
[0080] The I2C signal source includes a data end DATA and a clock end CLK, and the data end DATA and the clock end CLK are connected with the switch unit 2.3.
[0081] The circuit for realizing signal switching of a single Micro USB interface provided by the application realizes that the same Micro USB interface is used as the signal source of different devices, different signal sources are distinguished by different voltage dividing resistors, the length and width of the circuit board are saved, and a path is reserved for background management.
[0082] Embodiment 3:
[0083] As shown in Figure 1 and Figure 2 The application provides a circuit for realizing signal switching of a single Micro USB interface, which comprises a Micro USB protection module 1 and a Micro USB signal source expansion module 2.
[0084] The Micro USB protection module 1 comprises a Micro USB first connector 1.1 and a signal source distinguishing unit 1.2, and the Micro USB first connector 1.1 is connected with the signal source distinguishing unit 1.2;
[0085] The Micro USB signal source expansion module 2 comprises a Micro USB second connector 2.1, a MCU 2.2 and a switch unit 2.3;
[0086] The Micro USB second connector 2.1 is connected to the MCU 2.2 and the switching unit 2.3. The MCU 2.2 is connected to the switching unit 2.3 through the signal source identification pin. The switching unit 2.3 is connected to several signal sources 2.4.
[0087] The Micro USB first connector 1.1 and the Micro USB second connector 2.1 are plugged in;
[0088] The signal source differentiation unit 1.2 sends the signal source differentiation signal to the Micro USB second connector 2.1 via the Micro USB first connector 1.1;
[0089] The MCU 2.2 identifies the signal source from the Micro USB second connector 2.1, distinguishes the signal, and then sends a signal source identification signal to the switching unit 2.3 to identify the corresponding signal source 2.4;
[0090] Both the Micro USB first connector 1.1 and the Micro USB second connector 2.1 are provided with a voltage pin VCC, a ground pin GND, a signal source differentiation pin, a first data pin D1, and a second data pin D2; the signal source differentiation pin uses a resistor to differentiate the pin ID.
[0091] The voltage pins VCC of Micro USB first connector 1.1 and Micro USB second connector 2.1 are connected together; the ground pins GND of Micro USB first connector 1.1 and Micro USB second connector 2.1 are connected together; the signal source differentiation pins of Micro USB first connector 1.1 and Micro USB second connector 2.1 are connected together; the first data pin D1 of Micro USB first connector 1.1 and Micro USB second connector 2.1 is connected together; and the second data pin D2 of Micro USB first connector 1.1 and Micro USB second connector 2.1 is connected together.
[0092] The first data pin D1 and the second data pin D2 of the Micro USB second connector 2.1 are both connected to the switching unit 2.3;
[0093] The MCU 2.2 is equipped with an analog-to-digital conversion pin (ADC), a first identification pin (P1), and a second identification pin (P2).
[0094] The signal source differentiation pin of the Micro USB first connector 1.1 is connected to the signal source differentiation unit 1.2, and the signal source differentiation pin of the Micro USB second connector 2.1 is connected to the analog-to-digital converter (ADC) pin of the MCU 2.2; the resistor differentiation pin ID of the Micro USB first connector 1.1 is connected to the signal source differentiation unit 1.2, and the resistor differentiation pin ID of the Micro USB second connector 2.1 is connected to the analog-to-digital converter (ADC) pin of the MCU 2.2.
[0095] The first identification pin P1 and the second identification pin P2 of MCU 2.2 are both connected to the switching unit 2.3;
[0096] Signal sources 2.4 include USB signal source 2.4.1, UART signal source 2.4.2, and I2C signal source 2.4.3;
[0097] The USB signal source 2.4.1 includes a positive data terminal D+ and a negative data terminal D-, both of which are connected to the switching unit 2.3.
[0098] The UART signal source 2.4.2 includes a transmit data terminal TX and a receive data terminal RX, both of which are connected to the switching unit 2.3;
[0099] The I2C signal source 2.4.3 includes a data terminal DATA and a clock terminal CLK, both of which are connected to the switching unit 2.3.
[0100] The signal source differentiation unit includes a first resistor R1 and a second resistor R2;
[0101] The first resistor R1 is connected to a voltage source P5V at its first end, the second resistor R2 is grounded at its second end, the second end of the first resistor R1 is connected to the first end of the second resistor R2, and is connected to the first connector 1.1 of the Micro USB.
[0102] The MCU 2.2 obtains the voltage division value of the first resistor R1 and the second resistor R2 to the voltage source P5V through the Micro USB second connector 2.1, and then controls the switching unit 2.3 to select the corresponding signal source 2.4 through the first identification pin P1 and the second identification pin P2.
[0103] The circuit provided by this invention enables signal switching via a single Micro USB interface, allowing the same Micro USB interface to be used as a signal source for different devices. Different signal sources are distinguished by different voltage divider resistor values, saving the length and width of the circuit board and reserving a path for backend management.
[0104] Example 4:
[0105] likeFigure 1 and Figure 3 As shown in the drawings, the application provides a circuit for realizing signal switching through a single Micro USB interface, which comprises a Micro USB protection module 1 and a Micro USB signal source extension module 2.
[0106] The Micro USB protection module 1 comprises a Micro USB first connector 1.1 and a signal source distinguishing unit 1.2, and the Micro USB first connector 1.1 is connected with the signal source distinguishing unit 1.2.
[0107] The Micro USB signal source extension module 2 comprises a Micro USB second connector 2.1, an MCU 2.2 and a switch unit 2.3.
[0108] The Micro USB second connector 2.1 is connected with the MCU 2.2 and the switch unit 2.3, the MCU 2.2 is connected with the switch unit 2.3 through a signal source identification pin, and the switch unit 2.3 is connected with a plurality of signal sources 2.4.
[0109] The Micro USB first connector 1.1 is plugged with the Micro USB second connector 2.1.
[0110] The signal source distinguishing unit 1.2 sends a signal source distinguishing signal to the Micro USB second connector 2.1 through the Micro USB first connector 1.1.
[0111] The MCU 2.2 identifies the signal source distinguishing signal from the Micro USB second connector 2.1, and then sends a signal source identification signal to the switch unit 2.3 to identify the corresponding signal source 2.4.
[0112] The Micro USB first connector 1.1 and the Micro USB second connector 2.1 are both provided with a voltage pin VCC, a ground pin GND, a signal source distinguishing pin, a first data pin D1 and a second data pin D2, and the signal source distinguishing pin is a crystal distinguishing pin FID.
[0113] The voltage pin VCC of the Micro USB first connector 1.1 and the Micro USB second connector 2.1 is connected, the ground pin GND of the Micro USB first connector 1.1 and the Micro USB second connector 2.1 is connected, the signal source distinguishing pin of the Micro USB first connector 1.1 and the Micro USB second connector 2.1 is connected, the first data pin D1 of the Micro USB first connector 1.1 and the Micro USB second connector 2.1 is connected, and the second data pin D2 of the Micro USB first connector 1.1 and the Micro USB second connector 2.1 is connected;
[0114] The first data pin D1 and the second data pin D2 of the Micro USB second connector 2.1 are connected with the switch unit 2.3;
[0115] The MCU 2.2 is provided with an analog-digital conversion pin ADC, a first identification pin P1 and a second identification pin P2;
[0116] The signal source distinguishing pin of the Micro USB first connector 1.1 is connected with the signal source distinguishing unit 1.2, and the signal source distinguishing pin of the Micro USB second connector 2.1 is connected with the analog-digital conversion pin ADC of the MCU 2.2; the frequency distinguishing pin FID of the Micro USB first connector 1.1 is connected with the signal source distinguishing unit 1.2, and the frequency distinguishing pin FID of the Micro USB second connector 2.1 is connected with the analog-digital conversion pin ADC of the MCU 2.2;
[0117] The first identification pin P1 and the second identification pin P2 of the MCU 2.2 are connected with the switch unit 2.3;
[0118] The signal source 2.4 includes a USB signal source 2.4.1, a UART signal source 2.4.2 and an I2C signal source 2.4.3;
[0119] The USB signal source 2.4.1 includes a positive data end D+ and a negative data end D-, and the positive data end D+ and the negative data end D- are connected with the switch unit 2.3;
[0120] The UART signal source 2.4.2 includes a transmitting data end TX and a receiving data end RX, and the transmitting data end TX and the receiving data end RX are connected with the switch unit 2.3;
[0121] The I2C signal source 2.4.3 includes a data end DATA and a clock end CLK, and the data end DATA and the clock end CLK are connected with the switch unit 2.3;
[0122] The signal source distinguishing unit includes a frequency crystal X1;
[0123] The first end of the crystal oscillator X1 is connected with a voltage source P5V, the second end of the crystal oscillator X1 is connected with the first Micro USB connector 1.1, and the third end of the crystal oscillator X1 is grounded.
[0124] The MCU 2.2 obtains the frequency value of the crystal oscillator X1 through the second Micro USB connector 2.2, so as to control the switch unit 2.3 to select the corresponding signal source 2.4 through the first identification pin P1 and the second identification pin P2.
[0125] The circuit for realizing signal switching of the single Micro USB interface provided by the application realizes that the same Micro USB interface is used as the signal source of different devices, different signal sources are distinguished through different frequency values of the crystal oscillator, the length and width of the circuit board are saved, and a path can be reserved for background management.
[0126] Embodiment 5
[0127] As shown in the Figure 4 application, a method for realizing signal switching of the single Micro USB interface based on the above-mentioned embodiments 1-4 is provided, which comprises the following steps:
[0128] S1. Electronic components for distinguishing signal sources are arranged in the signal source distinguishing unit of the Micro USB protection module;
[0129] S2. The MCU obtains the function value of the electronic components through the plugging of the first Micro USB connector and the second Micro USB connector, and compares the function value with the pre-stored signal source types in the MCU to determine the target signal source type;
[0130] S3. The MCU controls the switch unit to select the signal source of the same type as the target signal source type through the first identification pin and the second identification pin.
[0131] Embodiment 6
[0132] As shown in the Figure 4 application, a method for realizing signal switching of the single Micro USB interface based on the above-mentioned embodiments 1-4 is provided, which comprises the following steps:
[0133] S1. Electronic components for distinguishing signal sources are arranged in the signal source distinguishing unit of the Micro USB protection module; a voltage source is arranged in the signal source distinguishing unit of the Micro USB protection module, and a voltage dividing resistor is arranged to divide the voltage of the voltage source;
[0134] S2. MCU obtains the function value of the electronic component through the plugging of the Micro USB first connector and the Micro USB second connector, and compares it with the pre-stored signal source type in the MCU to determine the target signal source type; the function value of the electronic component here refers to the resistance value of the resistor; the MCU obtains the resistance value of the voltage dividing resistor and the voltage value of the voltage source, and compares them with the pre-stored threshold voltage value in the MCU to determine the target signal source type;
[0135] S3. MCU controls the switch unit to select the signal source of the same type as the target signal source through the first identification pin and the second identification pin.
[0136] As shown in Figure 2 , different voltage dividing resistors are used to distinguish the signals of the interface of the Micro USB signal source expansion module inserted externally, as shown in Figure 5 , when the first resistor is 10K and the second resistor is 10K, the voltage of the resistor distinguishing pin ID is 2.5V, at this time, the MCU sets the first identification pin P1 to 0 low level and the second identification pin P2 to 0 low level to the switch unit, thereby identifying the USB signal source; when the first resistor is 10K and the second resistor is 7K, the voltage of the resistor distinguishing pin ID is 2V, at this time, the MCU sets the first identification pin P1 to 0 low level and the second identification pin P2 to 1 high level to the switch unit, thereby identifying the UART signal source; when the first resistor is 10K and the second resistor is 10K, the voltage of the resistor distinguishing pin ID is 1.66V, at this time, the MCU sets the first identification pin P1 to 1 high level and the second identification pin P2 to 0 low level to the switch unit, thereby identifying the I2C signal source; in addition, the first resistor R1 value and the second resistor R2 value can be self-defined and set, which are used for user self-definition and reserved interface for background management of the Micro USB interface.
[0137] After the switch unit receives the corresponding identification pin state (00, 01, 10), the first data pin D1 and the second data pin D2 are switched to the corresponding signal source, wherein 00 corresponds to the USB signal source, 01 corresponds to the UART signal source, and 10 corresponds to the I2C signal source, thereby realizing the switching of three different signal sources in the same Micro USB port, and achieving the connection of different external devices and the corresponding different signal source types.
[0138] The method for realizing signal switching of the single Micro USB interface provided by the application realizes that the same Micro USB interface serves as a signal source of different devices, different signal sources are distinguished by different voltage dividing resistor values, the length and width of the circuit board are saved, and a path can be reserved for background management.
[0139] Example 7:
[0140] As Figure 4 shown, the present application provides a method for signal switching based on the single Micro USB interface of the above-mentioned embodiments 1-4, comprising the following steps:
[0141] S1. Setting electronic components for distinguishing signal sources in the signal source distinguishing unit of the Micro USB protection module; setting a crystal oscillator in the signal source distinguishing unit of the Micro USB protection module;
[0142] S2. The MCU obtains the function value of the electronic components through the plugging of the Micro USB first connector and the Micro USB second connector, and compares it with the pre-stored signal source types in the MCU to determine the target signal source type; the function value of the electronic components here refers to the oscillation frequency of the crystal oscillator; the MCU obtains the frequency value of the crystal oscillator and compares it with the pre-stored frequency ranges in the MCU to determine the target signal source type;
[0143] S3. The MCU controls the switch unit to select the signal source of the same type as the target signal source type through the first identification pin and the second identification pin.
[0144] As Figure 3 shown, different crystal oscillators are used to distinguish the type of the signal inserted into the interface of the Micro USB signal source expansion module, such as Figure 6 shown, when the crystal oscillator X1 is 10KHz, the MCU determines that the frequency range is 9KHz to 11KHz through the crystal oscillator distinguishing pin FID, at this time, the MCU sets the first identification pin P1 to 0 low level and the second identification pin P2 to 0 low level to the switch unit, thereby identifying the USB signal source; when the crystal oscillator X1 is 20KHz, the MCU determines that the frequency range is 19KHz to 21KHz through the crystal oscillator distinguishing pin FID, at this time, the MCU sets the first identification pin P1 to 0 low level and the second identification pin P2 to 1 high level to the switch unit, thereby identifying the UART signal source; when the crystal oscillator X1 is 30KHz, the MCU determines that the frequency range is 29KHz to 31KHz through the crystal oscillator distinguishing pin FID, at this time, the MCU sets the first identification pin P1 to 1 high level and the second identification pin P2 to 0 low level to the switch unit, thereby identifying the I2C signal source; in addition, the crystal oscillator X1 value can also be customized for user customization, the MCU sets the first identification pin P1 to 1 high level and the second identification pin P2 to 1 high level to the switch unit, which is a reserved interface for user background management of the Micro USB interface.
[0145] After the switch unit receives the corresponding identification pin state (00, 01, 10), the first data pin D1 and the second data pin D2 are switched to the corresponding signal source, wherein 00 corresponds to the USB signal source, 01 corresponds to the UART signal source, and 10 corresponds to the I2C signal source, so that three different signal sources can be switched in the same Micro USB port, and different external devices can be connected to the corresponding different signal sources.
[0146] The method for switching signals through a single Micro USB interface provided by the application can realize that the same Micro USB interface is used as a signal source of different devices, different signal sources are distinguished through different crystal frequency values, the length and width of the circuit board are saved, and a path can be reserved for background management.
[0147] In the above embodiment 6 or embodiment 7, the electronic component in step S1 is also used for user customization, and a reserved interface of the Micro USB interface for background management is provided for the user.
[0148] The content of the application is also applicable to a Mini USB interface, and can solve the switching of a single Mini USB interface and multiple signal sources.
[0149] Although the application has been described in detail with reference to the preferred embodiments, the application is not limited thereto. Various equivalent modifications or replacements can be made to the embodiments of the application by those skilled in the art without departing from the spirit and essence of the application, and these modifications or replacements shall be within the scope of the application. Any person skilled in the art can easily think of changes or replacements within the technical range disclosed by the application, and these changes or replacements shall be within the protection scope of the application. Therefore, the protection scope of the application shall be subject to the protection scope of the claims.
Claims
1. A circuit for signal switching via a single Micro USB interface, characterized in that, Includes a Micro USB protection module and a Micro USB signal source expansion module; The Micro USB protection module includes a Micro USB first connector and a signal source differentiation unit, with the Micro USB first connector connected to the signal source differentiation unit. The Micro USB signal source expansion module includes a Micro USB second connector, an MCU, and a switching unit; The Micro USB second connector connects to the MCU and the switching unit. The MCU connects to the switching unit through the signal source identification pin. The switching unit is connected to several signal sources. The Micro USB first connector is plugged into the Micro USB second connector; The signal source differentiation unit sends the signal source differentiation signal to the Micro USB second connector via the Micro USB first connector; The MCU identifies the signal source from the Micro USB second connector, distinguishes the signal, and then sends a signal source identification signal to the switching unit to identify the corresponding signal source; The signal source differentiation unit includes a first resistor and a second resistor; The first resistor has a voltage source connected to its first terminal, the second resistor has a grounded terminal, the second terminal of the first resistor is connected to the first terminal of the second resistor, and is connected to the first connector of the Micro USB. The MCU obtains the voltage division value of the first resistor and the second resistor to the voltage source through the Micro USB second connector, and then controls the switching unit to select the corresponding signal source through the signal source identification pin; The signal source differentiation unit includes a crystal oscillator; The first terminal of the crystal oscillator is connected to a voltage source, the second terminal of the crystal oscillator is connected to the first connector of the Micro USB, and the third terminal of the crystal oscillator is grounded. The MCU obtains the frequency value of the crystal oscillator through the Micro USB second connector, and then controls the switching unit to select the corresponding signal source through the signal source identification pin. A circuit that enables signal switching via a single Micro USB interface allows the same Micro USB interface to serve as a signal source for different devices, saving circuit board length and width, and reserving a path for backend management.
2. The circuit for signal switching via a single Micro USB interface as described in claim 1, characterized in that, Both the Micro USB first connector and the Micro USB second connector are equipped with voltage pins, ground pins, signal source differentiation pins, positive data pins, and negative data pins; The voltage pins of the Micro USB first connector and the Micro USB second connector are connected together; the ground pins of the Micro USB first connector and the Micro USB second connector are connected together; the signal source differentiation pins of the Micro USB first connector and the Micro USB second connector are connected together; the positive data pins of the Micro USB first connector and the Micro USB second connector are connected together; and the second data pins of the Micro USB first connector and the Micro USB second connector are connected together. Both the first and second data pins of the Micro USB second connector are connected to the switching unit.
3. The circuit for signal switching via a single Micro USB interface as described in claim 2, characterized in that, The MCU is equipped with an analog-to-digital conversion pin, a first identification pin, and a second identification pin; The signal source differentiation pin of the Micro USB first connector is connected to the signal source differentiation unit, and the signal source differentiation pin of the Micro USB second connector is connected to the analog-to-digital conversion pin of the MCU. The MCU's first and second identification pins are both connected to the switching unit.
4. The circuit for signal switching via a single Micro USB interface as described in claim 1, characterized in that, Signal sources include USB signal sources, UART signal sources, and I2C signal sources; The USB signal source includes a positive data terminal and a negative data terminal, both of which are connected to the switching unit. The UART signal source includes a transmit data terminal and a receive data terminal, both of which are connected to a switching unit. The I2C signal source includes a data terminal and a clock terminal, both of which are connected to the switching unit.
5. A method for signal switching based on a single Micro USB interface according to any one of claims 1-4, characterized in that, Includes the following steps: S1. An electronic component for distinguishing signal sources is provided in the signal source differentiation unit of the Micro USB protection module; S2. The MCU obtains the functional values of electronic components by connecting the Micro USB first connector and the Micro USB second connector, and compares them with the signal source types pre-stored in the MCU to determine the target signal source type; S3. The MCU controls the switching unit to select a signal source of the same type as the target signal source through the first identification pin and the second identification pin.
6. The method for signal switching using a single Micro USB interface as described in claim 5, characterized in that, In step S1, a voltage source is set in the signal source differentiation unit of the Micro USB protection module, and a voltage divider resistor is set to divide the voltage source. In step S2, the MCU obtains the resistance value of the voltage divider resistor and the voltage value of the voltage source, and compares them with the threshold voltage values stored in the MCU in advance to determine the type of target signal source.
7. The method for signal switching using a single Micro USB interface as described in claim 5, characterized in that, In step S1, a crystal oscillator is set in the signal source differentiation unit of the Micro USB protection module; In step S2, the MCU obtains the frequency value of the crystal oscillator and compares it with the frequency ranges pre-stored in the MCU to determine the type of target signal source.
8. The method for signal switching using a single Micro USB interface as described in claim 5, characterized in that, In step S1, the electronic components are also used for user customization, providing a reserved interface for the user to manage the Micro USB interface in the background.
Citation Information
Patent Citations
Micro USB (Universal Serial Bus) interface circuit and mobile terminal thereof
CN108009116A