<?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>Alternative Clock Source for PDM Interface</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/65266/alternative-clock-source-for-pdm-interface</link><description>I am working with the nRF52840 DK and was looking for ways to use an alternative clock source for the PDM interface&amp;#39;s master clock generator. For instance, would it be possible to use one of the 16MHz timers as opposed to whatever HFCLK is set to? I ask</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 24 Sep 2020 13:53:35 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/65266/alternative-clock-source-for-pdm-interface" /><item><title>RE: Alternative Clock Source for PDM Interface</title><link>https://devzone.nordicsemi.com/thread/271364?ContentTypeID=1</link><pubDate>Thu, 24 Sep 2020 13:53:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7b20d170-3d8f-4d05-9ee0-c2d862b1de45</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;You&amp;#39;re free to bit-bang a PDM interface, but you won&amp;#39;t be able to use any of the PDM Peripheral&amp;#39;s HW blocks as it is controlled by an internal state-machine that runs independently from the CPU.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Alternative Clock Source for PDM Interface</title><link>https://devzone.nordicsemi.com/thread/271202?ContentTypeID=1</link><pubDate>Wed, 23 Sep 2020 21:46:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1ced3e98-2be7-49ca-938d-150c9faeb6e8</guid><dc:creator>mkimhj</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I&amp;#39;d like to expand on this reply.&lt;/p&gt;
&lt;p&gt;Why is writing a custom PDM driver not possible? Is it feasible at all to have an entirely new driver that outputs a PDM clock from the time synced clock? From there, anytime the clock fires, can we not sample the PDM_DATA line manually, or put it into a DMA. After 64 clock cycles pass, we then convert the 64 bits into a 16bit pcm data sample. Is the issue here that we would be starving the CPU?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Alternative Clock Source for PDM Interface</title><link>https://devzone.nordicsemi.com/thread/267012?ContentTypeID=1</link><pubDate>Fri, 28 Aug 2020 13:00:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4fb94b8b-54bc-40b1-828c-d6a04be57057</guid><dc:creator>haakonsh</dc:creator><description>[quote user="jjaime2"]Could you elaborate on trimming the PDMCLKCTRL register? Currently, we have both devices set to the same frequency, would we need to constantly be finely adjusting this register to achieve a nominal frequency, and does the register provide that level of granularity? I believe I read that the register only performs integer division of the HFCLK so I am worried that fine adjustments won&amp;#39;t be possible.[/quote]
&lt;p&gt;&amp;nbsp;It&amp;#39;s probably integer divisions, so the resolution won&amp;#39;t be that great.&amp;nbsp;&lt;br /&gt;&amp;nbsp;&lt;/p&gt;
[quote user="jjaime2"]For clarity, we should be able to change the register while the PDM clock is active correct?[/quote]
&lt;p&gt;&amp;nbsp;I&amp;#39;ll have to ask the devs.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
[quote user="jjaime2"]Finally, would it be possible to write a custom PDM driver using the 16MHz timers instead?[/quote]
&lt;p&gt;&amp;nbsp;No, the limitation is in HW, the PDM peripheral is tied&amp;nbsp;to&amp;nbsp;the PCLK32M and the 16MHz TIMERs are derived from the same source as PCLK32M.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;You can use higher accuracy 32MHz crystals, or you can check out our new nRF5340 that has a dedicated audio PLL clock source. See&amp;nbsp;&lt;a title="Audio oscillator" href="https://infocenter.nordicsemi.com/topic/ps_nrf5340/chapters/clock/doc/clock.html?cp=3_0_0_3_10_0_2#concepthfclkaudio"&gt;Audio oscillator&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/ps_nrf5340/pdm.html?cp=3_0_0_6_21"&gt;PDM — Pulse density modulation interface&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Alternative Clock Source for PDM Interface</title><link>https://devzone.nordicsemi.com/thread/266832?ContentTypeID=1</link><pubDate>Thu, 27 Aug 2020 19:35:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a2a61774-9472-459d-9044-0fde5c44a7ae</guid><dc:creator>jjaime2</dc:creator><description>&lt;p&gt;Could you elaborate on trimming the PDMCLKCTRL register? Currently, we have both devices set to the same frequency, would we need to constantly be finely adjusting this register to achieve a nominal frequency, and does the register provide that level of granularity? I believe I read that the register only performs integer division of the HFCLK so I am worried that fine adjustments won&amp;#39;t be possible.&lt;/p&gt;
&lt;p&gt;For clarity, we should be able to change the register while the PDM clock is active correct? We cannot stop the PDM stream because our application is in telephony.&lt;/p&gt;
&lt;p&gt;Finally, would it be possible to write a custom PDM driver using the 16MHz timers instead?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Alternative Clock Source for PDM Interface</title><link>https://devzone.nordicsemi.com/thread/266758?ContentTypeID=1</link><pubDate>Thu, 27 Aug 2020 13:19:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:93c80ba2-cfb1-45ea-a34b-04c5c79f6f65</guid><dc:creator>haakonsh</dc:creator><description>[quote user=""]For instance, would it be possible to use one of the 16MHz timers as opposed to whatever HFCLK is set to?[/quote]
&lt;p&gt;&amp;nbsp;No, the 32MHz clock is the only source available.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
[quote user=""]Alternatively, would it be possible to synchronize the 32MHz peripheral clock and use that as a clock source for the PDM interface?[/quote][quote user=""]he goal is to have 2 wireless microphone streams and have them start at the same time, as well as to prevent the PDM clocks used for these streams from drifting apart.[/quote]
&lt;p&gt;You can use the TIMERs to start-stop transfers on a regular basis in order to adjust for drift over time.&amp;nbsp;&lt;br /&gt;You can also trim the&amp;nbsp;&lt;a title="PDMCLKCTRL" href="https://infocenter.nordicsemi.com/topic/ps_nrf52840/pdm.html?cp=4_0_0_5_14_6_9#register.PDMCLKCTRL"&gt;PDMCLKCTRL&lt;/a&gt;, this should be the first option as you can reduce drift by quite a lot during your production test.&amp;nbsp;&lt;br /&gt;A more advanced synchronization can involve trimming&amp;nbsp;&lt;a title="PDMCLKCTRL" href="https://infocenter.nordicsemi.com/topic/ps_nrf52840/pdm.html?cp=4_0_0_5_14_6_9#register.PDMCLKCTRL"&gt;PDMCLKCTRL&lt;/a&gt;&amp;nbsp;on-the-fly based on data from your wireless synchronization scheme.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>