NRF5340 with PDM

HI,

 We are using the IM69D120 PDM mic for our audio application. I am able to interface the MIC and record audio with the NRF5340. 

       I have read the PDM data and stored it in an external SRAM connected through SPI. Then I read the data from SRAM and transferred it through BLE and captured the data with the help of the python app.

1) Test Case 1:  PIN mapping.

      At first, I connected the SRAM Pin to port 0 pins. I can get clear audio. But, I changed the SRAM pins to port 1 I can't be able to get the clear audio. The output audio has a clipping sound randomly.

      1) why is the audio coming correctly with port 0 pins alone? why it is not coming with port 1 pins? 

       2) Is there any configurations there to make it work with port 1 pins?

  2) Test Case 2: Zephyr timer and thread.

          Once I started using timer and thread in the same project. Again, I am not getting the non-quality audio.

           1) I need to know if this is because of zephyr. Because I have read the zephyr documentation (https://docs.zephyrproject.org/2.6.0/boards/arm/nrf5340dk_nrf5340/doc/index.html)

                in this documentation, the PDM is not listed in the zephyr supported hardware features list. 

Thanks & Regards

Navin

  • Hi @Mr.NCK and @Kenneth,

    Sorry to bring up this old thread, but I am currently working on a very similar PDM audio setup on nRF5340 and I’m really interested in the final outcome of this case.

    From this discussion it looks like:
    - You were able to interface the IM69D120 PDM mic with the nRF5340, store the PDM data in external SRAM over SPI and send it over BLE.
    - You got clear audio when the SRAM was connected to Port 0 and when you did not use additional timer/thread.
    - When you moved the SRAM pins to Port 1, or when you started to use a Zephyr timer and an extra thread, you began to hear random clipping in the audio.

    I would like to ask a couple of follow-up questions:

    1. Did you finally manage to solve the clipping issue and get stable audio on nRF5340 (especially for the Port 1 + timer/thread case)?
    - If yes, was the root cause related to network core pin assignment, thread/timer priorities, buffer sizes, nRF Connect SDK version, or something else?

    2. Were there any specific changes you made in devicetree, Kconfig, PDM configuration, or the way you handled the PDM/ISR threads that were important to make the audio clean?

    3. If you have a small example project or can briefly describe the key steps of your working configuration, would it be possible to share it (even in a simplified form)?

    For context, my current setup is:

    - Board: nRF5340 Audio DK (PCA10121)
    - SoC: nRF5340
    - External PDM microphone: ST MP45DT02
    - nRF Connect SDK: v2.5.2
    - Goal: reliable PDM audio capture on nRF5340, and later feeding this PDM audio into the `nrf5340_audio` (Walkie Talkie) application as the audio source.

    Even a short summary of what worked and what did not work in your case would be extremely helpful.
    Thank you very much for your time and for any hints you can share!

    Best regards,
    LjHuang

Related