<?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>PDM interface</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/57896/pdm-interface</link><description>We have a product with a microphone with PDM output that uses the nrf9160. The nrf9160 does have a PDM hardware unit that looks well suited to read it out. But currently there is no nrf9160 support for PDM in zephyr and there are also no examples for</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 18 Feb 2020 14:53:52 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/57896/pdm-interface" /><item><title>RE: PDM interface</title><link>https://devzone.nordicsemi.com/thread/234969?ContentTypeID=1</link><pubDate>Tue, 18 Feb 2020 14:53:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fb17dda2-d036-4d57-b2e2-4413ba2ce073</guid><dc:creator>borg</dc:creator><description>&lt;p&gt;Thanks a lot! I will try this and report back.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PDM interface</title><link>https://devzone.nordicsemi.com/thread/234899?ContentTypeID=1</link><pubDate>Tue, 18 Feb 2020 12:33:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e0bb6ade-a047-49aa-a2cc-98cbd041e17e</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you add this to your prj.conf:&lt;/p&gt;
&lt;p&gt;CONFIG_NRFX_PDM=y&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Then you should be able to access the nrfx driver directly in your application, by including &amp;quot;#include &amp;lt;nrfx_pdm.h&amp;gt;&amp;quot; in your .c file, and interface it.&lt;/p&gt;
&lt;p&gt;The &amp;quot;old&amp;quot; way of doing this, prior to tag v1.2.0, is described here:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/50656/using-pdm-mic-on-nrf9160dk/204715#204715"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/50656/using-pdm-mic-on-nrf9160dk/204715#204715&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;If you are using a fairly recent ncs, you should need to follow the very last step only, where you direct the interrupt in your main.c file:&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;ISR_DIRECT_DECLARE(pdm_isr_handler)
{
	nrfx_pdm_irq_handler();
	ISR_DIRECT_PM(); /* PM done after servicing interrupt for best latency
			  */

	return 1; /* We should check if scheduling decision should be made */
}

void main(void)
{
	IRQ_DIRECT_CONNECT(PDM_IRQn, 0,
			   pdm_isr_handler, 0);
	/* Rest of main */&lt;/pre&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;Note: when compiling for non-secure, you need to set the peripheral as non-secure directly, as shown here:&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/68472/pdm-mic-on-nrf9160dk-and-spm/281880#281880"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/68472/pdm-mic-on-nrf9160dk-and-spm/281880#281880&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>