<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Single PDM microphone at higher PCM sampling rate</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/15150/single-pdm-microphone-at-higher-pcm-sampling-rate</link><description>Hello, 
 we need to feed mono audio data into the nRF52 and we are now evaluating the possibility to use PDM. The nRF52 seems to have a useful PDM interface , and even though an example does not seem to exist in the SDK [what a pity!], there is a PDM</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 09 Jun 2021 07:38:34 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/15150/single-pdm-microphone-at-higher-pcm-sampling-rate" /><item><title>RE: Single PDM microphone at higher PCM sampling rate</title><link>https://devzone.nordicsemi.com/thread/314360?ContentTypeID=1</link><pubDate>Wed, 09 Jun 2021 07:38:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:33387e2b-aa64-451b-bf7b-38b69e6cfcb7</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;/p&gt;
&lt;p&gt;It seems you are getting help from Audun already in the case. He has a lot of audio experience, and should be the right person to help you out with this &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Single PDM microphone at higher PCM sampling rate</title><link>https://devzone.nordicsemi.com/thread/313968?ContentTypeID=1</link><pubDate>Mon, 07 Jun 2021 14:15:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c0c5ad24-b91e-405a-a0fc-904e57e5e911</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Nikhil&lt;/p&gt;
&lt;p&gt;This thread is quite old by now. If you are having issues getting the PDM to work I suggest you summarize what you have tried and the issues you are facing in a new Devzone case, and we can look into it.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Single PDM microphone at higher PCM sampling rate</title><link>https://devzone.nordicsemi.com/thread/269869?ContentTypeID=1</link><pubDate>Wed, 16 Sep 2020 12:38:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5a004bd6-057d-4cb3-8fd0-655377f52740</guid><dc:creator>NewtoM</dc:creator><description>&lt;p&gt;The question is, how the register settings relate to the possible DIVs. E.g.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;#define DIGITAL_AUDIO_SAMPLING_RATE_15625 (0x08000000UL)&amp;nbsp;&amp;nbsp;&amp;nbsp; // (32 MHz / 32)&amp;nbsp; / 64 &lt;br /&gt;#define DIGITAL_AUDIO_SAMPLING_RATE_16129 (0x08400000UL)&amp;nbsp;&amp;nbsp;&amp;nbsp; // (32 MHz / 31)&amp;nbsp; / 64 &lt;br /&gt;#define DIGITAL_AUDIO_SAMPLING_RATE_16667 (0x08800000UL)&amp;nbsp;&amp;nbsp;&amp;nbsp; // (32 MHz / 30)&amp;nbsp; / 64 &lt;br /&gt;#define DIGITAL_AUDIO_SAMPLING_RATE_20000 (0x0A000000UL)&amp;nbsp;&amp;nbsp;&amp;nbsp; // (32 MHz / 25)&amp;nbsp; / 64 &lt;br /&gt;#define DIGITAL_AUDIO_SAMPLING_RATE_31250 (0x10000000UL)&amp;nbsp;&amp;nbsp;&amp;nbsp; // (32 MHz / 16)&amp;nbsp; / 64 &lt;br /&gt;#define DIGITAL_AUDIO_SAMPLING_RATE_33333 (0x11000000UL)&amp;nbsp;&amp;nbsp;&amp;nbsp; // (32 MHz / 15)&amp;nbsp; / 64 &lt;br /&gt;#define DIGITAL_AUDIO_SAMPLING_RATE_45455 (0x16000000UL)&amp;nbsp;&amp;nbsp;&amp;nbsp; // (32 MHz / 11)&amp;nbsp; / 64 &lt;br /&gt;#define DIGITAL_AUDIO_SAMPLING_RATE_50000 (0x18000000UL)&amp;nbsp;&amp;nbsp;&amp;nbsp; // (32 MHz / 10)&amp;nbsp; / 64 &lt;br /&gt;#define DIGITAL_AUDIO_SAMPLING_RATE_62500 (0x20000000UL)&amp;nbsp;&amp;nbsp;&amp;nbsp; // (32 MHz / 8)&amp;nbsp;&amp;nbsp; / 64&lt;/p&gt;
&lt;p&gt;So, say, if I wanted 4000 Hz sampling rate (i.e. 256000 Hz PDM frequency), what would be the register value? 0x... ? And why?&lt;/p&gt;
&lt;p&gt;Thanks,&lt;br /&gt;Tamas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Single PDM microphone at higher PCM sampling rate</title><link>https://devzone.nordicsemi.com/thread/262489?ContentTypeID=1</link><pubDate>Fri, 31 Jul 2020 05:08:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4487ec10-d685-4eac-b48a-a4f1059d2490</guid><dc:creator>Yonghun Song</dc:creator><description>&lt;p&gt;Hi, I&amp;#39;m Song&lt;/p&gt;
&lt;p&gt;Now I&amp;#39;m using knowles microphone to analyze voice.&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t know how to access PCM data.( easyDMA )&lt;/p&gt;
&lt;p&gt;So, It would be great if you could share the code...&lt;/p&gt;
&lt;p&gt;thank u.&lt;/p&gt;
&lt;p&gt;- Song&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Single PDM microphone at higher PCM sampling rate</title><link>https://devzone.nordicsemi.com/thread/257238?ContentTypeID=1</link><pubDate>Sat, 27 Jun 2020 22:28:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:581fe60f-6cda-4294-ae1f-b332f5e98c80</guid><dc:creator>mkimhj</dc:creator><description>&lt;p&gt;32000000 / (DIV * 64) = Sampling Rate&lt;/p&gt;
&lt;p&gt;To get the PDM frequency:&lt;/p&gt;
&lt;p&gt;32000000 / DIV&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Single PDM microphone at higher PCM sampling rate</title><link>https://devzone.nordicsemi.com/thread/257237?ContentTypeID=1</link><pubDate>Sat, 27 Jun 2020 21:34:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f6e68d80-ed90-4d1e-bd40-13d0cd1a69bf</guid><dc:creator>NewtoM</dc:creator><description>&lt;p&gt;Hi Ole,&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve seen a few more PDM frequencies added to the nRF5 SDK v16.0.0, which is good. Back in the day I used an oscilloscope to measure PDM clock frequencies and document the register setting for the given divisor. I still wonder, though, what is the closed equation for the relation between the register value and the PDM clock speed (or clock divider)? Can you provide me that?&lt;/p&gt;
&lt;p&gt;Thanks,&lt;br /&gt;Tamas&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Single PDM microphone at higher PCM sampling rate</title><link>https://devzone.nordicsemi.com/thread/245107?ContentTypeID=1</link><pubDate>Fri, 17 Apr 2020 01:38:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2c5de1df-dae7-4748-8c19-06f86b7b08fc</guid><dc:creator>mkimhj</dc:creator><description>&lt;p&gt;I&amp;#39;m putting together a project right now with a single PDM mic and the nRF52832 and found your post super helpful.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m struggling a bit because there was no example provided by the SDK, would you be willing to share your source code?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Single PDM microphone at higher PCM sampling rate</title><link>https://devzone.nordicsemi.com/thread/244762?ContentTypeID=1</link><pubDate>Wed, 15 Apr 2020 14:00:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:00942914-64f2-4a0e-abbd-46bf1b35906c</guid><dc:creator>NewtoM</dc:creator><description>&lt;p&gt;Production no, but everyday use within ca. 10 instances for testing and experiments in an R&amp;amp;D setting. No problems so far.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Single PDM microphone at higher PCM sampling rate</title><link>https://devzone.nordicsemi.com/thread/234973?ContentTypeID=1</link><pubDate>Tue, 18 Feb 2020 15:04:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2ca4a04f-5108-4cd2-ade3-28cc4e84eda8</guid><dc:creator>dav01</dc:creator><description>&lt;p&gt;curious if this was ever used in production? did you find it stable to run @ higher speeds?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Single PDM microphone at higher PCM sampling rate</title><link>https://devzone.nordicsemi.com/thread/200941?ContentTypeID=1</link><pubDate>Mon, 29 Jul 2019 11:23:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ac329792-0efd-49ec-9b1f-ce6fcb2d1ffa</guid><dc:creator>sara</dc:creator><description>&lt;p&gt;hello NewtoM, can you help with the handling PDM data :&amp;nbsp;&lt;strong&gt;&amp;quot;&lt;/strong&gt;&lt;span&gt;&lt;strong&gt;streamed the PDM data out through UART to finally analyze it on a PC.&lt;/strong&gt;&amp;quot;&amp;nbsp; Can u guide me with it ?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Single PDM microphone at higher PCM sampling rate</title><link>https://devzone.nordicsemi.com/thread/57840?ContentTypeID=1</link><pubDate>Wed, 07 Sep 2016 13:19:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ab6f6e90-bfb2-4a65-955c-2c70b0d562b3</guid><dc:creator>NewtoM</dc:creator><description>&lt;p&gt;With the PDM microphone I tested I get nice results up to 28 KHz.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Single PDM microphone at higher PCM sampling rate</title><link>https://devzone.nordicsemi.com/thread/57839?ContentTypeID=1</link><pubDate>Wed, 07 Sep 2016 13:08:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2a268ea1-2280-4f70-b160-fb2531025993</guid><dc:creator>eufinger</dc:creator><description>&lt;p&gt;Hi,
I have similar plans for the PDM Interface and would like to ask you if you have any experience if the bandpass filter is sufficient for these higher frequencies? Because it is designed for a 16kHz output, due to this I assume the the passband is an a range of 10 to about 8kHz.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Single PDM microphone at higher PCM sampling rate</title><link>https://devzone.nordicsemi.com/thread/57838?ContentTypeID=1</link><pubDate>Thu, 18 Aug 2016 11:45:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c2799e8c-6125-4a4c-8f9d-fa2a58d4030d</guid><dc:creator>NewtoM</dc:creator><description>&lt;p&gt;Hi Ole,&lt;/p&gt;
&lt;p&gt;thanks for the reply. It helps a lot. We will do some stress testing at our side and then see how we proceed.&lt;/p&gt;
&lt;p&gt;Thanks again!
NewtoM&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Single PDM microphone at higher PCM sampling rate</title><link>https://devzone.nordicsemi.com/thread/57837?ContentTypeID=1</link><pubDate>Thu, 18 Aug 2016 11:26:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6e9ba63b-f48c-49f2-b9ef-17bcfd188d25</guid><dc:creator>Ole Bauck</dc:creator><description>&lt;p&gt;Hi NewtoM,&lt;/p&gt;
&lt;p&gt;You are correct, the PDM peripheral is designed to work with higher frequencies. The reason this is not stated in the datasheet is because it has not been throughly tested on our side. For this reason &lt;strong&gt;we cannot guarantee that it will work with higher frequencies&lt;/strong&gt;, especially across varying temperatures and voltages.&lt;/p&gt;
&lt;p&gt;Hope this helps,&lt;/p&gt;
&lt;p&gt;Ole&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Single PDM microphone at higher PCM sampling rate</title><link>https://devzone.nordicsemi.com/thread/57836?ContentTypeID=1</link><pubDate>Wed, 17 Aug 2016 19:22:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:aff88743-c609-420b-b9be-5164d2d84ffe</guid><dc:creator>NewtoM</dc:creator><description>&lt;p&gt;Hi Ole,&lt;/p&gt;
&lt;p&gt;since I am very displeased with the results of my I2S tests (as documented in &lt;a href="https://devzone.nordicsemi.com/question/90647/i2s-32-bit-word-size/"&gt;this thread&lt;/a&gt;), I got back to the PDM interface. And it turned out that the sampling rate can pretty easily be increased - as opposed to our previous assumption.&lt;/p&gt;
&lt;p&gt;I found that the PDM_PDMCLKCTRL (PDM clock generator control) register can also take undocumented values, as shown below.&lt;/p&gt;
&lt;p&gt;Documented settings:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;DIV32: 0x08000000 -&amp;gt; CLK: 1.000 MHz -&amp;gt; SR: 15625 Hz
DIV31: 0x08400000 -&amp;gt; CLK: 1.032 MHz -&amp;gt; SR: 16125 Hz
DIV30: 0x08800000 -&amp;gt; CLK: 1.067 MHz -&amp;gt; SR: 16667 Hz
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Found to be working:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;DIV25: 0x0A000000 -&amp;gt; CLK: 1.280 MHz -&amp;gt; SR: 20000 Hz
DIV16: 0x10000000 -&amp;gt; CLK: 2.000 MHz -&amp;gt; SR: 31250 Hz
DIV12: 0x15000000 -&amp;gt; CLK: 2.667 MHz -&amp;gt; SR: 41667 Hz
DIV10: 0x19000000 -&amp;gt; CLK: 3.200 MHz -&amp;gt; SR: 50000 Hz
DIV08: 0x20000000 -&amp;gt; CLK: 4.000 MHz -&amp;gt; SR: 62500 Hz
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;First I checked the clock signal with an oscilloscope and found it to be stable all the way. Then I attached a &lt;a href="http://www.mouser.com/ds/2/218/SPH0641LM4H-1-952032.pdf"&gt;Knowles SPH0641LM4H-1 PDM microphone&lt;/a&gt; and streamed the PDM data out through UART to finally analyze it on a PC.&lt;/p&gt;
&lt;p&gt;I found that at all above listed sampling rates the data is perfect and without distortion or corruption. The spectra of the recorded signals also seem perfect (at least up to 28 KHz, which is okay, since the documented maximum sampling rate of the Knowles microphone tops anyway at 50 ksps).&lt;/p&gt;
&lt;p&gt;I incorporated the above listed clock rates into my version of &lt;code&gt;nrf_pdm.h&lt;/code&gt;, and also made some changes to &lt;code&gt;nrf_drv_pdm.h&lt;/code&gt; and &lt;code&gt;nrf_drv_pdm.c&lt;/code&gt;, mostly to data types (why passing uint32_t variables, when we talk about fixed 16-bit samples; uint16_t is much more self-explanatory). See my changes in the &lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/nrf_5F00_pdm_5F00_sources.zip"&gt;attached sources&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;And finally, an important question to the hardware developers at Nordic: &lt;strong&gt;may I expect any problems with another hardware parts of the nRF52832 when driving the PDM at undocumentedly high rates?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;NewtoM&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Single PDM microphone at higher PCM sampling rate</title><link>https://devzone.nordicsemi.com/thread/57835?ContentTypeID=1</link><pubDate>Sun, 17 Jul 2016 13:02:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d4444e6a-420b-4d7d-b13a-8f4d4625d709</guid><dc:creator>NewtoM</dc:creator><description>&lt;p&gt;Thank you, I guess I will look into using a I2S microphone for the time being.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Single PDM microphone at higher PCM sampling rate</title><link>https://devzone.nordicsemi.com/thread/57834?ContentTypeID=1</link><pubDate>Fri, 15 Jul 2016 10:35:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a4fbd784-6363-46cc-85cf-40ddf9d144b5</guid><dc:creator>Ole Bauck</dc:creator><description>&lt;p&gt;I am pretty sure that the sampling frequency cannot be changed from 16kHz. When mono is used you have to configure which edge mono is sampled, so it is not sampled at twice the speed, the only difference is the RAM allocation. I have to confirm this with the hardware engineers, but unfortunately most are on vacation so it may take some time.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>