<?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>Milliseconds since startup?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/10414/milliseconds-since-startup</link><description>Hello everybody, 
 I&amp;#39;ve been digging through the forum and the documentation for hours now. But to be honest I don&amp;#39;t understand the whole timer thing. 
 I need a simple way to count the milliseconds since the application/board startup. 
 My first attempt</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 24 Nov 2015 08:59:21 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/10414/milliseconds-since-startup" /><item><title>RE: Milliseconds since startup?</title><link>https://devzone.nordicsemi.com/thread/38669?ContentTypeID=1</link><pubDate>Tue, 24 Nov 2015 08:59:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:20c6399f-9ec7-40c4-bb3f-1136b3067a0c</guid><dc:creator>Matthias P.</dc:creator><description>&lt;p&gt;Ok, I got it now. It&amp;#39;s&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;ticks * ( (APP_TIMER_PRESCALER + 1 ) * 1000 ) / APP_TIMER_CLOCK_FREQ;
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Milliseconds since startup?</title><link>https://devzone.nordicsemi.com/thread/38668?ContentTypeID=1</link><pubDate>Tue, 24 Nov 2015 07:52:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:705439e0-a736-47b3-a6d1-d2b2a5945709</guid><dc:creator>Matthias P.</dc:creator><description>&lt;p&gt;Coudl you please give me a hint on how to convert the ticks into milliseconds?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Milliseconds since startup?</title><link>https://devzone.nordicsemi.com/thread/38670?ContentTypeID=1</link><pubDate>Mon, 23 Nov 2015 13:02:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a87f5888-52e2-4090-885e-a4e5446ad2ff</guid><dc:creator>Torsten Robitzki</dc:creator><description>&lt;p&gt;Hi Matthias,
when the interrupt fires, your timer still runs and the interrupt will fire again, when the 16 bit timer overflows and reaches 125 again. What you need, is to reset the timer, once your compare value of 125 was reached. I think this should be possible, by connecting the EVENT_COMPARE event with the TASK_CLR by setting the COMPARE0_CLEAR bit in the SHORTS register.&lt;/p&gt;
&lt;p&gt;cheers,
Torsten&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Milliseconds since startup?</title><link>https://devzone.nordicsemi.com/thread/38667?ContentTypeID=1</link><pubDate>Mon, 23 Nov 2015 12:54:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fcd95232-dde2-4c20-9884-9f153a5b1eed</guid><dc:creator>Wojtek</dc:creator><description>&lt;p&gt;Yes, there is simple way.&lt;/p&gt;
&lt;p&gt;If you are using app_timer library, you can just use app_timer_cnt_get function to get RTC ticks since its startup. Just get ticks value from there, convert them to milis (according to your prescaler). Just remember that RTC overflows sometimes - app_timer_cnt_diff_compute is the best way to compute the difference, as it considers those overflows.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>