<?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>HFCLKSTART blocks changes to LFCLKSRC</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/8458/hfclkstart-blocks-changes-to-lfclksrc</link><description>Using a nRF51822-QFAC-A1 on the nRF51-DK I noticed unexpected behavior when starting the HFCLK and LFCLK in rapid succession. This variant reproduces the problem at startup: 
 NRF_CLOCK-&amp;gt;TASKS_HFCLKSTART = 1;
NRF_CLOCK-&amp;gt;LFCLKSRC = CLOCK_LFCLKSRC_SRC_Xtal;</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 14 Aug 2015 13:10:07 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/8458/hfclkstart-blocks-changes-to-lfclksrc" /><item><title>RE: HFCLKSTART blocks changes to LFCLKSRC</title><link>https://devzone.nordicsemi.com/thread/30818?ContentTypeID=1</link><pubDate>Fri, 14 Aug 2015 13:10:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:284d862e-d600-4c64-8373-cb1cc5f3115e</guid><dc:creator>Bruce McKenney</dc:creator><description>&lt;p&gt;I have observed this behavior with the nRF52 Preview Development Toolkit.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: HFCLKSTART blocks changes to LFCLKSRC</title><link>https://devzone.nordicsemi.com/thread/30817?ContentTypeID=1</link><pubDate>Mon, 03 Aug 2015 11:37:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:22fecffa-dd3e-46a2-aa06-b9dd588460c2</guid><dc:creator>pabigot</dc:creator><description>&lt;p&gt;I&amp;#39;ve just confirmed this anomaly is not present in a V2 chip, so it appears to be new with V3.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: HFCLKSTART blocks changes to LFCLKSRC</title><link>https://devzone.nordicsemi.com/thread/30816?ContentTypeID=1</link><pubDate>Fri, 31 Jul 2015 11:53:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:90a0cf12-73b6-4ab0-b241-8e6ac6fe4c77</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;I see what you mean.  I Agree. Good planning here can give you few hundred of instructions as bonus, instead of waiting for things to start :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: HFCLKSTART blocks changes to LFCLKSRC</title><link>https://devzone.nordicsemi.com/thread/30815?ContentTypeID=1</link><pubDate>Fri, 31 Jul 2015 11:42:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a0370c91-c38e-42cd-bbff-fbfdf57dacdf</guid><dc:creator>pabigot</dc:creator><description>&lt;p&gt;Didn&amp;#39;t mean to imply I wasn&amp;#39;t going to wait before counting on clock stability, just that I was looking for a way to run the start sequence in parallel without waiting between the two starts.  In the framework I&amp;#39;m developing the wait-for-stability is delayed until the point stability is actually needed (e.g., TIMER or RTC startup); there&amp;#39;s a lot of other non-timing-critical initialization that can occur while the clocks stabilize, and the RC sources are fine for that work.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: HFCLKSTART blocks changes to LFCLKSRC</title><link>https://devzone.nordicsemi.com/thread/30814?ContentTypeID=1</link><pubDate>Fri, 31 Jul 2015 11:15:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6817abd4-c381-4851-b460-21a4176b3ac9</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;That is not a good idea to completely skip waiting for one. There are different types of external clocks and the stable time is different for different crystal oscillators.&lt;/p&gt;
&lt;p&gt;Instead, we can make use of your observation and do this&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;NRF_CLOCK-&amp;gt;LFCLKSRC = CLOCK_LFCLKSRC_SRC_Xtal;
NRF_CLOCK-&amp;gt;TASKS_LFCLKSTART = 1;
NRF_CLOCK-&amp;gt;TASKS_HFCLKSTART = 1;
while (! NRF_CLOCK-&amp;gt;EVENTS_HFCLKSTARTED) {}
while (! NRF_CLOCK-&amp;gt;EVENTS_LFCLKSTARTED) {}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;With the above code, you can still start the clocks in parallel and do not have to wait if LFCLK already started along with HFCLK, but we also now handled the cases where in some cases it wont.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: HFCLKSTART blocks changes to LFCLKSRC</title><link>https://devzone.nordicsemi.com/thread/30813?ContentTypeID=1</link><pubDate>Fri, 31 Jul 2015 10:41:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0444a9e1-2c1b-42e5-81ec-a8c8ecd61f8d</guid><dc:creator>pabigot</dc:creator><description>&lt;p&gt;You&amp;#39;re welcome.  I confirm that if LCFLKSRC is assigned before HFCLKSTART the wait is not necessary and the two startups can proceed in parallel, which shaves 800 us off the clock configuration sequence.  I don&amp;#39;t have a pre-V3 chip to hand to test; if you can verify this anomaly also exists in V2 chips I&amp;#39;d like to know.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: HFCLKSTART blocks changes to LFCLKSRC</title><link>https://devzone.nordicsemi.com/thread/30812?ContentTypeID=1</link><pubDate>Fri, 31 Jul 2015 08:23:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2b3b1114-3959-480a-9eec-bfad35c25b3d</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;I have tested this now. And I see that only selecting the the LFCLKSRC is ignored and trying to set some other register just works fine if done in between HFCLKSTART and EVENTS_HFCLKSTARTED.&lt;/p&gt;
&lt;p&gt;It is not a big thing as you mentioned but I agree that this needs to be documented. I will create a internal ticket for the team to document this. It will be handled for sure (internal tickets get solved at some point), but cannot give you any time line.&lt;/p&gt;
&lt;p&gt;Thanks for pointing this out.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: HFCLKSTART blocks changes to LFCLKSRC</title><link>https://devzone.nordicsemi.com/thread/30811?ContentTypeID=1</link><pubDate>Fri, 31 Jul 2015 07:30:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7e0937c5-3f82-4d60-8d3e-ad046c86f1a6</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Hi pabigot,
Very nice description of the problem. I will try this today&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>