The present disclosure claims the benefit of "Method AND Apparatus FOR Audio PLUG Mic/group Position Detection" U.S. provisional application No.62/189,869 filed on 7/8 2015 AND "Method AND Apparatus FOR Audio PLUG MIC/group Position AND Detection" U.S. provisional application No.62/301,913 filed on 3/1 2016, which are hereby incorporated by reference in their entirety.
Detailed Description
Fig. 1 illustrates an example functional block diagram of an external device 100 and an apparatus 200 configured to be electrically coupled to each other through mating connectors 110 and 210 according to one embodiment of this disclosure.
In the embodiment depicted in fig. 1, the external device 100 comprises a first connector 110, such as an audio plug, and the apparatus 200, e.g. a computer or a media player, comprises a second connector 210, such as an audio jack. As shown, the external device 100 can be electrically coupled to the apparatus 200 via the first connectors 110 and 210. Also, in the embodiment depicted in fig. 1, the external device 100 includes a component 120 that constitutes a headset. In alternative examples, the component 120 is configured as other devices, such as speakers, microphones, and the like. Also, the device 200 includes components external to the connector 210, which are collectively referred to as signal processing circuitry (not shown). In some examples, the signal processing circuitry of apparatus 200 is configured to drive a microphone to receive an audio input signal or to drive one or more speakers of external device 100 when external device 100 is connected to apparatus 200 through connectors 110 and 210.
External device 100, apparatus 200, audio plug 110, and audio jack 210 are shown as non-limiting examples. In some examples, connectors 110 and 210 are other types of connectors, where one connector is configured to receive the other connector such that connection terminals at respective portions of the connectors are coupled together to electrically couple external device 100 with apparatus 200. In some examples, connectors 110 and 210 are mating connectors configured to carry audio signals or multimedia signals in analog form.
As shown, the respective portions of the audio plug 110 correspond to four connection portions, including a tip connection portion 112, a first ring connection portion 114, a second ring connection portion 116, and a sleeve connection portion 118. In some examples according to the 4-pole configuration, the audio plug 110 has four separate connection terminals that are respectively placed at each of the four connection portions 112 and 118. In other examples according to the 3-pole configuration, the audio plug 110 has three separate connection terminals, two of which are placed at the tip connection portion 112 and the first ring connection portion 114, and the other of which extends through the second ring connection portion 116 and the sleeve connection portion 118. In some examples according to the 2-pole configuration, the audio plug 110 has two separate connection terminals, one of which is placed at the tip connection portion 112 and the other of which extends through the first ring connection portion 114, the second ring connection portion 116, and the sleeve connection portion 118.
In some examples, the component 120 of the external device 100 electrically connects the connection portion of the audio plug 110 in various ways such that an audio plug designed for a 4-pole configuration audio plug is adapted to function as a 3-pole configuration audio plug or a 2-pole configuration audio plug; or an audio plug designed for a 3-pole configuration audio plug is adapted to function as a 2-pole configuration audio plug. In some examples according to the invention, the 2-pole configuration is treated as a 3-pole configuration.
By way of non-limiting example, in fig. 1, the assembly 120 forms a stereo headset that includes a left ear speaker 122, a right ear speaker 124, and a microphone 126. The left ear speaker 122 acts as a load resistance device coupled between the left drive node (labeled "HPL") and a ground reference node (labeled "GND"). The right ear speaker 124 serves as a load resistance device coupled between the right drive node (labeled "HPR") and the ground reference node GND. The microphone 126 is coupled between a microphone bias/signal node (labeled "MIC") and a ground reference node GND. In this example, the audio plug 110 has a 4-pole configuration in which the left driving node HPL is coupled with the connection terminal at the top end connection portion 112; the right driving node HPR is coupled with the connection terminal at the first ring connection part 114; a microphone offset/signal node MIC is coupled with a connection terminal at the second ring connection portion 116; and the ground reference node GND is coupled with the connection terminal at the sleeve connection portion 118.
Some different combinations of the connection portions of the component 120 and the audio plug 110 are listed in table 1 as non-limiting examples. The external device 100 of fig. 1 falls in case 2 of table 1. The expression "float" in table 1 indicates that the connection terminal at the corresponding connection portion is not present or connected to form a complete point path from the power supply to the reference ground (also referred to as "electrical float"). Also, in some examples, case 13 in table 1 is implemented as a 3-pole audio plug or a 2-pole audio jack. Other variations are within the contemplated embodiments of the present disclosure.
TABLE 1
The audio jack 210 is configured to receive the audio plug 110 and includes connection portions corresponding to respective connection portions of the audio plug 110. For example, the audio jack 210 includes a top end connection terminal T corresponding to the top end connection part 112TP(ii) a First ring connection terminal T corresponding to first ring connection portion 114R1(ii) a A second ring connecting terminal T corresponding to the second ring connecting portion 116R2(ii) a Sleeve connection terminal T corresponding to sleeve connection portion 118SL. The audio jack 210 further includes an insertion detection terminal 212, and the insertion detection terminal 212 is placed at a position corresponding to one of the connection portions 112 and 118.
The insertion detection terminal 212 is electrically floating when the audio jack 210 does not receive any audio plug and corresponds to one of the corresponding terminals (respectively labeled T) when the audio jack 210 receives an audio plugTP、TR1、TR2Or TSL) An electrical short circuit. Thus, the apparatus 200 knows that the insertion of the audio plug is known by the electrical characteristics of the insertion detection terminal 212. In some examples, the insertion detection terminal 212 is not directly electrically coupled with an inserted audio plug. In contrast, the insertion detection terminal 212 includes an electrode movable by a mechanical element, the electrode being movable by the inserted audio plug. At one endIn some embodiments, the mechanical element of the insertion detection terminal 212 is in a first position when the audio jack 210 does not receive any audio plug and is in a second position when the audio jack 210 receives an audio plug. In some examples, the electrode inserted into detection terminal 212 is shorted to a ground reference node when the mechanical element is in one of the first and second positions and is electrically floating when the mechanical element is in the other of the first and second positions.
The apparatus 200 will be further illustrated with reference to fig. 2.
Fig. 2 illustrates an example functional block diagram of an apparatus 200 for generating an output signal according to one embodiment of this disclosure.
The device 200 includes an audio jack 210. The apparatus 200 also includes a controller 222, an insertion detector 224, a comparator 226, a current mode digital-to-analog converter (DAC)232, an analog-to-digital converter (ADC)234, an audio codec 242, an audio amplifier 244, switches 252 and 254, and a processor 260. Controller 222, insertion detector 224, comparator 226, current mode digital-to-analog converter (DAC)232, analog-to-digital converter (ADC)234, audio codec 242, audio amplifier 244, switches 252 and 254, and processor 260 are collectively referred to as a signal processing circuit.
In various embodiments, processor 260 includes a single signal processing core or multiple signal processing cores. Processor 260 is configured to run various applications to perform various functions, including through bus AUDIODOutputs the audio signal in digital form to the audio codec 242 through the bus GAINDAnd bus GAINAThe amplification gain(s) of audio codec 242 and/or audio amplifier 244 are controlled. Processor 260 and controller 222 also exchange information via bus DATA. In some embodiments, the amplification GAIN(s) of one of audio codec 242 and audio amplifier 244 is not adjustable, and thus the corresponding bus GAIN may be omittedDAnd GAINA。
The controller 222 is logic that manages the operation of the device 200 during the detection mode and configures the device 200 for the normal operating mode. During the period of the detection mode,the controller 222 obtains information about the insertion of the audio plug, the type of audio plug inserted (e.g., which of the thirteen example cases in table 1), the audio plug inserted, the connection terminal T at the top endTPAnd a first ring connecting terminal TR1The measured load resistance value. During the normal operation mode, the controller 222 sets the respective components and the connection terminal T through the switches 252 and 254 based on the detection resultTP、TR1、TR2And TSLAnd audio codec 242 and audio amplifier 244 are configured accordingly, and processor 260 outputs audio signals in digital form to audio codec 242 and sets amplification gains for generating output signals based on these audio signals. During the normal operating mode, the controller 222 also receives microphone data over the bus MICDATA and passes the microphone data to the processor 260.
During the detection mode, the controller 222 receives signals from the insertion detector 224 (at the node labeled "HSDET"), the comparator 226 (at the node labeled "SHDET"), and the audio amplifier 244 (via the bus labeled "trigger"). The controller 222 is further configured to output a control signal to set the switch 252 (labeled "SW" when referring toMIC"at node) and a switch 254 (at node labeled" SW ")GND"node of) and outputs for driving current mode ADC 232 (via a bus labeled" MICBIAS ") and audio codec (via a bus labeled" CTRL ")D"bus) of the digital values. The controller 222 also receives a digital value from the DAC 234 (via the bus labeled "MICDATA").
In some examples, the processor 260 and the controller 222 are implemented as integrated logic circuits, and the processor 260 and the controller 222 are thus replaced by a unified controller.
Insertion detector 224 is electrically coupled to insertion detection terminal 212 at node HSDET and is configured to detect whether terminal 212 is electrically floating or is electrically coupled to another connection terminal or a ground reference node (e.g., ground reference node GND)A) Electrical shorts to determine whether the audio jack 210 receives an audio plug. In some examples of the method of the present invention,insertion detector 224 includes a pull-up resistor configured to allow the voltage level at node HSDET to drop to a logic low level when insertion detection terminal 212 is electrically shorted to another connection terminal or a ground reference node, and to pull the voltage level at node HSDET to a high level when insertion detection terminal 212 is electrically floating.
In one embodiment, the comparator 226 is configured to detect the presence of the first ring connection terminal TR1Is greater than a predetermined threshold voltage and outputs the comparison result to the node SHDET. In some examples, during the detection mode, when the audio amplifier 244 is driving the top connection terminal TTPAnd will connect terminal T with the first ringR1When the corresponding output channel is set to the high resistance output mode, the comparator 226 outputs an indication indicating the first ring connection terminal TR1Whether or not it is also the result of the comparison driven by the audio amplifier 244, which indicates the top connection terminal TTPAnd a first ring connecting terminal TR1Whether electrically shorted through the audio plug 110 and/or the component 120 of the external device 100. When a channel is in a high resistance output mode, the channel does not output a driving signal and functions as an open circuit. Conversely, when a channel is in a drive mode, the channel outputs a drive signal.
The current mode DAC232 is configured to output a bias current to a node (labeled "MICIO"), wherein the amount of the circuit is controlled by the digital current value provided by the controller 222 over a bus (labeled "MICBIAS"). The ADC 234 is configured to convert the voltage level at the node MICIO to a digital voltage value and output the digital voltage value to the controller 222 over the bus MICDATA. In some examples, during the normal operating mode, the current mode DAC232 outputs a bias current to drive a microphone of an external device connected to the audio jack 210, such as the microphone 126 in fig. 1. In some examples, during the normal operating mode, ADC 234 outputs a digital voltage value that represents an audio signal obtained by a microphone of an external device connected to audio jack 210, such as microphone 126 in fig. 1. In some examples, during the detection mode, the current mode DAC232 outputs a test current to drive a load of an external device connected to the audio jack 210, and the ADC 234 detects the voltage level at node MICIO. The current-voltage relationship of the load is determined based on the detected voltage level in view of the known current level from the test current.
Audio codec 242 and audio amplifier 244 together generate output signals for driving corresponding load resistors of an inserted audio plug. In this disclosure, the audio codec 242 and the audio amplifier 244 are also collectively referred to as a signal generation circuit.
In one embodiment, audio codec 242 is configured to receive one or more audio signals in digital form corresponding to one or more corresponding channels from controller 222. These audio signals pass through the bus CTRLDOr by processor 260 over bus AUDIODIs received and one or more AUDIO signals are passed through bus AUDIOAIs output to the audio amplifier 244 in digital form corresponding to one or more corresponding channels. In some examples, audio codec 242 includes a digital-to-analog converter (DAC) configured to generate one or more audio signals in analog form based on one or more audio signals in digital form. Audio codec 242 passes through bus GAINDThe DAC gain setting parameters are received from processor 260. In some examples, AUDIO codec 242 operates over bus AUDIO during normal operationDReceiving an audio signal and during a detection mode via a bus CTRLDA test signal is received. Audio codec 242 also communicates via bus CTRLAVarious control signals, such as a control signal indicating whether one or more channels are to be set in a drive mode, a mute mode, or a high resistance output mode, are transmitted to the audio amplifier 244.
Audio amplifier 244 is configured to regulate AUDIO signals in digital form and over bus AUDIOAAnd the amplitude of one or more audio signals received from audio codec 242. The audio amplifier 244 is also configured to output the amplified audio signal as an output signal to a respective output terminal of the audio amplifier 244. During normal operation mode, the audio amplifier244 and the top connection terminal T of the audio jack 210TPAnd a first ring connecting terminal TR1Electrically coupled. During the detection mode, a current comparator, such as the one in the audio amplifier 244, is inserted at the top connection terminal TTPOr the first ring connecting terminal TR1And the corresponding output terminal of audio amplifier 244. Audio amplifier 244 is connected via bus GAINAThe amplifier gain setting parameter is received from processor 260. In some examples, audio amplifier 244 also includes one or more current comparators configured to output one or more comparison results to bus TOGGLE. In one embodiment, these comparisons indicate that terminal T is connected through the top terminalTPAnd a first ring connecting terminal TR1Reaches a predetermined threshold current during the detection mode. In some examples, such indications are used to measure the current level at the respective connection terminals. Further details regarding the current comparator in audio amplifier 244 will be described with reference to fig. 6.
Switch 252 is configured to respond to a signal passing through bus SWMICA control signal from the controller 222 for selectively coupling the node MICIO to the second ring connection terminal TR2Or sleeve connection terminal TSL. Switch 254 is configured to respond to a signal passing through bus SWGNDA control signal from the controller 222 for selectively connecting the second ring terminal T to the first ring terminal TR2Coupled to a ground reference node GNDAOr selectively connect the socket to the terminal TSLCoupled to a ground reference node GNDA。
When an audio plug is plugged into audio jack 210, insertion detector 224 reflects the insertion of the audio plug at the voltage level at node hsfet, and controller 222 thus knows the insertion of the audio plug and begins operating in detection mode.
During the detection mode, the controller 222 first detects the second ring connection terminal TR2Or sleeve connection terminal TSLWhether or not electrically coupled to a ground reference node, such as ground reference node GND in fig. 1. In some examples, the current is controlled by applying a certain amount of currentThe voltage value at the node is measured when provided to determine whether the connection terminal is coupled to a ground reference node. For example, given a predetermined amount of current, if the second ring connects terminal TR2Or sleeve connection terminal TSLA voltage level at which the corresponding connection terminal is determined to be coupled to the ground reference node is less than a first threshold value; if it is larger than the second ring connecting terminal TR2Or sleeve connection terminal TSLThe voltage level at is greater than a second threshold, and the connection terminal is determined to be coupled to a microphone, such as the microphone bias/signal node in fig. 1. In some examples, the second threshold is greater than the first threshold. In some examples, the terminal T is connected if the second ringR2Or sleeve connection terminal TSLBetween the first threshold and the second threshold, the controller 222 identifies the inserted plug as corresponding to a device outside the range of the examples listed in table 1.
In some examples, to measure the second loop connecting terminal T as discussed aboveR2At a voltage, the controller 222 sets the switch 252 to connect the node MICIO to the second ring connection terminal TR2Electrically coupled and provided with a switch 254 to connect the sleeve to terminal TSLAnd ground reference node GNDAElectrically coupling and connecting the second ring to the terminal TR2And ground reference node GNDAThe electrical coupling is decoupled. The controller 222 then controls the current mode DAC232 to pass current through the second loop connection terminal TR2Injected into the audio plug and using ADC 234 to determine the second loop connection terminal TR2The voltage level of (d). In some examples, to measure the socket connection terminal T as discussed aboveSLAt a voltage, the controller 222 sets the switch 252 to connect the node MICIO to the sleeve terminal TSLElectrically coupling and setting the switch 254 to connect the second ring to the terminal TR2And ground reference node GNDAElectrically coupling and connecting the sleeve to the terminal TSLAnd ground reference node GNDAThe electrical coupling is decoupled. The controller 222 then controls the current mode DAC232 to pass current through the socket connection terminal TSLInjected into the audio plug and determines the socket connection terminal T using ADC 234SLOfThe voltage level.
Based on the detection result, the controller 222 then determines the second ring connection terminal T of the inserted audio plugR2And a socket connection terminal TSLWhether the corresponding connection terminal is coupled to the ground reference node, and switches 252 and 253 are set to provide appropriate connections consistent with the detection results (e.g., consistent with one of the thirteen cases in table 1).
For example, if the audio plug is connected to the second ring terminal TR2The coupled connection terminals are determined to correspond to the microphone offset/signal node MIC of the external device, and the controller 222 sets the switch 254 to connect the second loop connection terminal TR2Ground reference node GND of slave device 200AElectrically decoupled and switch 252 is provided to connect the second ring terminal TR2Electrically coupled to node MICIO. Moreover, if the audio plug is connected to the socket terminal TSLThe coupled connection terminal is determined to correspond to the ground reference node of the external device, and the controller 222 sets the switch 254 to connect the sleeve to the terminal TSLElectrically coupled to ground reference node GND of device 200A. In this case, the controller 222 determines that the audio plug has a 4-pole, type I configuration (corresponding to cases 2 and 6-8 in table 1).
In some other examples, if the audio plug is connected to the socket by a terminal TSLThe coupled connection terminal is determined to correspond to the microphone offset/signal node MIC of the external device, and the controller 222 sets the switch 254 to connect the socket to the terminal TSLGround reference node GND of slave device 200AIs electrically decoupled and a switch 252 is provided to connect the sleeve to terminal TSLElectrically coupled to node MICIO. And, if the audio plug is connected with the second ring terminal TR2The coupled connection terminal is determined to correspond to the ground reference node of the external device, and the controller 222 sets the switch 254 to connect the second loop connection terminal T to the ground reference nodeR2Electrically coupled to ground reference node GND of device 200A. In this case, the controller 222 also determines that the audio plug has a 4-pole, type II configuration (corresponding to cases 1 and 3-5 in table 1).
At one endIn some further examples, if the audio plug is connected to the second ring terminal TR2And a socket connection terminal TSLThe coupled connection terminal is determined to correspond to the ground reference node of the external device, and the controller 222 sets the switch 252 to connect the second ring connection terminal TR2And a socket connection terminal TSLThe slave node MICIO is decoupled electrically and a switch 254 is provided to connect the second loop to terminal TR2And a socket connection terminal TSLAre all electrically coupled to the ground reference node GNDA. In this case, the controller 222 also determines that the audio plug has a 3-pole configuration.
During the inspection mode, the second ring connecting terminal T is inspected and configuredR2And a socket connection terminal TSLThereafter, the controller 222 detects the connection terminal T at the top endTPAnd a first ring connecting terminal TR1Measured load resistance value of the inserted audio plug, and determines the top end connection terminal TTPAnd a first ring connecting terminal TR1Whether electrically shorted by an inserted audio plug.
To define the terminal T at the topTPAt the measured load resistance value of the inserted audio plug, the controller 222 connects the driving first ring connection terminal T of the audio amplifier 244 withR1The corresponding output channel is set in a high load output mode. Also, the controller 222 sets the audio amplifier 244 so that a circuit is routed (electrically routed) at the audio amplifier 244 corresponding to the top connection terminal TTPOutput terminal and top connection terminal TTPA current comparator in between. The controller 222 uses the audio amplifier 244 as a voltage supply to gradually increase the top connection terminal TTPAnd a current comparator is used to determine whether the current drawn from the audio amplifier 244 has reached a predetermined current level. The voltage level (e.g., Vx) when the obtained current reaches a predetermined current level (e.g., Ix) is used to calculate the top connection terminal TTPThe resistance value (e.g., Rx. Vx/Ix) of (A) is set as the terminal T connected at the top endTPThe measured load resistance value of the inserted audio plug.
At the time of driving the top end connection terminal T as discussed aboveTPSo as to determine the connection terminal T with the top end of the inserted audio plugTPThe comparator 226 also detects the first loop connection terminal T at the corresponding load resistance value at the corresponding connection terminalR1Whether or not also driven by the audio amplifier 244. If the comparator 226 detects the first ring connecting terminal TR1The voltage level at which exceeds the predetermined voltage level, the controller 222 determines the top connection terminal TTPAnd a first ring connecting terminal TR1Electrically shorted by the inserted audio plug. In some examples, the top terminal T is connectedTPAnd a first ring connecting terminal TR1Is electrically shorted by the inserted audio plug, which corresponds to cases 4, 7 and 12 in table 1.
If the top terminal T is connectedTPAnd a first ring connecting terminal TR1Is not electrically shorted by the inserted audio plug, the controller continues to determine that the terminal T is connected to the first ringR1The measured load resistance value of the inserted audio plug.
To determine the connection terminal T at the first ringR1At the measured load resistance value of the inserted audio plug, the controller 222 connects the driving first ring connection terminal T of the audio amplifier 244 withR1The corresponding output channel is set in a high load output mode. Also, the controller 222 sets the audio amplifier 244 so that the circuit is switched at the audio amplifier 244 corresponding to the first loop connection terminal TR1Output terminal and first ring connecting terminal TR1A current comparator in between. According to one embodiment, the controller 222 uses the audio amplifier 244 as a voltage supply to gradually increase the first ring connection terminal TR1And a current comparator is used to determine whether the current drawn from the audio amplifier 244 has reached a predetermined current level. The voltage level at the time when the obtained current reaches a predetermined current level is used to calculate the first loop connection terminal TR1And the first ring connects the terminals TR1The value of the load resistance of the inserted audio plug measured at (a) is thus determined.
After the top connection terminal T has been determinedTPAnd a first ring connecting terminal TR1After a measurable load resistance value of the inserted audio plug, the controller 222 configures the audio amplifier 244 so as to be connected with the first ring connection terminal TR1And a top terminal TTPThe corresponding output channel is set in a driving mode or a high resistance output mode.
In some examples, if the measured load resistance value is below a third threshold, the corresponding connection terminal of the first connector is determined to be coupled with the ground reference node of the second connector. The output channel for driving the connection terminal is thus set to a high-resistance output mode. In some examples, if the measured load resistance value is greater than the fourth threshold value, the load resistance is deemed too high to be effectively driven by the output channel, and the corresponding connection terminal of the first connector is determined to be electrically floating. The output channel for driving the connection terminal is thus set to a driving mode or a high-resistance output mode. In some examples, if the measured load resistance value ranges from the third threshold value to the fourth threshold value, the load resistance is considered to be within the designed driving capability of the output channel, and the output channel for driving the connection terminal is set to the driving mode. In some embodiments, the third threshold is 4ohms and the fourth threshold is 1000 ohms.
Also, the controller 222 reports the determined load resistance value to the processor 260. The processor 260 then sets the amplification gain for generating an output signal to drive the top connection terminal TTPAnd a first ring connecting terminal TR1. The audio codec 242 and the audio amplifier 244 generate output signals with the set amplification gain. In some examples, the amplification gain for each output signal includes a first parameter applicable to a DAC portion of the audio codec 242 and/or a second parameter applicable to an analog amplifier of the audio amplifier 244.
In some examples, the amplification gain is set to be proportional to the corresponding load resistance value. Thus, if the user replaces the headset with a higher speaker impedance with a headset with a lower speaker impedance for listening to the music output by the device 200, the voltage amplitude of the drive signal is adjusted accordingly so as to reduce the likelihood of causing an uncomfortable experience or even hearing loss to the user. In some examples, the amplification gain is set based on a look-up table using a measured load resistance value as an index.
Fig. 3 shows an example flow diagram outlining a process 300 of generating an output signal to be output to a connector according to one embodiment of the present disclosure. Note that in various embodiments, additional operations are performed before, during, and/or after the process 300 depicted in fig. 3.
In some embodiments, process 300 is performed by controller 222 and processor 260, which control other components of apparatus 200 in fig. 2, and thus detailed descriptions of certain operations may be simplified or omitted. Process 300 begins at S301 and proceeds to S310.
In S310, an insertion detection process is performed to detect establishment of a connection between the first connector and the second connector. The first connector is configured to receive the second connector such that it is noted that the first connector and it is noted that the connection terminals at the respective portions of the second connector are coupled together. Upon detecting establishment of a connection between the first connector and the second connector, the process 300 proceeds to step S320.
For example, the first connector corresponds to the audio jack 210, and the second connector corresponds to the audio plug 110. The insertion detector 224 sets the voltage level at node hsfet at different logic levels indicating the presence or absence of a connection between the audio plug and the audio jack.
At S320, a pole configuration determination process is performed based on whether the first set of connection terminals of the first connector is coupled to the ground reference node of the second connector. In some examples, the pole configuration process includes identifying a connection terminal of the first connector that is electrically coupled (or simply "electrically grounded") with a ground terminal of the second connector, and then determining the type of the second connector based on the identified electrically grounded connection portion of the first connector.
For example, the controller 222 connects the terminal T to the second ring using the current mode DAC232R2And a socket connection terminal TSLTest currents are injected one after the other and the corresponding voltage levels are measured using ADC 234 or other suitable circuitry. Based on such information, the controller 222 determines whether the inserted audio plug has a 3-pole configuration or a 4-pole configuration. Further details of the pole configuration determination process for an audio jack will be further illustrated with reference to fig. 4.
At S330, after determining whether the first set of connection terminals of the first connector is coupled to the ground reference node of the second connector, one or more connection terminals determined to be coupled to the ground reference node of the second connector are electrically coupled to the ground reference node of the device in which the first connector resides. The other connection terminal(s) in the first set of connection terminals of the first connector are coupled with the appropriate node(s).
For example, in determining the second ring connecting terminal TR2Or sleeve connecting terminal TSLAfter being electrically coupled to the ground reference node of the audio plug, the controller 222 sets the switch 254 to couple the corresponding connection terminal to the ground reference node GNDAAnd switch 252 is set to electrically couple the non-grounded connection terminal to DAC232 and ADC 234 through node MICIO.
At S340, a load resistance value of the second controller measured at the second connection terminal set of the first connector is determined. In some examples, a first load resistance value of the second connector is determined based on a current-voltage relationship at a first terminal of the second connector, the first terminal of the second connector configured to receive the first output signal when coupled to the first connector. Also, a second load resistance value of the second connector is determined based on a current-voltage relationship at a second terminal of the second connector, the second terminal of the second connector configured to receive the second output signal when coupled to the first connector.
For example, the controller 222 in one embodiment provides a test voltage to a corresponding load of the audio plug using the audio amplifier 244 as a voltage source. Also, the controller 222 configures the audio amplifier to reroute the current comparators between the connection terminals under test and the output terminals of the corresponding output channels of the audio amplifier 244. The current comparator determines whether the current drawn by the corresponding load has reached a predetermined current level. The controller 222 then calculates a load resistance value based on the predetermined current level and the voltage level when the current reaches the predetermined current level. Further details of the load detection process for an audio jack will be further illustrated with reference to fig. 5 and 6.
After determining the load resistance value of the second connector measured at the second connection terminal set of the first connector, the output channel of the signal generation circuit configured to drive the load of the second connector is set accordingly S350. For example, if the load resistance value measured at a connection terminal is less than a lower threshold value, the connection terminal is determined to be grounded, and the corresponding output channel for driving the load through the connection terminal is set to a high-resistance output mode. If the load resistance value measured at the connection terminal is greater than the upper threshold value, the connection terminal is determined to be electrically floating, and the corresponding output channel for driving the load through the connection terminal is set to a high-resistance output mode or a driving mode. If the load resistance value measured at the connection terminal is between the lower threshold value and the upper threshold value, the corresponding channel for driving the load through the connection terminal is set to the driving mode.
For example, the terminal T is determined to be connected at the top endTPAnd a first ring connecting terminal TR1After the measured load resistance value, the controller 222 configures the output channel of the audio amplifier 244 to the drive mode or the high resistance output mode accordingly.
At S360, an amplification gain for the output signal is set based on the corresponding load resistance value. In some examples, the amplification gain is proportional to the corresponding load resistance value.
For example, the processor 260 sets the amplification gain for each output signal by adjusting a gain setting applicable to the audio codec 242 or a gain setting applicable to the audio amplifier 244, or both.
After S360, the process 300 proceeds to 399 and terminates.
Fig. 4 illustrates an example flow diagram summarizing a pole configuration determination process 400 according to one embodiment of this disclosure. Note that in various embodiments, additional operations are performed before, during, and/or after process 400 depicted in fig. 3. In fig. 4, the pole configuration determination process 400 corresponds to operation S320 of fig. 3, and as a non-limiting example illustrated, the pole configuration determination process 400 is applicable to an audio jack that receives an audio plug. Other types of connectors and corresponding modifications are within the contemplated embodiments.
In some embodiments, process 400 is performed by controller 222, which controls other components of apparatus 200 in fig. 2, and thus detailed descriptions of certain operations may be simplified or omitted. Process 400 begins at S401 and proceeds to S410.
At S410, the initial set of settings is applied to the signal generating circuit to measure the second ring connection terminal, such as connection terminal T of fig. 2, of the inserted audio plugR2The measured voltage value.
For example, controller 222 sets switch 254 to connect the cartridge to terminal TSLAnd ground reference node GNDAElectrically coupling and setting the switch 252 to connect the second ring to the terminal TR2Electrically coupled to node MICIO.
At S415, a test current is applied to the second ring connection terminal. In some examples, the test current is applied by increasing the current level stepwise from zero to a predetermined current level over a predetermined period of time.
For example, the controller 222 controls the current mode DAC232 to apply the test current to the second loop connecting terminal TR2. In some examples, the test current is applied by increasing the current level from zero to 250 μ Α in steps over a period of 40 to 60 ms.
At S420, when the test current reaches a predetermined current level, the second loop connecting terminal T is measuredR2Voltage level (denoted as V in fig. 4)R2). Of an audio plug inserted in correspondence with the second ring connecting terminalThe resistance value is proportional to the voltage level measured when the test current reaches a predetermined current level. In some examples, at the measurement voltage level VR2After that, the current applied to the second ring connecting terminal is reduced to zero.
At S425, an initial set of settings is applied to the signal processing circuit to measure the on-sleeve connection terminal (such as connection terminal T in fig. 2) of the inserted audio plugSL) The resistance value being measured.
For example, the controller 222 sets the switch 254 to connect the second ring to the terminal TR2Is electrically coupled to a ground reference node GNDAAnd a switch 252 is provided to connect the socket to terminal TSLElectrically coupled to node MICIO.
At S430, a terminal T is connected to the socketSLA test current is applied. In some examples, the current is applied by increasing the current level from zero to 250 μ Α in steps over a predetermined period of time.
For example, the controller 222 controls the current mode DAC232 to apply a test current to the socket connection terminal TSL. In some examples, the current is applied by increasing the current level from zero to 250 μ Α in steps over a period of 40 to 60 ms.
At S435, measuring the socket connection terminal T when the test current reaches a predetermined current levelSLVoltage level (denoted as V in fig. 4)SL). The resistance value of the inserted audio plug corresponding to the socket connection terminal is proportional to the voltage level measured when the test current reaches a predetermined current level. In some examples, at the measurement voltage level VSLAfter that, the current applied to the second ring connecting terminal is reduced to zero.
At S440, the measured voltage level VR2And VSLCompared to a first threshold (represented as VTHL in fig. 4). At two voltage levels VR2And VSLWhen both are less than the first threshold value VTHL, the process proceeds to S445, where the connection terminals of the inserted audio plug corresponding to the second ring connection terminal and the sleeve connection terminal are determined to be coupled to the ground reference node. Thus, insert intoIs determined to have a 3-pole configuration (corresponding to cases 9-13 in table 1). In some examples, the first threshold value VTHL is programmable. In some examples, the first threshold VTHL is set to 50 mV.
When at least one voltage level VR2Or VSLEqual to or greater than the first threshold value VTHL, the process proceeds to S450.
At S450, the voltage level VR2Minus the voltage level VSLThe result of (a) is compared with a second threshold (denoted as VTHD in fig. 4). When the result is greater than the second threshold value VTHD, the process proceeds to step S455, where the connection terminal of the inserted audio plug corresponding to the second ring connection terminal is determined to be the microphone offset/signal node, and the connection terminal of the inserted audio plug corresponding to the sleeve connection portion is determined to be coupled to the ground reference node. Thus, the inserted audio plug is determined to have a 4-pole, type I configuration (corresponding to cases 2 and 6-8 in table 1). In some examples, the second threshold VTHD is programmable. In some examples, the second threshold VTHD is set to 100 mV.
When the result is equal to or smaller than the second threshold value VTHD, the process proceeds to S460.
At S460, the voltage level VSLMinus the voltage level VR2The result of (c) is compared with a second threshold value VTHD. When the difference result is greater than the second threshold value VTHD, the process proceeds to step S465, where the connection terminal of the inserted audio plug corresponding to the sleeve connection terminal is determined to be the microphone offset/signal node, and the connection terminal of the inserted audio plug corresponding to the second ring connection terminal is determined to be coupled to the ground reference node. Thus, the inserted audio plug is determined to have a 4-pole, type II configuration (corresponding to cases 1 and 3-5 in table 1).
When the result is equal to or smaller than the second threshold value VTHD, the process proceeds to S470.
At S470, an exception result is reported to indicate that the inserted audio plug does not fall into any one of the 13 predetermined configurations listed in table 1.
After S445, S455, S465, or S470, the process 400 proceeds to S499 and terminates.
Fig. 5 illustrates an example flow chart summarizing a load detection process 500 according to one embodiment of this disclosure. Note that in various embodiments, additional operations are performed before, during, and/or after process 500 depicted in fig. 5. In fig. 5, this load detection process corresponds to S340 in fig. 3 and is applicable to the audio jack receiving the audio plug illustrated as a non-limiting example. Other types of connectors and corresponding modifications are within the contemplated embodiments.
In some embodiments, process 500 is performed by controller 222, which controls other components of apparatus 200 in fig. 2, and thus detailed descriptions of some operations may be simplified or omitted. Process 500 begins at S501 and proceeds to S510.
At S510, a top connection terminal T at an audio jack is measuredTPThe load resistance value of the inserted audio plug (denoted as R in fig. 5)TP). In some embodiments, the controller 222 uses the audio amplifier 244 for driving the top connection terminal TTPTo the top end of the output channel to connect the terminal TTPProviding a test voltage until the terminal T is connected by the top endTPThe current obtained reaches a predetermined current level. In some embodiments, terminal T is connected at the measurement tipTPThe first ring connection terminal T of the audio amplifier 244 is driven in parallel with the resistance valueR1Is set to a high resistance output mode.
At S515, a load resistance value R is determinedTPIf less than a threshold value, such as 4 ohms. If the load resistance value RTPLess than the threshold value, the top terminal T of the inserted audio plug and the audio jackTPThe corresponding connection terminal is determined to be grounded, and the process proceeds to S520. If the load resistance value RTPEqual to or greater than the threshold, the process proceeds to S545.
At S520, a terminal T is connected to a first ring of the audio jackR1To measure the load resistance value of the inserted audio plug (represented as a load resistance value in fig. 5)RR1). In some embodiments, the controller 222 uses the audio amplifier 244 for driving the first ring connection terminal TR1To the first ring to connect the terminal TR1Providing a test voltage until the terminal T is connected by the first ringR1The current obtained reaches a predetermined current level. In some embodiments, terminal T is connected to the first ring under measurementR1For driving the top connection terminal T of the audio amplifier 244 in parallel with the resistance valueTPIs set to a high resistance output mode.
At S525, a load resistance value R is determinedR1If less than a threshold value, such as 4 ohms. If the load resistance value RR1Less than the threshold value, the connection terminal of the inserted audio plug corresponding to the first ring connection terminal of the audio jack is determined to be grounded, and the process proceeds to S530. If the load resistance value RR1Equal to or greater than the threshold, the process proceeds to S540.
At S530, a detection result indicating the top connection terminal T of the inserted audio plug with the audio jack is reportedTPAnd a first ring connecting terminal TR1The corresponding connection terminal is grounded.
At S540, a detection result indicating the connection terminal T with the top end of the inserted audio plug is reportedTPThe corresponding connection terminal is grounded and indicates the first ring connection terminal T of the inserted audio plugR1At the measured load resistance value RR1. The inserted audio plug in this case corresponds to cases 3, 6 or 13 in table 1.
At S545, the top connection terminal T is determinedTPAnd a first ring connecting terminal TR1Whether electrically shorted by an inserted audio plug. For example, the top connection terminal T is determined by a comparatorTPAnd a first ring connecting terminal TR1Whether or not it is electrically shorted. When the top terminal is connected with the terminal TTPAnd a first ring connecting terminal TR1When short-circuited, the first ring connects with the terminal TR1When set to the high resistance output mode, the first ring connection terminal TR1Is also used for driving the roofTerminal connection terminal TTPIs driven by the output channel. Therefore, when the comparator detects the first ring connecting terminal TR1Also by driving the top connection terminal TTPWhen the output channel is driven, the top end connecting terminal TTPAnd a first ring connecting terminal TR1Is determined to be electrically short-circuited by the inserted audio plug, and the process proceeds to S550. If the top terminal T is connectedTPAnd a first ring connecting terminal TR1Is determined not to be electrically shorted, the process proceeds to S560.
At S550, a detection result indicating the top connection terminal T is reportedTPAnd a first ring connecting terminal TR1Is electrically short-circuited and indicates a load resistance value RTPWith a load resistance value RR1The same is true. Because the top terminal T is connectedTPAnd a first ring connecting terminal TR1Electrically short-circuited, inserted audio plugs thus correspond to cases 4, 7 or 12 in table 1.
At S560, a first ring connection terminal T at the audio jack is measuredR1Load resistance value R of the inserted audio plugR1。
At S565, a load resistance value R is determinedR1If less than a threshold value, such as 4 ohms. If the load resistance value RR1Less than the threshold, the first ring of the audio plug and the audio jack connecting terminal TR1The corresponding connection terminal is determined to be grounded, and the process proceeds to S570. If the load resistance value RR1Equal to or greater than the threshold, the process proceeds to S580.
At S570, a detection result indicating that the audio plug is inserted with the first ring connection terminal T is reportedR1The corresponding link terminal is grounded and indicates the terminal T connected at the top end of the inserted audio plugTPMeasured load resistance value RTP。
At S580, a detection result indicating the connection terminal T at the top end of the inserted audio plug is reportedTPMeasured load resistance value RTPAnd the first ring connection terminal T of the inserted audio plugR1Department surveyLoad resistance value R of the quantityR1. The inserted audio plug thus corresponds to case 1, 2, 5, 8, 9, 10 or 11 in table 1.
After S530, S540, S550, S570, or S580, the process 500 proceeds to S599 and terminates.
An example measurement circuit for measuring a load resistance value, such as operations S510, S520, or S560, is illustrated with reference to fig. 6.
Fig. 6 illustrates an example schematic diagram of a measurement circuit 600 according to one embodiment of this disclosure. The measuring circuit 600 includes a connection terminal (T) for connection with a test being performed at presentTPOr TR1) An amplifier 610, a current comparator 620, and a load resistance device 630 for the corresponding output channel, the load resistance device 630 representing a device coupled to the connection terminal (T) currently under testTPOr TR1) A load inserted into the audio plug. In some embodiments, amplifier 610 and current comparator 620 are implemented in audio amplifier 244. The same or similar components in fig. 6 as those of fig. 2 are given the same reference numerals, and thus detailed description is omitted.
In one embodiment, amplifier 610 includes an operational amplifier 612 and an output stage including transistors 614 and 616. The amplifier 612 includes a non-inverting input terminal 612a, an inverting input terminal 612b, and an output terminal 612 c. Non-inverting input terminal 612a is configured as slave bus AUDIOAAn analog signal is received. The inverting input terminal 612b is configured to be connected to the corresponding connection portion TTPOr TR1Electrically coupled. Output terminal 612c is electrically coupled to a gate terminal of transistor 614. Transistors 614 and 616 in the supply line VSUPPWith corresponding connecting portion TTPOr TR1Are coupled in series. The gate terminal of the transistor 616 is configured to receive a bias voltage VB。
In some examples, the audio amplifier 244 of fig. 2 includes N amplifiers 610, one for each of N output channels, where N is a positive integer. In some examples, the audio amplifier 244 includes only one current comparator 620 shared by the N amplifiers 610. In some examples, the audio amplifier 244 includes more than one current comparator 620 shared by the N amplifiers 610. In at least one example, audio amplifier 244 includes N current comparators 620, one for each of N amplifiers 610.
During sense mode, amplifier 610 is coupled to bus AUDIOAReceiving a test voltage signal V at a non-inverting input terminal 612aTESTAnd mirrors the voltage level at non-inverting input terminal 612a to inverting terminal 612 b. In some examples, the test voltage is applied by increasing the voltage level stepwise from zero to a predetermined voltage level over a predetermined period of time. For example, the voltage level is increased from 0V to 250mV in 0.5mV per step over a duration of 100 ms.
The current comparator 620 is included in the power supply line VSUPPAnd transistors 622 and 624 connected in series with node Nc. The current comparator 620 also includes a reference current source 626 and an inverter 628 coupled to the node Nc. A gate terminal of transistor 622 is electrically coupled to a gate terminal of transistor 614. A gate terminal of transistor 624 is electrically coupled with a gate terminal of transistor 616. Transistors 622 and 624 are configured to draw a current I from a load 630LOADMirroring to a test current I at a predetermined ratio MTEST. Test current ITESTAnd a reference current I generated by a reference current source 626REFContend to pull the voltage level at the input terminal of the inverter 628 (e.g., at the node Nc) to a logic high level or a logic low level. When testing the voltage signal VTESTWhen the voltage level of (1) is gradually increased, the test current ITESTAnd (4) increasing.
Inverter 628 is configured to test current ITESTLess than the reference current IREFOutputs a high logic level and tests the current ITESTIs equal to or greater than the reference current IREFThe ground logic level is output. The output of inverter 628 is transmitted to controller 222 via bus TOGGLE. Once the output of inverter 628 is switched from a logic high level to a logic low level, controller 222 calculates the resistance value of load 630 as VTOGGLE/M·IREFIn which V isTOGGLEIndicating a test signal when the logic state of the output of the inverter changesVoltage level V ofTEST。
While aspects of the present disclosure have been described in conjunction with specific embodiments given as examples, alternatives, modifications, and variations to these examples may be made. Thus, the embodiments set forth herein are intended to be illustrative and not limiting. Changes may be made without departing from the scope of the claims as set forth below.