<?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>What is the precision on timers?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/28298/what-is-the-precision-on-timers</link><description>We have built and run the code in examples-&amp;gt;peripherals-&amp;gt;timer in nRF5_SDK_12.3.0_d7731ad on 4 different Nordic DK nRF51 development boards. The timer period is 5 msec. We commented out the LED initialization and toggling. In the ISR, we toggle a GPIO</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 12 Jul 2018 16:54:36 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/28298/what-is-the-precision-on-timers" /><item><title>RE: What is the precision on timers?</title><link>https://devzone.nordicsemi.com/thread/139952?ContentTypeID=1</link><pubDate>Thu, 12 Jul 2018 16:54:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:03a550a2-7fb6-49ee-b02f-d5f3fd6568de</guid><dc:creator>Jeffery Bahr</dc:creator><description>&lt;p&gt;Just getting back to this.&amp;nbsp; Thanks for the answer and code!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: What is the precision on timers?</title><link>https://devzone.nordicsemi.com/thread/111748?ContentTypeID=1</link><pubDate>Wed, 13 Dec 2017 09:12:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6b602cf5-c01b-438d-b529-37c930b16fd6</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;I thought triggering the task should work if you did it before enabling the SoftDevice, but using the driver is probably a better idea ;)&lt;br /&gt;
Good to see you figured it out :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: What is the precision on timers?</title><link>https://devzone.nordicsemi.com/thread/111749?ContentTypeID=1</link><pubDate>Wed, 13 Dec 2017 03:08:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a59b9645-38c5-4df8-9c68-4a3e7db11db3</guid><dc:creator>Nguyen Hoan Hoang</dc:creator><description>&lt;p&gt;You can also try my timer driver &lt;a href="https://github.com/I-SYST/EHAL/tree/master/ARM/Nordic"&gt;here&lt;/a&gt;.  Precision in usec even with low freq timer.  Driver code in src.  example in exemples folder.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: What is the precision on timers?</title><link>https://devzone.nordicsemi.com/thread/111747?ContentTypeID=1</link><pubDate>Tue, 12 Dec 2017 21:39:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1f99308d-78ac-4fed-bbbc-f1ea64912923</guid><dc:creator>Jeffery Bahr</dc:creator><description>&lt;p&gt;Although adding NRF_CLOCK-&amp;gt;TASKS_HFCLKSTART = 1 improved the accuracy of the timer in the Nordic sample app (without softdevice), it caused our app -- which uses soft device S130 -- to fail.  We embedded exactly the same timer code (using nrf_drv_timer_xxx calls), and they work OK, except we find again that the timer is again slightly off from 5000 microseconds, depending upon the board we&amp;#39;re using.&lt;/p&gt;
&lt;p&gt;We poked around and eventually added&lt;/p&gt;
&lt;p&gt;#include &amp;quot;nrf_drv_clock.h&amp;quot;&lt;/p&gt;
&lt;p&gt;and then&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;	nrf_drv_clock_init();
	nrf_drv_clock_hfclk_request(NULL);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;before calling app_timer_create() for the one-second timer we use in the app.&lt;/p&gt;
&lt;p&gt;That worked!  The timer is now correct.&lt;/p&gt;
&lt;p&gt;Thanks in advance for your help.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: What is the precision on timers?</title><link>https://devzone.nordicsemi.com/thread/111750?ContentTypeID=1</link><pubDate>Tue, 12 Dec 2017 18:01:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:59c47730-b8af-4fef-b2c6-ad578742405f</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Jeffery&lt;/p&gt;
&lt;p&gt;The accuracy of the timers is set by the clock source, which by default is the internal 16MHz RC oscillator. This oscillator has an accuracy of around +/- 5%, and as such your timer accuracy will be the same.&lt;/p&gt;
&lt;p&gt;To get better accuracy for your timers you should start the external 16MHz crystal, which will have an accuracy of 50 ppm or better (depending on the crystal used).&lt;/p&gt;
&lt;p&gt;The simplest way to start the external 16MHz crystal is to trigger the HFCLKSTART task, like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;NRF_CLOCK-&amp;gt;TASKS_HFCLKSTART = 1;  
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Best regards&lt;br /&gt;
Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>