• Resolved

TLV320DAC3203: PDM microphone data go through TLV320DAC3203 to MCU issue

Part Number: TLV320DAC3203

Dear sir,

I am a new user for audio codec TLV320DAC3203 using, we are using TLV320DAC3203 (by pin 6 for data and pin 9 for clock) to collect ultrasonic signal (20K~80KHz) from PDM microphone SPH0641LU4H-1 and use TLV320DAC3203 by I2S interface to connect to Micro-controller, how can I transfer the PDM data signal to PCM data signal to micro-controller by using the Decimation filters in TLV320DAC3203? The ultrasonic signal frequency from SPH0641LU4H-1 can be 20K~80K. Which filter I should use for and could you show some example code to me and see how to fix this issue? Thanks.

Best Regards!

Tyler

  • Hello, Tyler!

    Welcome to E2E and thank you for your interest in our products!

    In order to configure the TLV320DAC3203 you would require to configure the PLL and clock dividers to get at least 96KHz of sampling rate. In addition, you may select decimation filters A and B with an AOSR = 64 or decimation filter C with and AOSR = 32. These configuration are specially designed for high sampling rates. So, ultrasonic signals could be supported.

    I attached an example that takes the digital microphone signal from the same pins that you require. It converts the PDM signal into I2S data. Please take a look at it and let me know if you have additional questions or comments.

    Digital Microphone 96KHz.txt

    I hope this helps!

    Best regards,
    Luis Fernando Rodríguez S.

  • In reply to Luis Fernando Rodríguez S.:

    Hi Luis Fernando Rodríguez S.

    Sorry to response a little late, just came back to office. Thank you very much for your very useful information. And for this digital microphone 96KHz example code you attached, I have another several questions which are not clear to me, sorry for that, I am a new comer for this codec TLV320DAC3203.  

    1. From current ultrasonic microphone Spec, we will get the maximum frequency 80KHz signal(the signal frequency range is 20KHz~80KHz), that means we have to set at least 192KHz (WCLK) of sampling rate in TLV320DAC3203, not 96KHz, right?

    2. If we set the 192KHz sampling rate in TLV320DAC3203, we also need to select the decimation filters A and B with an AOSR = 64 or decimation filter C with and AOSR = 32 like this or we have to change to other AOSR value? Could you help to point out this?

    3. And for below filter in example code, it seems that it is 80Hz High-pass first order Butterworth2 filter. But for me as we will get the 20KHz~80KHz frequency signal from this digital microphone, how should I design this filter? Yes, I saw you set the AOSR=64 in the example code, but this only setting AOSR=64 is not enough for my design, we have to design a filter which meet 20KHz~80KHz frequency signal, right?

    ################################################
    # High-pass first order Butterworth2 filter,
    # fc = 80 Hz
    ###############################################
    #
    # Write to Buffer A:
    #
    # BIQUAD A, Left Channel (Page 8, Register 36, C7-C11)
    w 30 00 08
    w 30 24 7E F8 EB 00 81 07 15 00 7E F8 EB 00 7E F7 DD 00 82 0C 0C 00
    #
    # BIQUAD A, Right Channel (Page 9, Register 44, C39-C43)
    w 30 00 09
    w 30 2c 7E F8 EB 00 81 07 15 00 7E F8 EB 00 7E F7 DD 00 82 0C 0C 00
    #
    # Write to Buffer B:
    #
    # BIQUAD A, Left Channel (Page 26, Register 36, C7-C11)
    w 30 00 1A
    w 30 24 7E F8 EB 00 81 07 15 00 7E F8 EB 00 7E F7 DD 00 82 0C 0C 00
    #
    # BIQUAD A, Right Channel (Page 27, Register 44, C39-C43)
    w 30 00 1B
    w 30 2c 7E F8 EB 00 81 07 15 00 7E F8 EB 00 7E F7 DD 00 82 0C 0C 00
    #
    ###############################################

    Sorry for my so many questions, although I am new, but I have to find out how I can TLV320DAC3203 work correct with MCU from digital microphone signal from 20KHz~80KHz.

    We wish we can get the help from you soon. Have a good weekend!

    Best Regards!

    Tyler

  • In reply to user5369141:

    Hi, Tyler,

    1. From current ultrasonic microphone Spec, we will get the maximum frequency 80KHz signal(the signal frequency range is 20KHz~80KHz), that means we have to set at least 192KHz (WCLK) of sampling rate in TLV320DAC3203, not 96KHz, right?

    You are right, a 96KHz sampling rate won't be capable to sample correctly the ultrasonic signals at that frequency. So, the 192KHz clock will be required.

    2. If we set the 192KHz sampling rate in TLV320DAC3203, we also need to select the decimation filters A and B with an AOSR = 64 or decimation filter C with and AOSR = 32 like this or we have to change to other AOSR value? Could you help to point out this?

    I would recommend to select the Decimation filter C with an AOSR = 32. This configuration is specific for sampling rates of 192KHz.

    3. And for below filter in example code, it seems that it is 80Hz High-pass first order Butterworth2 filter. But for me as we will get the 20KHz~80KHz frequency signal from this digital microphone, how should I design this filter? Yes, I saw you set the AOSR=64 in the example code, but this only setting AOSR=64 is not enough for my design, we have to design a filter which meet 20KHz~80KHz frequency signal, right?

    The digital filters included in the code that you mentioned are only used to eliminate the DC components that may be included in the digital microphone signal. We recommend to have this filter in your configuration. If you are looking to isolate the specific range of frequencies too, you may include more filters in you signal path. We recommend to take a look at our TI Biquad Coefficient Calculator Tool: http://www.ti.com/tool/COEFFICIENT-CALC. This tool helps to get the coefficients that may be included in you configuration.

    Please feel free to ask for additional information or comments. We will be glad to help you.

    Best regards,
    Luis Fernando Rodríguez S.