<?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>SDK 11 app_timer inaccurate</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/14595/sdk-11-app_timer-inaccurate</link><description>I need an accurate timer to generate pulses about 20ms. With simple timer this is workiong fine, but I need more then one timer simultaneously. So I would like to use app_timer. I do not need a SD. And I do not need external crystal(only the internal</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 19 Jul 2016 12:01:06 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/14595/sdk-11-app_timer-inaccurate" /><item><title>RE: SDK 11 app_timer inaccurate</title><link>https://devzone.nordicsemi.com/thread/55709?ContentTypeID=1</link><pubDate>Tue, 19 Jul 2016 12:01:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7bd28e65-bd94-4ba5-9484-5361f609d31e</guid><dc:creator>Inspectron</dc:creator><description>&lt;p&gt;Today I tested your app_timer_example. Very accurate! Thank you&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SDK 11 app_timer inaccurate</title><link>https://devzone.nordicsemi.com/thread/55708?ContentTypeID=1</link><pubDate>Tue, 28 Jun 2016 15:33:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dbad51a5-720e-42cd-ab27-19d063ebd29d</guid><dc:creator>Stefan Birnir Sverrisson</dc:creator><description>&lt;p&gt;Hi Inspectron&lt;/p&gt;
&lt;p&gt;You need to periodically calibrate the lfclk RC, otherwise it is going to be fairly inaccurate. When the lfclk RC is calibrated, the accuracy should be within 250ppm. I have created an example that uses app timer to generate interrupts. The example does not use softdevice, but instead manually starts the lfclk and calibrates it periodically. I have measured the timing accuracy of the interrupts, and they seem to be acceptable. Instruction on how to operate the example is given at the top of the main.c file in the example.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/app_5F00_timer_5F00_example.zip"&gt;app_timer_example.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Having that said, I don&amp;#39;t think the large timing variation in your case is because of lack of calibration. The variation is too large. I suspect that the application timer interrupt is occasionally blocked because of something else happening in your application. That could be fixed with raising the priority of the RTC1 interrupt, which application timer library uses in the background. But that may also not be convenient as you will raise the priority of all your timers.&lt;/p&gt;
&lt;p&gt;Since you are not using softdevice, RTC0 should be free to use for anything that needs more accurate timing. You could raise the priority of the RTC0, but still have the RTC1 interrupt priority low for application timers.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SDK 11 app_timer inaccurate</title><link>https://devzone.nordicsemi.com/thread/55707?ContentTypeID=1</link><pubDate>Mon, 20 Jun 2016 08:10:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1f4128d0-0acf-4abb-8fc0-7621e35182ad</guid><dc:creator>Inspectron</dc:creator><description>&lt;p&gt;Your assumption is right. I want a singleshot timer. I send the S1 command randomly over an terminal program to chip. So the time when the pin is High is not relevant&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SDK 11 app_timer inaccurate</title><link>https://devzone.nordicsemi.com/thread/55706?ContentTypeID=1</link><pubDate>Mon, 20 Jun 2016 07:47:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:94d81e44-e7f4-468d-9cfa-fd54e4c017bf</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;it&amp;#39;s very relevant and leads me to suspect that you don&amp;#39;t want a repeating timer for the low pulse timout.&lt;/p&gt;
&lt;p&gt;you can&amp;#39;t tell from the trace which is in seconds but I would guess that all your low-to-high transitions are exact multiples of 20ms apart from each other.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SDK 11 app_timer inaccurate</title><link>https://devzone.nordicsemi.com/thread/55705?ContentTypeID=1</link><pubDate>Mon, 20 Jun 2016 07:44:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:af738ce4-3de2-4e1a-b4c1-c831374d4b6c</guid><dc:creator>Inspectron</dc:creator><description>&lt;p&gt;The high time is not relevant. I have an UART connection which will fire a timer when I recieve an S1. After S1 is recieved over UART, I have to set a GPIO for min. 20ms low. After this 20 ms the GPIO has to be High again. I will add this part of the code to this post.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SDK 11 app_timer inaccurate</title><link>https://devzone.nordicsemi.com/thread/55704?ContentTypeID=1</link><pubDate>Mon, 20 Jun 2016 07:17:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:93b84198-290e-4bfb-a2aa-cdb40e5cb169</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;nowhere in that code shows what you&amp;#39;re doing in the timer handler or what generates the other piece of the pulse, if you have a low and a high, you need two timers .. unless something else is triggering the high to low transition. You&amp;#39;ve posted code, but not really the relevant code and have left out too many details to be really useful.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>