This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Enable Headset/Mic detection on TLV320AIC3105?

Other Parts Discussed in Thread: TLV320AIC3105

Hi all,

i'm using audio codec TLV320AIC3105 on iMX6 platform. Now it can puts sound to HPLOUT, HPROUT and R/L LO (external speasker). 

Now i want to use MIC_DET to detection headphone plugged, when playing, if plug headphone, the sound will be muted on external speaker and route to headphone only.

In datasheet i see only one Register 14 to use to config "Headset/Button Press Detection Register B", while Register 13 is Reserved! . Unlike some other codecs as 3104, 3107, they have Register 13 to config Enable Headset Detection.

In my case, i config Mic_Bias (register 25 = 0xC0) = AVDD, when unplug headphone, i measure MIC_DET pin: 3235 mV (= MIC_BIAS pin), when plug headphone (with mic): MIC_DET = 3005mV

But with headphone plugged, both speaker and headphone has sound!

My  diagram:

Mic pin (headphone) -> MIC3L/LINE3L/MIC_DET -> Resistor 1K -> MIC_BIAS

Mic pin (headphone) -> capacitor -> MIC1L/LINE1L

How do i config for this?

Thanks!

BG/Hai

  • Hai,

    Take a look at Register 96. This is the sticky interrupt flags register, and D2 is the headphone detection status flag. Your micro-controller will need to poll this register, and it will need to send a command to turn off the headphones. The AIC3104 will not automatically shut off the headphones.

    best regards,
    -Steve Wilson
  • Hi Steve,

    thanks for your suggestion!

    i check Register 96 then value = 0x04 (D2 = 1 - Headset insertion detected).

    As you mention, i have to poll this register (this is an inconvenience), and send command to turn off speaker. By other way, we can use gpio interrupt of micro-controller to detect headphone insertion and send command to TLV codec to turn off speaker...

    So, all of the AIC31xx codec doesn't automatically shut off the speaker/headphones when detect insert/remove headphone?

    Thanks!

    Regards,

    Hai

  • Hai,

    These devices are intended to be very flexible, there are many different output routing options and not every application would want the same output turned off when headphones were detected, or it may need to change depending on other factors. Alternately for some applications the output wouldn't need to be turned off, but the user needs to be prompted, or a sound triggered. This feature has many uses beyond turning off the speaker when the headphones are plugged in. This flexibility enables you to make important UI decisions rather than being forced to use a preset option.
    Polling the register should have a very negligible impact on your system.

    best regards,
    -Steve Wilson
  • Hi Steve,

    thanks for your explanation.

    BR/Hai.
  • You're welcome Hai. I'm happy to help. Please let me know if you have any further questions.

    best regards,
    -Steve