PDM on 5430 at 3.072MHz random glitches in the stream

Hi,

we have created a new product prototype where audio streaming is the functionality. 2 different HW revisions were so far built, the software originally is built to use a PDM to I2S converter chip, but now we had a chance to investigate the direct recording from the PDM microphones. The format we are using is 48Khz sampling 16bit stereo. This is working perfectly on I2S. However we have noticed weird behavior on the direct PDM recording. 

We managed to create the code to use the microphones, the limitations be:

PDM clock is at 3.072 MHz (as 64X @ 48K) and ACLK clock source at 12.288 MHz. This yields the proper sampling speed. However it seems that the rising edge of the clock is glitchy at random intervals (we can't identify whether this  means 0 samples or some other bit errors, the glitch repeat at around 100ms intervals sounds like static clicking with varied amplitude). We have tested 3 boards and swapped the microphones from left to right to check that it is not the routing on the pcb or the microphones. Glitch stayed always on the rising clock edge. We even tried different IO voltages to rule that out as well 1.8V and 2.3V were tried.

Interestingly the falling edge sampling of the clock works perfectly. (we have muted the other channel to see).

What worked but not usable for us:

- change PDM clock source to 32MHz but this yields sampling rate of 50kHz
- change sampling rate to 24kHz -> this yielded 1.536MHz PDM clock and that ran again fine with the 12.288MHz ACLK source. 

So it seems that the glitch exists only on that one specific frequency (that we need of course). Our codec only allows 48/24/16/12/8 kHz sampling, so we can't try the 44.1kHz related frequencies.

Is there any known issues around this ACLK being 12.288MHz, and PDM clock at 3.072 MHz? Why does it only affect the rising clock edge? Is there anything we can do to make it work, or our best option is to go with the working speed of 24kHz audio sampling and 1.536MHz PDM clock?

Thank you 

Levente

Parents Reply Children
  • Interesting, hmm. In the meanwhile we have ordered the same microphones, so will test with those as well. Also I have created a 16kHz version of the code, to use that unfortunately you have to patch zephyr as well, since they have hard coded the 48kHz sampling rate for the usb audio endpoint, but I have included the patch in the zephyr-patch directory. offcode-oy/nordic_pdm_test at 16kHz (github.com)

    What is interesting, that works flawlessly with the same setup, where the 48k glitches.

    And as it was mentioned way above, we have configured the PDM3140 (PDM to PCM converter) to output the same 3.072Mhz as the 48k example code does, that recorded though the i2s was correct (hinting that , there is a difference how NRF converts the PDM and how the TI chip does it). 

    So somehow you should recreate the same problem on your end so you can try the suggested hidden register changes, if any of those help. We can send you the microphone board you can plug to your DK if that helps. Slight smile

    Some scope pics:

    16kHz high pin drive

    48kHz high drive

    48kHz normal drive (original code)

    As you can see we have changed also the pin drive strength to reduce the rise/fall times, since our microphones have a specified maximum 12ns (your ST microphones didn't specify that) and even the high drive is slightly out at 14-15ns. I don't have a measurement of that from the PDM3140 yet, and I think it shouldn't really matter, but who knows. This is still an unverified action point for me, because if I cannot reach the desired rise/fall times, I'll have to add more hardware to the board to test.

    Levi

  • Hi Levi Slight smile

    I have received your hardware and am looking into this. It would be great if you could mention here a short version of what the current issue is so that I can confirm it here.

    Do let me know and in the meantime I will catch up with the previous works that we have discussed here in the ticket as it's been a long time Smiley

    Hoping to hear from you.

    -Priyanka

  • Hey Priyanka, Slight smile

    I have jumped on the opportunity to address this one more time when they guys visited us. So the way we have worked around currently is not to use 48k sampling on the pdm, but rather 16k. This cost us in SNR 3-5dB.

    The problem is with those microphones I sent you (we have those on our hardware versions since the v1.0) is that when PDM is used from the NRF5340 with 48k 16bit stereo (like the usb audio example does), one of the channels has a continuous random clicking noise (bad samples). The github repo above was the most minimalistic example I created, works with the nrf5340 dk and shows the symptoms on the usb audio recording. Same mics were unaffected in the same mode when external converters were used to PDM 2 I2S, we even used on 2 separate builds - 2 different converters, none showed this behavior.

    You tested it with the steval-mic005 microphones, and those worked for you.

    This is pretty much where I didn't have time unfortunately to continue, since we had to move forward.

    I hope you'll be able to reproduce the problem because then I am sure you'll have a fix, as above you had some links to internal information that could have been tried, but since we have no access to that only you'll be able to test those, and maybe let us know a quick fix Slight smile

    If you need anything else, just let me know.

    Levi

Related