<?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>Does the HFXO need to be restarted after waking from sleep?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/15533/does-the-hfxo-need-to-be-restarted-after-waking-from-sleep</link><description>On the nRF52, does the TASKS_HFCLKSTART need to be trigger again after waking up from sleep, if the the HFXO was started before going to sleep? Or does the Clock control circuitry remember that the HFXO was used the last time an HF clock was requested</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 04 Aug 2016 11:05:27 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/15533/does-the-hfxo-need-to-be-restarted-after-waking-from-sleep" /><item><title>RE: Does the HFXO need to be restarted after waking from sleep?</title><link>https://devzone.nordicsemi.com/thread/59315?ContentTypeID=1</link><pubDate>Thu, 04 Aug 2016 11:05:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e4da16c3-484b-4de8-b8e2-8bd2032334d0</guid><dc:creator>CurtisHx</dc:creator><description>&lt;p&gt;Gotchya.  The HF clock is strictly user controlled.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Does the HFXO need to be restarted after waking from sleep?</title><link>https://devzone.nordicsemi.com/thread/59314?ContentTypeID=1</link><pubDate>Thu, 04 Aug 2016 06:58:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9d639daa-a1e6-4f70-ba55-ba791cd3dfc9</guid><dc:creator>&amp;#216;yvind Karlsen</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The HFCLK will run even during sleep if you do not manually disable it, if you are referring to sleep as system OFF then you will need to reconfigure and restart it.&lt;/p&gt;
&lt;p&gt;When using the SoftDevice make sure that you request the HFCLK rather than start it by caling TASKS_START. ie.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;SoftDevice:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;HFCLK started by:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;uint32_t running=0;
sd_clock_hfclk_request();
while (!running) 
{
    sd_clock_hfclk_is_running(&amp;amp;p_is_running);
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Stopped by:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;sd_clock_hfclk_release();
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;LFCLK is always configured when the SoftDevice running, start it by calling&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;SOFTDEVICE_HANDLER_INIT(NRF_CLOCK_LFCLKSRC_XTAL_50_PPM , NULL) 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;NRF_CLOCK_LFCLKSRC_XTAL_50_PPM  should be exchanged with the appropriate LFCLK from &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v0.9.0/group___n_r_f___s_d_m___e_n_u_m_s.html#gaef6aabaa8887cb4d7265d7e21b3ec242"&gt;this struct&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;No SoftDevice&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// Start high frequency clock
NRF_CLOCK-&amp;gt;TASKS_HFCLKSTART = 1;
while (NRF_CLOCK-&amp;gt;EVENTS_HFCLKSTARTED == 0)
{
    // Wait for clock to start
}
NRF_CLOCK-&amp;gt;EVENTS_HFCLKSTARTED = 0;

// Start low frequency clock
NRF_CLOCK-&amp;gt;TASKS_LFCLKSTART = 1;
while (NRF_CLOCK-&amp;gt;EVENTS_LFCLKSTARTED == 0)
{
    // Wait for clock to start
}
NRF_CLOCK-&amp;gt;EVENTS_LFCLKSTARTED = 0;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Øyvind&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>