<?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>nRF51822 Long Time Timekeeping</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/2107/nrf51822-long-time-timekeeping</link><description>I want to measure the time between some different events in my application (using SoftDevice S110).
My idea is, to collect some timestamps and calculate the elapsed duration by just subtract them (like app_timer.c do). 
 But the problem is, that the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sun, 06 Apr 2014 04:11:21 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/2107/nrf51822-long-time-timekeeping" /><item><title>RE: nRF51822 Long Time Timekeeping</title><link>https://devzone.nordicsemi.com/thread/8993?ContentTypeID=1</link><pubDate>Sun, 06 Apr 2014 04:11:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5b017bf5-94e4-47b7-b0a4-3ad112c3e063</guid><dc:creator>Nikita</dc:creator><description>&lt;p&gt;I haven&amp;#39;t seen similar examples from the Nordic, but I have seen appnote about RTC implementation from &lt;a href="http://www.atmel.com/Images/Atmel-1259-Real-Time-Clock-RTC-Using-the-Asynchronous-Timer_AP-Note_AVR134.pdf"&gt;Atmel&lt;/a&gt; with &lt;a href="http://www.atmel.com/Images/Atmel-1259-Real-Time-Clock-RTC-Using-the-Asynchronous-Timer_AP-Note_AVR134.zip"&gt;source code&lt;/a&gt;, which can be taken as an example.
How to work with RTC you can find in Nordic SDK:
nRF51 SDK_v5.2.0.39364\Nordic\nrf51822\Board\nrf6310\rtc_example&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51822 Long Time Timekeeping</title><link>https://devzone.nordicsemi.com/thread/8992?ContentTypeID=1</link><pubDate>Sun, 06 Apr 2014 01:19:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6e79e07e-94af-4a29-9938-efb598d46a01</guid><dc:creator>Joe Merten</dc:creator><description>&lt;p&gt;Ok, what&amp;#39;s the way if one want to implement a real Rtc (with real time and date) on it&amp;#39;s nRF51822 based device. Is there some support from the chip or Sdk libraries (or SoftDevice) or must that implemented selfmade (counting seconds, wakeup periodically if long sleeping, …)?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51822 Long Time Timekeeping</title><link>https://devzone.nordicsemi.com/thread/8991?ContentTypeID=1</link><pubDate>Sat, 05 Apr 2014 19:09:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d8456bf5-3ad1-4f70-a8b6-b8c66689f346</guid><dc:creator>Nikita</dc:creator><description>&lt;p&gt;Obviously you can use RTC prescaler and with maximum prescaler value 4095 you can measure time between some different events up to 582.542 hours. But with a loss in measurement precision (measurement resolution will be 125 ms).
If your device will be in low power mode with only RTC running and you need maximum time measurement precision then your only option is to wake up on owerflow interrupt and increment some variable in interrupt handler.
If your device will always have 16 MHz system clock (SysClk) source ON, you can connect RTC OVRFLW event with COUNT task of one of the free timers through PPI.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>