<?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>Reading Current ticks in RTC during operation</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/17244/reading-current-ticks-in-rtc-during-operation</link><description>Hello, 
 I want to read the current ticks in RTC0, and want to measure the time elapsed after some events by using ticks to milliseconds.
Basically i want to display the time in milliseconds as soon as i start the program so i am using RTC for that</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 24 Oct 2016 12:06:21 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/17244/reading-current-ticks-in-rtc-during-operation" /><item><title>RE: Reading Current ticks in RTC during operation</title><link>https://devzone.nordicsemi.com/thread/66234?ContentTypeID=1</link><pubDate>Mon, 24 Oct 2016 12:06:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:73ad69f6-743f-46d4-aa51-01bbca45d44e</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You can read the value of the RTC0 counter from the register &lt;code&gt;NRF_RTC0-&amp;gt;COUNTER&lt;/code&gt;. Notice that the timer will overflow, and you need to account for this in your timekeeping application. Check out &lt;a href="https://devzone.nordicsemi.com/question/53893/best-way-to-implement-system-clock-on-nrf51/?answer=54538#post-id-54538"&gt;this post&lt;/a&gt; about overflow counting using timer library. If you are using a softdevice, direct access to RTC0 is blocked. You can use RTC1 with the &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v12.0.0/lib_timer.html?cp=4_0_0_3_28"&gt;Timer library&lt;/a&gt; if you use a softdevice.&lt;/p&gt;
&lt;p&gt;Conversion from ticks to ms can be done like &lt;a href="https://devzone.nordicsemi.com/question/39307/ticks-to-ms-calculation/?answer=39340#post-id-39340"&gt;this&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Jørgen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>