<?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>questions about Zephyr clock control</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/121307/questions-about-zephyr-clock-control</link><description>Hello DevZone, 
 I have learned that some knowledge about CLOCK. But they are a little bit confusing. I just want to get confirmed by any expert. 
 
 1. Some peripherals (like TIMER, PDM) may need HFXO to get better accuracy. So, we should use `onoff_manager</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 08 May 2025 12:13:12 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/121307/questions-about-zephyr-clock-control" /><item><title>RE: questions about Zephyr clock control</title><link>https://devzone.nordicsemi.com/thread/534457?ContentTypeID=1</link><pubDate>Thu, 08 May 2025 12:13:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:88fbf5d8-28ba-44b0-b984-c4febb2183df</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;Jayant,&lt;/p&gt;
[quote user=""]1. Some peripherals (like TIMER, PDM) may need HFXO to get better accuracy. So, we should use `onoff_manager` to start the &lt;strong&gt;HFXO.&amp;nbsp;&lt;/strong&gt;Is that correct?[/quote]
&lt;p&gt;Yes, that is correct. Peripherals tha tneed the HFCLK will request it in hardware, but by default that will just start the HFINT. To use the HFXO, that must be started explicitly (the user do not need to think about his when&amp;nbsp;using Bluetooth or other radio protocols, as the stack implementation starts the HFXO).&lt;/p&gt;
[quote user=""]&lt;p&gt;2. We know that the wireless protocols (BLE, Thread...) are based on MPSL, because they need HFXO. And the MPSL will automatically enable and disable the HFCLK during the timeslot.&lt;/p&gt;
&lt;p&gt;In this situation, can I still use OnOff Manager to control the HFXO for the peripherals (like TIMER, PDM)? &lt;span&gt; I&amp;#39;m afraid not. But I&amp;#39;m not sure.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;[/quote]
&lt;p&gt;Yes, you can use the on/off manager also when MPSL is used. As long as the application enabled the HFXO, it will be kept on even when the stack no longer needs it (and vise versa), and disabled when there are no &amp;quot;users&amp;quot; needing the HFXO.&lt;/p&gt;
[quote user=""]3. If I want to use BLE and PDM at the same time. Do I need to use MPSL and sample the audio data during the MPSL slot?[/quote]
&lt;p&gt;AS long as you use BLE and the SoftDevic econtroller, you will also use MPSL. But that does not play a part in PDM. YOu can use PDM as in any other case (though there will be times where there are interrupts that block PDM opertaion), so it makes sense to use long DMA transactions so that delays in CPU processing due to interrupts does not cause problems for PDM. This is also a generic problem that needs to be handled in other caes where you have several real time operations concurrently on the same CPU.&lt;/p&gt;
&lt;p&gt;Br,&lt;/p&gt;
&lt;p&gt;Einar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>