<?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 The nRF52840 Automatically Switching HFINT and HFXO On / Off As Needed?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/65004/questions-about-the-nrf52840-automatically-switching-hfint-and-hfxo-on-off-as-needed</link><description>We&amp;#39;re trying to minimize power consumption on our custom nRF52840-based board and we have some questions about the behavior of HFINT and HFXO. The specification says this: 
 &amp;quot;The HFCLK controller will automatically provide the clock(s) requested by the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 19 Aug 2020 20:23:50 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/65004/questions-about-the-nrf52840-automatically-switching-hfint-and-hfxo-on-off-as-needed" /><item><title>RE: Questions About The nRF52840 Automatically Switching HFINT and HFXO On / Off As Needed?</title><link>https://devzone.nordicsemi.com/thread/265416?ContentTypeID=1</link><pubDate>Wed, 19 Aug 2020 20:23:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:22f566da-8234-4b42-b78b-d27359f79917</guid><dc:creator>Dmitry</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
[quote userid="78801" url="~/f/nordic-q-a/65004/questions-about-the-nrf52840-automatically-switching-hfint-and-hfxo-on-off-as-needed"]1) Does this mean that, if HFXO has not been started, the nRF52840 will start HFINT running automatically when when some part of the nRF52840 requires it. For instance, in Section 6.22.6, the specification says &amp;quot;To optimize RTC power consumption, events in the RTC can be individually disabled to prevent PCLK16M and HFCLK being requested when those events are triggered&amp;quot;, which suggests that if HFCLK is not running and an RTC event is triggered, HFINT will be automatically started. Is that correct?[/quote]
&lt;p&gt;IMHO&amp;nbsp;the description here is not clear. For other peripherals, there&amp;#39;s only an INTEN register that forces CPU to wake up by enabled events, but all events are always fire EVENT flag and are routed to PPI subsystem.&amp;nbsp;For RTC, there is an additional register EVTEN, it enables hardware path from an event. For example, you may want to toggle GPIOTE line or start ADC measurement by RTC but don&amp;#39;t need to wake up CPU - you can enable that event in EVTEN leaving INTEN cleared. For maximum power consumption, disable unneeded events in both registers.&lt;/p&gt;
[quote userid="78801" url="~/f/nordic-q-a/65004/questions-about-the-nrf52840-automatically-switching-hfint-and-hfxo-on-off-as-needed"]2) In the scenario above, where HFXO is not enabled, once HFINT is automatically started by the&amp;nbsp;&lt;span&gt;nRF52840 as requested by part of the MCU, will HFINT&amp;nbsp;ever be automatically stopped to conserve power?&amp;nbsp;Or will it just run forever once it has been started?&lt;/span&gt;[/quote]
&lt;p&gt;It will run as long as it&amp;#39;s needed by CPU or some peripheral, then it will be stopped.&lt;/p&gt;
[quote userid="78801" url="~/f/nordic-q-a/65004/questions-about-the-nrf52840-automatically-switching-hfint-and-hfxo-on-off-as-needed"]3) The specification states that &amp;quot;HCLK64M: 64 MHz CPU clock&amp;quot; is derived from HFCLK. Doesn&amp;#39;t this mean that, in practice, HFCLK is always running if code is executing?[/quote]
&lt;p&gt;Yes.&lt;/p&gt;
[quote userid="78801" url="~/f/nordic-q-a/65004/questions-about-the-nrf52840-automatically-switching-hfint-and-hfxo-on-off-as-needed"]4) Does HFINT&amp;nbsp;automatically get disabled when the MCU enters sleep mode? Or does it only get disabled when the MCU enters deep sleep mode?[/quote]
&lt;p&gt;It will stop unless&amp;nbsp;some peripheral needs it. AFAIK there&amp;#39;s no difference between sleep and deep sleep.&lt;/p&gt;
[quote userid="78801" url="~/f/nordic-q-a/65004/questions-about-the-nrf52840-automatically-switching-hfint-and-hfxo-on-off-as-needed"]5) How long does HFINT typically require to start running after it is requested?[/quote]
&lt;p&gt;For&amp;nbsp;nRF52832 startup time is 3us according to spec. For 52840 it&amp;#39;s not specified, I think it&amp;#39;s the same or very close.&lt;/p&gt;
[quote userid="78801" url="~/f/nordic-q-a/65004/questions-about-the-nrf52840-automatically-switching-hfint-and-hfxo-on-off-as-needed"]&lt;span&gt;Why is the USBD example program turning on HFXO all the time since&amp;nbsp;the component/libraries/usbd/app_usbd.c component seems to be&amp;nbsp;turning it on dynamically when needed?&amp;nbsp;&lt;/span&gt;&lt;span&gt;Shouldn&amp;#39;t the USBD component be able to dynamically request HFXO when USB is plugged into the device and then automatically release it when USB is unplugged?&lt;/span&gt;[/quote]
&lt;p&gt;I found it only in usbd example...&amp;nbsp;really it&amp;#39;s not needed for USB driver (it will request HFXO when plugged as you pointed out), rather to provide a stable clock to UART. Anyway, if device is powered from VBUS, power consumption is not an issue. For battery-powered device that is connected to USB host time to time, you&amp;#39;ll prefer to remove that line.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>