<?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>Interfacing PDM Mic with NRF52832</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/123310/interfacing-pdm-mic-with-nrf52832</link><description>I am trying to interface the PDM mic (Link : https://www.adafruit.com/product/3492) with NRF52832 Devkit. I am using PIN 27 and 26 for Clock and Data Respectively. I can see the PCM Data in the log. However, when I play the Audio, it generates only the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 05 Aug 2025 08:18:12 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/123310/interfacing-pdm-mic-with-nrf52832" /><item><title>RE: Interfacing PDM Mic with NRF52832</title><link>https://devzone.nordicsemi.com/thread/544567?ContentTypeID=1</link><pubDate>Tue, 05 Aug 2025 08:18:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4749f798-c841-48f6-99d7-890e80ac31b7</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Maybe looking at the hardware description and register values may help here:&lt;br /&gt;&lt;a href="https://docs.nordicsemi.com/bundle/ps_nrf52832/page/pdm.html#register.PDMCLKCTRL"&gt;https://docs.nordicsemi.com/bundle/ps_nrf52832/page/pdm.html#register.PDMCLKCTRL&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Interfacing PDM Mic with NRF52832</title><link>https://devzone.nordicsemi.com/thread/543980?ContentTypeID=1</link><pubDate>Tue, 29 Jul 2025 14:43:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:07cdba95-0d31-487f-8e98-af09ac7a5254</guid><dc:creator>Tarunraj Singh</dc:creator><description>&lt;p&gt;Actually, I am receiving the data and I can see it over the Serial terminal. Today, I checked the clock frequency that my controller is generating. PDM Mic needs 1Mhz to 3Mhz of clock frequency. I am setting it by&amp;nbsp;&lt;span&gt;pdm_cfg.clock_freq = NRF_PDM_FREQ_1032K;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;However, the clock is not generating properly. I have observed that when I set the&amp;nbsp;&lt;br /&gt;&lt;span&gt;pdm_cfg.clock_freq = NRF_PDM_FREQ_DEFAULT;&amp;nbsp; &amp;nbsp;it is generating the 5Khz&lt;br /&gt;&lt;/span&gt;&lt;span&gt;pdm_cfg.clock_freq = NRF_PDM_FREQ_&lt;/span&gt;&lt;span&gt;1032K&lt;/span&gt;&lt;span&gt;;&amp;nbsp; &amp;nbsp;it is generating the 30Khz&lt;/span&gt;&lt;br /&gt;&lt;span&gt;pdm_cfg.clock_freq = NRF_PDM_FREQ_&lt;/span&gt;&lt;span&gt;1067K&lt;/span&gt;&lt;span&gt;;&amp;nbsp; &amp;nbsp;it is generating the 70Khz&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;which is incorrect.&amp;nbsp;&lt;br /&gt;I would really appreciate the help to enable the High Frequency Clock to generate at least 1MHz of frequency.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;My code to generate the clock:-&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;#include &amp;quot;nrf.h&amp;quot;&lt;br /&gt;#include &amp;quot;nrf_delay.h&amp;quot;&lt;/p&gt;
&lt;p&gt;// PDM CLK and DIN pin selection&lt;br /&gt;#define PDM_CLK_PIN 23&lt;br /&gt;#define PDM_DIN_PIN 25&lt;/p&gt;
&lt;p&gt;// Dummy buffer for PDM DMA (required)&lt;br /&gt;static int16_t dummy_buf[64];&lt;/p&gt;
&lt;p&gt;// Start High Frequency Clock (16 MHz crystal)&lt;br /&gt;void hfclk_start(void) {&lt;br /&gt; NRF_CLOCK-&amp;gt;EVENTS_HFCLKSTARTED = 0;&lt;br /&gt; NRF_CLOCK-&amp;gt;TASKS_HFCLKSTART = 1;&lt;br /&gt; while (NRF_CLOCK-&amp;gt;EVENTS_HFCLKSTARTED == 0);&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;void pdm_init(void) {&lt;br /&gt; // Route CLK and DIN pins&lt;br /&gt; NRF_PDM-&amp;gt;PSEL.CLK = PDM_CLK_PIN;&lt;br /&gt; NRF_PDM-&amp;gt;PSEL.DIN = PDM_DIN_PIN;&lt;/p&gt;
&lt;p&gt;// Use 16x PDM clock ratio &amp;rarr; ~1.067 MHz&lt;br /&gt; NRF_PDM-&amp;gt;PDMCLKCTRL = PDM_PDMCLKCTRL_FREQ_1067K; // 16 MHz / 15 = 1.067 MHz&lt;/p&gt;
&lt;p&gt;// Configure for Mono input, Left channel, falling edge&lt;br /&gt; NRF_PDM-&amp;gt;MODE = (PDM_MODE_OPERATION_Mono &amp;lt;&amp;lt; PDM_MODE_OPERATION_Pos) |&lt;br /&gt; (PDM_MODE_EDGE_LeftFalling &amp;lt;&amp;lt; PDM_MODE_EDGE_Pos);&lt;/p&gt;
&lt;p&gt;// Dummy buffer for DMA, 64 samples&lt;br /&gt; NRF_PDM-&amp;gt;SAMPLE.PTR = (uint32_t)dummy_buf;&lt;br /&gt; NRF_PDM-&amp;gt;SAMPLE.MAXCNT = 64;&lt;/p&gt;
&lt;p&gt;// Enable the PDM peripheral&lt;br /&gt; NRF_PDM-&amp;gt;ENABLE = PDM_ENABLE_ENABLE_Enabled &amp;lt;&amp;lt; PDM_ENABLE_ENABLE_Pos;&lt;/p&gt;
&lt;p&gt;// Start the PDM clock and sampling&lt;br /&gt; NRF_PDM-&amp;gt;TASKS_START = 1;&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;int main(void) {&lt;br /&gt; hfclk_start(); // Ensure the external 16 MHz oscillator is started&lt;br /&gt; pdm_init(); // Setup and start PDM&lt;/p&gt;
&lt;p&gt;while (1) {&lt;br /&gt; nrf_delay_ms(1000); // Do nothing, just keep the system running&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Thank You!!!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Interfacing PDM Mic with NRF52832</title><link>https://devzone.nordicsemi.com/thread/543923?ContentTypeID=1</link><pubDate>Tue, 29 Jul 2025 11:46:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2d7aab00-d473-4066-be39-ce9caf58f4d1</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;The code snippet you posted doesn&amp;#39;t show that you&amp;#39;re initializing the pdm_buffer[] array, as far as I can tell. In that case, it will just be zero initialized by the startup code.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>