<?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>Question about high resolution timer</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/6506/question-about-high-resolution-timer</link><description>Hi, 
 I&amp;#39;d like to get a timer with 1ms interval or higher resolution, and found some questions about this: 
 
 
 If the app_timer is used, looks like we only can get minimum interval 5ms. With the less interval, it causes the system crashed and reboot</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 16 Apr 2015 11:00:18 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/6506/question-about-high-resolution-timer" /><item><title>RE: Question about high resolution timer</title><link>https://devzone.nordicsemi.com/thread/22705?ContentTypeID=1</link><pubDate>Thu, 16 Apr 2015 11:00:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:80b6140a-e8d3-44cc-bfce-2b71f8edc2ec</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Great it helped, I have converted that comment into an answer.
Can you please accept the answer by clicking the &amp;quot;✓&amp;quot; of the acceptable answer. so that we can close the case&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Question about high resolution timer</title><link>https://devzone.nordicsemi.com/thread/22702?ContentTypeID=1</link><pubDate>Wed, 15 Apr 2015 17:35:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:59f29228-ddbd-4567-af4e-a0a4aba931f1</guid><dc:creator>Stanley</dc:creator><description>&lt;p&gt;Thanks Aryan, you&amp;#39;re right, I didn&amp;#39;t clear timer in interrupt handler, I had thought the counter will be cleared automatically in TIMER mode, it&amp;#39;s my fault. It will be much better if you can give more information in your reference manual, and update the sample code for timer.&lt;/p&gt;
&lt;p&gt;Anyway, this timer can meet my request completely. Thanks again!&lt;/p&gt;
&lt;p&gt;Regards,
Stanley&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Question about high resolution timer</title><link>https://devzone.nordicsemi.com/thread/22697?ContentTypeID=1</link><pubDate>Wed, 15 Apr 2015 17:21:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c9399d3f-4556-4e1d-a542-0a2cb4cac846</guid><dc:creator>Stanley</dc:creator><description>&lt;p&gt;Hi Aryan,&lt;/p&gt;
&lt;p&gt;Yes, I&amp;#39;m using S110 as the BLE stack.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Question about high resolution timer</title><link>https://devzone.nordicsemi.com/thread/22704?ContentTypeID=1</link><pubDate>Wed, 15 Apr 2015 08:26:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:77410216-1e75-4984-9539-3faf8a5cdf2d</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;you did not mention if you are using softdevice or not?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Question about high resolution timer</title><link>https://devzone.nordicsemi.com/thread/22700?ContentTypeID=1</link><pubDate>Wed, 15 Apr 2015 08:12:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:80dcbe0e-8830-4f3f-b49b-eb868f0914b9</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;I am not sure why you are getting same timeout.
Did you clear the counter everytime you get the TICK? otherwise it will go round the counter overflow everytime and it won&amp;#39;t matter what you put in CC registers, you need to have below line when you initialize your timer&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;NRF_TIMER2-&amp;gt;SHORTS      = 1 &amp;lt;&amp;lt; TIMER_SHORTS_COMPARE0_CLEAR_Pos;
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Question about high resolution timer</title><link>https://devzone.nordicsemi.com/thread/22699?ContentTypeID=1</link><pubDate>Wed, 15 Apr 2015 07:27:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:47583811-4589-4b9e-be63-fd278c173c23</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Are you using softdevice for your application?
If you are using and if you have NRF_APP_PRIORITY_HIGH, with 5ms tick it might be interfering with softdevice. I will verify to see how low I can go with the RTC1 tick when using softdevice and reply later.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Question about high resolution timer</title><link>https://devzone.nordicsemi.com/thread/22703?ContentTypeID=1</link><pubDate>Wed, 15 Apr 2015 07:20:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7363eac2-91d6-49dd-9eb7-f65fa4237c30</guid><dc:creator>Stanley</dc:creator><description>&lt;p&gt;Thanks Aryan for the feedback.&lt;/p&gt;
&lt;p&gt;Could you help confirm: 1) what the minimum timer interval of app_timer is? 2) why I can&amp;#39;t get exact timeout with the settings in my test codes? something wrong with it?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Question about high resolution timer</title><link>https://devzone.nordicsemi.com/thread/22701?ContentTypeID=1</link><pubDate>Wed, 15 Apr 2015 07:09:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4b56b2a2-c972-4ef2-88d9-250ccb33d0be</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Hi Stanley,&lt;/p&gt;
&lt;p&gt;Timer1 and Timer2 only support 16bit and these are the only timers accessable by applications when using softdevice.&lt;/p&gt;
&lt;p&gt;Only Timer0 has 32/24/16 bit mode and its access is restricted when using the softdevice. For
details on which bitmodes are supporting which timers see the device product specification.&lt;/p&gt;
&lt;p&gt;Timer0 can be used by apps in a restricted way when using Multiprotocol Timeslot API&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Question about high resolution timer</title><link>https://devzone.nordicsemi.com/thread/22698?ContentTypeID=1</link><pubDate>Wed, 15 Apr 2015 06:46:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a4da40f3-0278-4dd5-8ac9-1442ac5509bc</guid><dc:creator>Stanley</dc:creator><description>&lt;p&gt;With more tests, I tried to set different value for CC[0] directly, (Interrupt on CC[1] is disabled), and with below interrupt handler, looks like I got same timeout interval:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;void TIMER2_IRQHandler(void)
{
        if ((NRF_TIMER2-&amp;gt;EVENTS_COMPARE[0] != 0) &amp;amp;&amp;amp; ((NRF_TIMER2-&amp;gt;INTENSET &amp;amp; TIMER_INTENSET_COMPARE0_Msk) != 0)) {
                static int count = 0;
                count++;
                NRF_TIMER2-&amp;gt;EVENTS_COMPARE[0] = 0;           //Clear compare register 0 event   
                if (count % 10 == 0) {
                        printf(&amp;quot;%d\r\n&amp;quot;, count);
                        nrf_gpio_pin_toggle(GPIO_TOGGLE_PIN);           //Set LED
                }
        }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Could anyone help me on this question? Any feedback will be really appreciated.&lt;/p&gt;
&lt;p&gt;Thanks &amp;amp; Regards,
Stanley&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>