<?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>Buffers in PDM module</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/91365/buffers-in-pdm-module</link><description>Hi 
 I&amp;#39;m working with a PDM mic for nRF52832 SDK v17.1 on a project and I have a questions about PDM driver working. 
 Whats the difference between the buffer pointer in nrfx_pdm_buffer_set(int16_t * buffer, uint16_t buffer_length) and p_evt-&amp;gt;buffer_released</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 29 Aug 2022 16:31:21 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/91365/buffers-in-pdm-module" /><item><title>RE: Buffers in PDM module</title><link>https://devzone.nordicsemi.com/thread/383740?ContentTypeID=1</link><pubDate>Mon, 29 Aug 2022 16:31:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:24001440-1a0a-4386-994a-33604ab85c75</guid><dc:creator>dejans</dc:creator><description>&lt;p&gt;Hi,&lt;br /&gt;&lt;br /&gt;This&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/49871/pdm-code-implementation-and-testing/202205"&gt;example&lt;/a&gt;&amp;nbsp;provides code part relevant to setting the buffer&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;void nrfx_pdm_event_handler(nrfx_pdm_evt_t const * const p_evt)
{
    if(p_evt-&amp;gt;buffer_requested)
    {
        nrfx_pdm_buffer_set(pdm_buf, PDM_BUF_SIZE);
    }
    if(p_evt-&amp;gt;buffer_released != 0)
    {
        printf(&amp;quot;Out: %.2x %.2x\r\n&amp;quot;, (uint16_t)pdm_buf[0], (uint16_t)pdm_buf[1]);
    }
}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Dejan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Buffers in PDM module</title><link>https://devzone.nordicsemi.com/thread/383526?ContentTypeID=1</link><pubDate>Fri, 26 Aug 2022 16:18:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a98ebd1d-09a9-4dc3-a4a1-50efcf9eee05</guid><dc:creator>RajB</dc:creator><description>[quote userid="111786" url="~/f/nordic-q-a/91365/buffers-in-pdm-module/383524"]Could you provide more information about the pointers buffer and p_evt-&amp;gt;buffer_released?&amp;nbsp;[/quote]
&lt;p&gt;&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v15.0.0%2Fhardware_driver_pdm.html"&gt;This&lt;/a&gt;&amp;nbsp;is what I read and I&amp;#39;m trying to understand how the buffer is set. It says another event is generated after a buffer_request event and calling the nrfx_pdm_buffer_set(). I&amp;#39;m looking to reuse the buffer after displaying it.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote userid="111786" url="~/f/nordic-q-a/91365/buffers-in-pdm-module/383524"]Could you specify the examples that you saw?[/quote]
&lt;p&gt;You can find it&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/19536/how-to-read-status-of-gpio-pin-12-whether-it-is-high-or-low"&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Buffers in PDM module</title><link>https://devzone.nordicsemi.com/thread/383524?ContentTypeID=1</link><pubDate>Fri, 26 Aug 2022 15:38:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7141ce61-a9b2-4303-a958-f574230661ba</guid><dc:creator>dejans</dc:creator><description>&lt;p&gt;Hi Raj,&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
[quote user=""]Whats the difference between the buffer pointer in&amp;nbsp;&lt;strong&gt;&lt;em&gt;nrfx_pdm_buffer_set(int16_t * buffer, uint16_t buffer_length)&lt;/em&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;em&gt;p_evt-&amp;gt;buffer_released&lt;/em&gt;&lt;/strong&gt; set after a &lt;em&gt;&lt;strong&gt;buffer_request&lt;/strong&gt;&lt;/em&gt; event? Do they point to the same data?[/quote]
&lt;p&gt;Could you provide more information about the pointers buffer and p_evt-&amp;gt;buffer_released?&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
[quote user=""]How do I access the data in p_evt-&amp;gt;buffer_released? I saw&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/22925/pdm-sample-buffer"&gt;this thread&lt;/a&gt;&amp;nbsp;but it&amp;#39;s for Thingy 52 and another one for the Smart Remote but could you tell me how to implement it in 52832? I tried this code but it only displays zero.[/quote]
&lt;p&gt;It might be that the code displays zero because that is the content of the buffer. You would need to check the content of the buffer and verify that it is not zero.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
[quote user=""]Unrelated question:&amp;nbsp;nrf_gpio_pin_set() will set a pin to HIGH and&amp;nbsp;nrf_gpio_pin_clear() will set it to LOW. I saw a couple of examples which had it vice versa. Is my assumption right or does&amp;nbsp;&lt;span&gt;nrf_gpio_pin_set() set a pin to LOW?&lt;/span&gt;[/quote]
&lt;p&gt;Could you specify the examples that you saw?&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Dejan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>