<?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>timer can not trigger by right ticks</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/13090/timer-can-not-trigger-by-right-ticks</link><description>Hi all, 
 I create 4 timer in APP, and there seem only one timer (work in single shot mode) can not trigger by right ticks. 
 I add some log and find that: 
 
 First I start this timer, timeout_ticks is 229376 (7s), then I get the current time by</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 20 Apr 2016 11:15:26 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/13090/timer-can-not-trigger-by-right-ticks" /><item><title>RE: timer can not trigger by right ticks</title><link>https://devzone.nordicsemi.com/thread/49913?ContentTypeID=1</link><pubDate>Wed, 20 Apr 2016 11:15:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ec0bf8cf-a756-4c07-8090-de5d1dd88cd3</guid><dc:creator>tesc</dc:creator><description>&lt;p&gt;I think I would need to see your code to know exactly what you are doing and why you see what you see. Can you provide code where you are seeing the issues?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: timer can not trigger by right ticks</title><link>https://devzone.nordicsemi.com/thread/49911?ContentTypeID=1</link><pubDate>Mon, 11 Apr 2016 14:53:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:812d377c-501d-4bc5-aff9-bd81297bba9d</guid><dc:creator>ghost</dc:creator><description>&lt;p&gt;I found that it will be sometime OK when the timeout_ticks is 0.5s and 6s, but it seems more often work in NG&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: timer can not trigger by right ticks</title><link>https://devzone.nordicsemi.com/thread/49910?ContentTypeID=1</link><pubDate>Mon, 11 Apr 2016 14:29:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3af9a34c-6502-425f-a909-e1181e945c1c</guid><dc:creator>ghost</dc:creator><description>&lt;p&gt;Hi，
Thanks for your answer.
I have already checked the return values of app_timer_stop and app_timer_start is NRF_SUCCESS.
And you are right, the the timer will triggers on the first value (229376) every time.
Do you mean that the timer no really stop when I stop it by app_timer_stop in the interrupt since all the values of current_timer are slightly larger than the initial timeout value?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: timer can not trigger by right ticks</title><link>https://devzone.nordicsemi.com/thread/49909?ContentTypeID=1</link><pubDate>Mon, 11 Apr 2016 09:41:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f4aad0fa-0c33-41ab-8066-4e5f3ce77120</guid><dc:creator>tesc</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;All the values you print from your timeout handler (229382, 229386, 229393, 229390, 229405) are slightly larger than your initial timeout value (229376). This is because the timer continues to run (although it has triggered an interrupt on the timeout value) and there is some variation in how long it takes before getting to those places in the interrupt handler.&lt;/p&gt;
&lt;p&gt;As far as I can see, the timer triggers on the first value (229376) every time.&lt;/p&gt;
&lt;p&gt;When you call &lt;code&gt;app_timer_stop()&lt;/code&gt; and &lt;code&gt;app_timer_start()&lt;/code&gt; from interrupt context (&lt;code&gt;APP_LOW&lt;/code&gt; or higher) the corresponding operations will be queued and run later in &lt;code&gt;APP_LOW&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Are you checking the return values of &lt;code&gt;app_timer_stop()&lt;/code&gt; and &lt;code&gt;app_timer_start()&lt;/code&gt;?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: timer can not trigger by right ticks</title><link>https://devzone.nordicsemi.com/thread/49912?ContentTypeID=1</link><pubDate>Sun, 10 Apr 2016 17:34:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:952a20ed-fb34-4505-ad60-67018789200b</guid><dc:creator>ghost</dc:creator><description>&lt;p&gt;I find that there is only step 3 and 5 would start the timer in the timeout_handler funchtion of this timer, and when I start the timer I will stop the timer first. Does it mean I can not start or stop a timer in the timeout handler function of itself?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>