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.

How to enable Analog Mic for OMAP 4430 on interfaced with Main Mic.

Other Parts Discussed in Thread: TWL6040, DM3730, TPS65950

Hi all,

On OMAP4 platform We are using Analog Mic and it is connected to TWL 6040 Main Mic interface.
3.7 volt supply is given at VDDABIAS pin.we are not getting 2.3 volt at MBIAS pin.
Niether we are receiving any signals on the pins MMICP nor MMICN,

How to configure MBIAS pin??

How do we enable Main Mic working??
We are testing the MIC by running sound recorder, we are not receiving the signals on this pins.

Please help me regarding this.

Thanks

Abhijit



  • That is because you are not turning on the LDO that goes to MBIAS pin.

    Turn on MBIAS by setting bit MMICBENA in the AMICBCTL register.

  • To enable the LDO we are writing these values in the registers,

    TWL6040_REG_MICLCTL = 0x0F
    TWL6040_REG_MICRCTL = 0x0F
    TWL6040_REG_MICGAIN = 0x24
    TWL6040_REG_AMICBCTL = 0x1B

    Even after writing these values we are not getting voltage on MBIAS.

    Is these register values written are correct to turn on the LDO ?
     
            res = twl6040_write(codec,TWL6040_

    REG_MICLCTL,0x0F);
            res = twl6040_write(codec,TWL6040_REG_MICRCTL,0x0F);
            res = twl6040_write(codec,TWL6040_REG_MICGAIN,0x24);
            res = twl6040_write(codec,TWL6040_REG_AMICBCTL,0x1B);

    Are we making any mistake here?
    Suggest us to where to add these code?
    Looking forward for your reply.
    Thanks
    Abhijit
  • To test twl6040 mic I set all this values:

    omapconf twl6040 write NCPCTL 0x81
    omapconf twl6040 write LDOCTL 0x45
    omapconf twl6040 write LPPLLCTL 0x01
    omapconf twl6040 write ACCCTL 0x01
    omapconf twl6040 write AMICBCTL 0x10
    omapconf twl6040 write MICLCTL 0x0D
    omapconf twl6040 write MICGAIN 0x00

    Are you missing any?

    the codec is at sound/soc/codec/twl6040.c in kernel

  • 6087.Mic_log.txt

    Israel

    We have written the register values as mentioned, Once the kernel comes up we are not able to see the voltage on MBIAS pin. We observe that when we write these values we are able to see the voltage is going high on this pin, and comes back to low, We think Power Management for TI may be resetting this LDO? Are there any modules which can reset these registers?

    Please find the log attached.

    Awaiting your response.

    Thanks

    Abhijit

  • There are two possible causes for this:

    1) The audio driver turns it off when it is not needed. If the system boots and then you set the values using something like omapconf it should continue turned on, but if you use an application that tries to record and then close it it will turned off again. All this is calling the driver in the Audio HAL.

    2) You are causing a "short circuit". TWL6040 bias has short circuit protections, when it detect something is consuming more current that in the specifications, it will turn it off (See AMICBCTL register bit HMICBSCDIS:3). You can disable that protection, but it is not recommended. If you need more power, you can use the external bias to boost the LDO. See:

    4.2 Microphone Bias Outputs
    Two LDOs provide an external voltage of 2.1 V to bias analog microphones (MBIAS and HBIAS). The
    maximum output current is 2 mA for each analog bias, allowing up to two microphones on one bias. Full
    PSR performance is not ensured when the battery voltage is less than 2.5 V. If full performance must be
    maintained down to the minimum battery level, the supply of these two LDOs can be connected to an
    external boost, also used for other functions.

  • Hi  Israel,

    After setting the values mentioned above we are able to get the voltage on MBIAS pin when we start the recorder application.

    But we are not seeing any voltage variations on MMICP and MMICN pins, moreover we are not able to listen any thing from MIC.

    Will there be any voltage fluctuations on these pins or not while recording?

    Do we foresee any hardware MIC issue here, or do we have to do some more configuration with respect to software for getting the MIC work (Since the voltage is coming on the MBIAS pin )

    Really stuck on this, looking forward for your inputs.

    Thanks

    Abhijit

  • Hi Abhijit,

    Are you measuring the voltage between MMICP and MMICN?, there should be some variations if you have your circuit connected correctly.

    The theory is that with the bias you are powering your circuit, then you are able to get some signals in the MMICP/N pins due to the variation on the air pressure in the mic, that signals goes inside the TWL6040 where is amplified and the analog to digital conversion is carried out.

  • Hi Israel,

    We are getting the MBAIS voltage but we are not getting the default 1.8 DC voltage high on the MMICP pin, Do we have to configure any registers to get the voltage on this pin also?
    We checked on the BLAZE board and we are getting the 1.8 Volt DC on MMICP.(Our board is the reference of blaze board)
    Or just MBIAS voltage configuration is enough to get the voltage on MMICP pin.

    Looking forward for your response.

    Thanks
    Abhijit

  • Hi Abhijit,

    MMIP pin is an input, so the voltage you are seeing there is because the external circuitry in the blaze, the way how all this pins are connected is basically with some resistors and capacitors to power the MIC using MBIAS, and from there get some lines that go to MMICP/N pins, those lines has some offset value if you take GND as reference, but what TWL6040 cares is the voltage variation between these pins. For example and values of the external components is better to take a look into TWL6040 datasheet.

  • Hi Israel,

    Finally Mic is working for us .

    Thanks a lot for your valuable inputs.

    Abhijit

  • Hi Abhijit,

    Good to read that it is working now. Was it the connection?

    Also, can you please verify the answer?, that will help us to focus on the post are not resolved yet. Thanks

  • Israel,

    There was a connection problem but your register values helped a lot.

    Abhijit

  • Hi Israerl/Abhijit/All,

    I am working on DM3730 processor. I need to enable Mic and record voice data.

    My speaker is working fine. Speaker and Mic both are connected to TPS65950 chip.

    I am using the following command to enable speaker

    amixer cset name='HeadsetL Mixer AudioL2' off
    amixer cset name='HeadsetR Mixer AudioR2' off
    amixer set HandsfreeL on
    amixer set HandsfreeR on
    amixer set 'HandsfreeL Mux' AudioL2
    amixer set 'HandsfreeR Mux' AudioR2

    then aplay file.wav .

    Plz help me what is the command to enable Mic and playback recorded data again.

    Regards

    Vidya.

  • Hi Vidya,

    The audio architecture in omap3 is different to the one in omap4, it would be better if you ask in an omap3 forum where there is people that can help you.

    http://e2e.ti.com/support/dsp/omap_applications_processors/f/447.aspx