<?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>nRF52 enabling HFCLK power consumption impact</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/89273/nrf52-enabling-hfclk-power-consumption-impact</link><description>Hi, 
 I need to create run time count that increases every 0.065536sec. 
 I found a way doing so by using HFCLK without any interrupts. 
 
 My questions are: 
 1) Are there is other, more power efficient way, to do so? 
 2) If not, what is the estimated</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 23 Jun 2022 13:29:41 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/89273/nrf52-enabling-hfclk-power-consumption-impact" /><item><title>RE: nRF52 enabling HFCLK power consumption impact</title><link>https://devzone.nordicsemi.com/thread/373961?ContentTypeID=1</link><pubDate>Thu, 23 Jun 2022 13:29:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ee8bd63f-fe0d-40be-a703-fa232834ed18</guid><dc:creator>Kazi Afroza Sultana</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;You can use Low frequency Clock (LFCLK) as runtime increase is 65 ms for each time. So for this very long period low frequency is not a problem. For doing this you can use RTC peripheral which runs from LF clock (&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/ps_nrf52833/rtc.html?cp=4_1_0_5_19"&gt;https://infocenter.nordicsemi.com/topic/ps_nrf52833/rtc.html?cp=4_1_0_5_19&lt;/a&gt;&amp;nbsp;).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The counter increment frequency is-&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1655989637037v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;So to get the TICK event in every 65 ms second you have to set the RTC Prescaler to 2146, so you can get&lt;/p&gt;
&lt;p&gt;(2146+1)/32768 = 0.065521 seconds, very close 0.065536.&lt;/p&gt;
&lt;p&gt;If you need exactly 0.065536 seconds, you may have to use the TIMER peripheral which runs from the HFCLK and setting prescaler to 20. Then you will get even every 0.065536 seconds.&amp;nbsp; But for this the power consumption&amp;nbsp;will be high arounf 0.5 mA (&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/ps_nrf52840/_tmp/nrf52840/autodita/CURRENT/parameters.i_timer.html?cp=4_0_0_4_1_0_8"&gt;https://infocenter.nordicsemi.com/topic/ps_nrf52840/_tmp/nrf52840/autodita/CURRENT/parameters.i_timer.html?cp=4_0_0_4_1_0_8&lt;/a&gt;&amp;nbsp;).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;One thing is for the best accuracy, you will have to start the HF clock crystal (HFXO) and then the accuracy will be decided by the crsytal you use (&lt;a href="https://infocenter.nordicsemi.com/topic/ps_nrf52840/clock.html?cp=4_0_0_4_3_3#unique_787884406"&gt;https://infocenter.nordicsemi.com/topic/ps_nrf52840/clock.html?cp=4_0_0_4_3_3#unique_787884406&lt;/a&gt;) .&lt;/p&gt;
&lt;p&gt;HF clock has a specified accuracy, if you use the internal HF clock (HFINT) the specified accuracy is typically at 1.5%, which means that the TICK interval will vary with +/- 1ms, or in other words you will get a variation from 0.0645 t0 0.0665 seconds variation. So, you can choose just for this little accuracy difference should you go for HFCLK.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks.&lt;/p&gt;
&lt;p&gt;Hope it helps.&lt;/p&gt;
&lt;p&gt;Best Regards,&lt;/p&gt;
&lt;p&gt;Kazi Afroza Sultana&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>