Earphone switch control circuit, earphone switch control method and electronic equipmentTechnical Field
The invention relates to the technical field of electronic equipment, in particular to an earphone switch control circuit, an earphone switch control method and electronic equipment.
Background
The 3.5 mm headphone interface can be classified into two standards of OMTP (open mobile terminal platform) and CTIA (cellular telecommunications and internet association) according to the pin definition order. Since the two standards differ in the definition of the pins, the inability of the interface chip or circuit to make the correct type identification and electrical connection will directly affect the use of the headset functionality. In order to meet the market demands and take different standards into consideration, many semiconductor chip manufacturers have introduced a single-chip solution that can automatically identify the type of the earphone and make a correct connection through the on-chip switch circuit.
However, due to the limitation of chip process, it is difficult to design the size of the switch in the chip to be large enough to obtain a low on-resistance, and only a few hundred milliohms of on-resistance can be achieved to an acceptable extent of chip area, i.e. the switch used for GND (ground) connection in the chip has a problem of large on-resistance. These problems often lead to degradation of some performance parameters of the audio output signal, such as: THD (Total Harmonic Distortion) is worse than directly using PCB board level ground, and the isolation between the left and right channels is poor.
Disclosure of Invention
The invention aims to provide an earphone switch control circuit, an earphone switch control method and electronic equipment.
The invention provides an earphone switch control circuit, which is applied to electronic equipment and comprises: the earphone comprises an audio socket, an earphone interface chip, a first switch tube and a second switch tube, wherein the audio socket and the earphone interface chip are connected with each other; the SLEEVE pin and RING2 pin of the audio socket are both connected to one end of a cross analog switch in the earphone interface chip, the other end of the cross analog switch is grounded or connected with an analog-to-digital conversion pin, the first end of a first switch tube is connected between the RING2 pin and the cross analog switch, the second end of the first switch tube is connected to a first control pin in the earphone interface chip, the first end of a second switch tube is connected between the SLEEVE pin and the cross analog switch, and the second end of the second switch tube is connected to a second control pin in the earphone interface chip.
Further, if the RING2 pin is grounded through the cross analog switch, the first control pin controls the first switch tube to be conducted; and if the SLEEVE pin is grounded through the cross analog switch, the second control pin controls the second switch tube to be conducted.
Further, the first switch tube and the second switch tube are both metal oxide semiconductor field effect transistors, or the first switch tube and the second switch tube are both bipolar transistors.
Further, when the first switch tube and the second switch tube are both the mosfets, the first ends of the first switch tube and the second switch tube are both drain electrodes, the second ends thereof are both gate electrodes, the third ends thereof are both source electrodes, and the source electrodes of the first switch tube and the second switch tube are both grounded; or when the first switch tube and the second switch tube are both the bipolar transistors, the first ends of the first switch tube and the second switch tube are both collectors, the second ends of the first switch tube and the second switch tube are both bases, the third ends of the first switch tube and the second switch tube are both emitters, and the emitters of the first switch tube and the second switch tube are both grounded.
Furthermore, the earphone output left channel and the earphone output right channel of the audio socket are respectively connected to the first digital-to-analog conversion pin and the second digital-to-analog conversion pin in the earphone interface chip.
The invention provides an earphone switch control method, which is applied to the earphone switch control circuit and is executed by an earphone interface chip, and the method comprises the following steps: sending a control signal to a cross analog switch and a control pin according to the detected earphone type, so that the cross analog switch switches a RING2 pin and/or a SLEVE pin in an audio socket to be grounded according to the control signal, and the control pin controls a first switch tube and/or a second switch tube connected with the grounded pin to be conducted according to the control signal.
Further, the method for detecting the earphone type comprises the following steps: detecting the earphone type of an earphone inserted into an audio socket according to the voltage value flowing through the audio socket; wherein the voltage values include a first voltage value flowing from the RING2 pin through the SLEVE pin and a second voltage value flowing from the SLEVE pin through the RING2 pin.
Further, the earphone type includes four sections of OMTP type earphones, and correspondingly, the control signal includes a first control signal; the step of switching the RING2 pin and/or the sleep pin in the audio socket to ground according to the control signal comprises the following steps: switching the RING2 pin to ground according to the first control signal; the step of enabling the control pin to control the conduction of the first switch tube and/or the second switch tube connected with the grounded pin according to the control signal comprises the following steps: and enabling a first control pin to control a first switch tube connected with the RING2 pin to be conducted according to the first control signal.
Further, the earphone type comprises a four-segment CTIA type earphone, and correspondingly, the control signal comprises a second control signal; the step of switching the RING2 pin and/or the sleep pin in the audio socket to ground according to the control signal comprises the following steps: switching a SLEEVE pin in the audio socket to be grounded according to the second control signal; the step of enabling the control pin to control the conduction of the first switch tube and/or the second switch tube connected with the grounded pin according to the control signal comprises the following steps: and enabling a second control pin to control a second switching tube connected with the SLEEVE pin to be conducted according to the second control signal.
The electronic equipment provided by the invention comprises an equipment body and the earphone switch control circuit, wherein the earphone switch control circuit is arranged in the equipment body.
The earphone switch control circuit provided by the invention comprises: the earphone comprises an audio socket, an earphone interface chip and a switch tube; the SLEEVE pin and RING2 pin of the audio socket are both connected to one end of a cross analog switch in the earphone interface chip, the other end of the cross analog switch is grounded or connected to an analog-to-digital conversion pin, the first end of a first switch tube is connected between the RING2 pin and the cross analog switch, the second end of the first switch tube is connected to a first control pin in the earphone interface chip, the first end of a second switch tube is connected between the SLEEVE pin and the cross analog switch, and the second end of the second switch tube is connected to a second control pin in the earphone interface chip. The invention separates the switch tube outside the earphone interface chip by adopting the circuit connection relation, so that the size design of the switch tube is not limited by the area of the chip, and the low-resistance switch tube with larger size can be provided, thereby improving partial performance parameters of the audio output signal.
The earphone switch control method provided by the invention comprises the following steps: the earphone interface chip sends a control signal to the cross analog switch and the control pin according to the detected earphone type, so that the cross analog switch switches the RING2 pin and/or the SLEVE pin in the audio socket to be grounded according to the control signal, and the control pin controls the conduction of the first switch tube and/or the second switch tube connected with the grounded pin according to the control signal. The earphone interface chip controls the on-off of the switch tube separated from the outside according to the earphone type, and can be matched with different earphone types, thereby improving partial performance parameters of the audio output signal.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a block diagram of a headset switch control circuit according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of an earphone switch control circuit according to an embodiment of the present invention;
fig. 3 is a flowchart of a method for detecting an earphone switch according to an embodiment of the present invention;
fig. 4 is a block diagram of an electronic device according to an embodiment of the present invention.
Icon: 100-earphone switch control circuit; 101-an audio jack; 102-a headset interface chip; 103-a first switch tube; 104-a second switch tube; 200-the apparatus body.
Detailed Description
The technical solutions of the present invention will be described clearly and completely with reference to the following embodiments, and it should be understood that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
At present, in practical use, the earphone type standard is identified through a single-chip scheme of a switch switching circuit in a chip, but the scheme has the problem that the switch on resistance is large, so that the performance of an audio output signal is influenced. Based on this, the earphone switch control circuit, the earphone switch control method and the electronic device provided by the embodiment of the invention can provide a low-resistance switch tube with a larger size, so that partial performance parameters of the audio output signal are improved.
For the convenience of understanding the present embodiment, a detailed description will be given to an earphone switch control circuit disclosed in the present embodiment.
The first embodiment is as follows:
referring to fig. 1, a block diagram of a headset switch control circuit applied to an electronic device includes: an audio jack 101 and an earphone interface chip 102 connected to each other, and a first switch tube 103 and a second switch tube 104 connected to both the audio jack 101 and the earphone interface chip 102. In practical use, the audio jack 101 may be a 3.5 mm audio jack; such as mobile phones, tablet computers, radios, etc.
Referring to the schematic structure of the earphone switch control circuit shown in fig. 2, in the above circuit, the sleevepin SLEEVE and RING2 pin RING2 of the audio jack are both connected to one end of a cross analog switch in the earphone interface chip, the other end of the cross analog switch is connected to GND or to an analog-to-digital conversion pin ADC, the first end of the first switch tube Q1 is connected between the RING2 pin RING2 and the cross analog switch, the second end of the first switch tube Q1 is connected to a first control pin GPIO1 in the earphone interface chip, the first end of the second switch tube Q2 is connected between the SLEEVE pin SLEEVE and the cross analog switch, and the second end of the second switch tube Q2 is connected to a second control pin GPIO2 in the earphone interface chip.
And the headphone output left channel TIP and the headphone output right channel RING1 of the audio jack are connected to the first digital-to-analog conversion pin DAC0 and the second digital-to-analog conversion pin DAC1, respectively, in the headphone interface chip.
In this embodiment, the cross analog switch disposed in the headphone interface chip is used to implement the signal switching function of the sleep pin sleep and RING2 pin RING2, and may include: the SLEEVE pin SLEEVE is switched to be grounded, and a RING2 pin RING2 is connected with an analog-to-digital conversion pin ADC, or the SLEEVE pin SLEEVE is switched to be connected with the analog-to-digital conversion pin ADC, and a RING2 pin RING2 is switched to be grounded. Based on the signal switching of the cross analog switch, if the RING2 pin RING2 is grounded through the cross analog switch, the first control pin GPIO1 controls the first switch tube Q1 to be conducted; if the SLEEVE pin SLEEVE is grounded through the cross analog switch, the second control pin GPIO2 controls the second switch tube Q2 to be turned on.
In some embodiments, the first switch tube and the second switch tube may be both MOSFETs (Metal-Oxide-Semiconductor Field-Effect transistors), such as an N-type MOSFET switch and a P-type MOSFET switch. Or the first switch tube and the second switch tube can be both bipolar transistors.
When the first switch tube and the second switch tube are both mosfets, as shown in fig. 2, the first ends of the first switch tube and the second switch tube are both drains, the second ends are both gates, the third ends are both sources, and the sources of the first switch tube and the second switch tube are both grounded.
Or when the first switch tube and the second switch tube are both bipolar transistors, the first ends of the first switch tube and the second switch tube are both collectors, the second ends of the first switch tube and the second switch tube are both bases, the third ends of the first switch tube and the second switch tube are both emitters, and the emitters of the first switch tube and the second switch tube are both grounded.
The earphone switch control circuit provided by the embodiment comprises: the earphone comprises an audio socket, an earphone interface chip and a switch tube; the SLEEVE pin and RING2 pin of the audio socket are both connected to one end of a cross analog switch in the earphone interface chip, the other end of the cross analog switch is grounded or connected to an analog-to-digital conversion pin, the first end of a first switch tube is connected between the RING2 pin and the cross analog switch, the second end of the first switch tube is connected to a first control pin in the earphone interface chip, the first end of a second switch tube is connected between the SLEEVE pin and the cross analog switch, and the second end of the second switch tube is connected to a second control pin in the earphone interface chip. In the embodiment, the switching tube is separated from the earphone interface chip by adopting the circuit connection relation, so that the size design of the switching tube is not limited by the area of the chip, and the switching tube with a large size and low resistance can be provided, thereby improving partial performance parameters of the audio output signal.
Example two:
based on the first earphone switch control circuit provided in the foregoing embodiment, this embodiment provides an earphone switch control method applied to the foregoing circuit, where the method is executed by an earphone interface chip, and the method may include the following steps:
and sending a control signal to the cross analog switch and the control pin according to the detected earphone type, so that the cross analog switch switches the RING2 pin and/or the SLEVE pin in the audio socket to be grounded according to the control signal, and the control pin controls the first switch tube and/or the second switch tube connected with the grounded pin to be conducted according to the control signal.
In this embodiment, before the correct earphone type is detected by the earphone interface chip, the first switch tube and the second switch tube may both be in an off state.
The earphone switch control method provided by the embodiment comprises the following steps: and sending a control signal to the cross analog switch and the control pin according to the detected earphone type, so that the cross analog switch switches the RING2 pin and/or the SLEVE pin in the audio socket to be grounded according to the control signal, and the control pin controls the first switch tube and/or the second switch tube connected with the grounded pin to be conducted according to the control signal. The earphone interface chip in the embodiment controls the switching tube which is separated from the outside to be switched on or switched off according to the earphone type, and can be matched with different earphone types, so that partial performance parameters of the audio output signal are improved.
In one possible implementation, the method for detecting the type of the headset may include: detecting the earphone type of an earphone inserted into the audio socket according to the voltage value flowing through the audio socket; wherein the voltage values include a first voltage value flowing from the RING2 pin through the SLEVE pin and a second voltage value flowing from the SLEVE pin through the RING2 pin. Based on the OMTP and CTIA standards, the headset types may include, but are not limited to, three-segment headsets, four-segment CTIA-style headsets, and four-segment OMTP-style headsets. The four-segment CTIA earphone has the following pin definition sequence: microphone sleep pin, common RING2, headphone output right channel RING1 pin, headphone output left channel TIP pin; the four-section OMTP earphone has the following pin definition sequence: common ground sleep pin, microphone RING2, headphone output right channel RING1 pin, headphone output left channel TIP pin.
In the specific implementation process, the step of detecting the type of the earphone inserted into the audio jack according to the voltage value flowing through the audio jack may refer to the following steps shown in fig. 3:
step S302, when the first voltage value is equal to the second voltage value and is equal to zero, determining that the earphone inserted into the audio socket is a three-section earphone;
step S304, when the first voltage value is larger than the second voltage value, determining that the earphone is a four-segment CTIA earphone;
step S306, when the first voltage value is smaller than the second voltage value, the earphone is determined to be a four-section OMTP earphone.
Based on different earphone types, the control signals in the earphone switch control method of the circuit are correspondingly different:
when the earphone type is a four-section OMTP earphone, the control signal is a first control signal; the step of switching the RING2 pin and/or the sleep pin in the audio jack to ground according to the control signal may include: the RING2 pin is switched to ground according to the first control signal.
Correspondingly, the step of enabling the control pin to control the conduction of the first switch tube and/or the second switch tube connected with the grounded pin according to the control signal may include: the first control pin controls the conduction of a first switch tube connected with a RING2 pin according to a first control signal.
When the earphone type is a four-section CTIA type earphone, the control signal is a second control signal; the step of switching the RING2 pin and/or the sleep pin in the audio jack to ground according to the control signal may include: and switching the SLEEVE pin in the audio socket to be grounded according to the second control signal.
Correspondingly, the step of enabling the control pin to control the conduction of the first switch tube and/or the second switch tube connected with the grounded pin according to the control signal may include: and enabling the second control pin to control the conduction of a second switching tube connected with the SLEEVE pin according to a second control signal.
When the earphone type is a three-section type earphone, the control signal is a third control signal; in a specific implementation, the RING2 pin and the sleep pin can be controlled to be turned on simultaneously according to the third control signal, or the RING2 pin and the sleep pin can be controlled to be turned on only one of the pins.
In summary, in practical use, the above earphone switch control circuit and the earphone switch control method are tested, and compared with the problem that the THD and the separation performance of the audio output are poor when the existing interface chip uses the on-chip switch to be grounded, the embodiment can enable the size design of the switch tube to be not limited by the area of the chip by additionally arranging the switch tube outside the earphone interface chip, so that a low-resistance switch tube with a larger size can be provided, and thus, part of performance parameters of the audio output signal can be obviously improved.
Example three:
as shown in fig. 4, the present embodiment provides an electronic device, which includes a device body 200 and the earphone switch control circuit 100 in the first embodiment, where the earphone switch control circuit 100 is disposed in the device body 200.
Since the electronic device includes the earphone switch control circuit, the electronic device has the same technical features as the earphone switch control circuit, and for convenience and simplicity of description, the specific working process of the electronic device may refer to the corresponding explanation in the first embodiment, which is not described herein again.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.