<?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>problem with RTC counting</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/12791/problem-with-rtc-counting</link><description>Hi guys,
I&amp;#39;m facing some trouble to put my rtc working properly. I made a code based on the rtc example but it&amp;#39;s not incrementing the time the right way. 
 Bellow follows my code, it&amp;#39;s just to send the time through the uart each second. 
 I&amp;#39;m using</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 18 Jul 2016 08:25:43 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/12791/problem-with-rtc-counting" /><item><title>RE: problem with RTC counting</title><link>https://devzone.nordicsemi.com/thread/48622?ContentTypeID=1</link><pubDate>Mon, 18 Jul 2016 08:25:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2dca210c-0c9d-498d-847d-ff2789ab3897</guid><dc:creator>NewtoM</dc:creator><description>&lt;p&gt;Thank you for the clarification! I am actually using the external crystal and the precision is quite good (some seconds drift in an hour).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: problem with RTC counting</title><link>https://devzone.nordicsemi.com/thread/48620?ContentTypeID=1</link><pubDate>Mon, 18 Jul 2016 06:54:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ad5261c3-0392-43a5-8111-9227aa6190e5</guid><dc:creator>tesc</dc:creator><description>&lt;p&gt;Hi Tamas,&lt;/p&gt;
&lt;p&gt;The 2 % is worst case, for when you are using the internal RC oscillator instead of an external chrystal oscillator. Actually it is 5 % for the nRF51 and 2% for the nRF52. Also, the internal RC oscillator can be calibrated to within 250 ppm using the HFCLK, see &lt;a href="http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.nrf52832.ps.v1.1%2Fclock.html&amp;amp;cp=2_2_0_18_1_1&amp;amp;anchor=calibrating_32768khz_rcosc"&gt;Calibrating the 32.768 kHz RC oscillator&lt;/a&gt; in the Product Specification. With an external oscillator you would have no problem reaching 250 ppm (as required by BLE specification), 50 ppm (ANT) or even better.&lt;/p&gt;
&lt;p&gt;I will remove the percentage from my answer as it is misleading, but the point stands that the RTC accuracy is that of the LFCLK.&lt;/p&gt;
&lt;p&gt;Regards, Terje&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: problem with RTC counting</title><link>https://devzone.nordicsemi.com/thread/48621?ContentTypeID=1</link><pubDate>Fri, 15 Jul 2016 21:25:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:36395b04-b9bc-4e5f-a73b-35cb86348f59</guid><dc:creator>NewtoM</dc:creator><description>&lt;p&gt;Dear Terje, you write &amp;quot;RTC runs off the LFCLK and will inherit the 2 % accuracy of that clock signal.&amp;quot; If I only need to program one device, can I measure the real frequency of the LFCLK (say, with an oscilloscope) and use the measured difference to make a more accurate &amp;quot;real time clock&amp;quot; using the RTC? Or will its frequency vary with each restart of the chip? Thanks, Tamas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: problem with RTC counting</title><link>https://devzone.nordicsemi.com/thread/48617?ContentTypeID=1</link><pubDate>Wed, 06 Jul 2016 21:56:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:96e52ce0-ce17-4942-b392-6b2e60947d33</guid><dc:creator>kreis</dc:creator><description>&lt;p&gt;Hi Ankush,
in fact the solution I tried didn&amp;#39;t work as an Real Time Clock. You can check why on the answer below. I&amp;#39;ll put an external RTC on my circuit, it&amp;#39;ll work better.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: problem with RTC counting</title><link>https://devzone.nordicsemi.com/thread/48616?ContentTypeID=1</link><pubDate>Wed, 06 Jul 2016 09:23:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8363ce3f-df62-4725-a1a9-53de393b4795</guid><dc:creator>Ankush</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;i am working on implementation of real time clock using RTC in nrf52. from your comment it seems that you are getting the correct time and date values .Can you please help me in implementing the same.How to read the current value of counter in nrf 52 RTC example?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: problem with RTC counting</title><link>https://devzone.nordicsemi.com/thread/48619?ContentTypeID=1</link><pubDate>Thu, 31 Mar 2016 14:56:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5561b200-cf05-497e-93a4-630d26a3067d</guid><dc:creator>kreis</dc:creator><description>&lt;p&gt;Thank you for the answer Terje!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: problem with RTC counting</title><link>https://devzone.nordicsemi.com/thread/48618?ContentTypeID=1</link><pubDate>Tue, 29 Mar 2016 13:01:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8e0df261-ead3-4cf7-b330-4a0c88b4c0ab</guid><dc:creator>tesc</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Despite what its name (real time counter) may suggest, this peripheral is not intended for keeping track of the current time. Rather, it is a low frequency timer which is set to tick at a set frequency. It can generate timer events for each tick, or for a certain number of ticks, or when the counter overflows.&lt;/p&gt;
&lt;p&gt;Using the RTC for keeping track of time is not necessarily a good idea. RTC runs off the LFCLK and will inherit the accuracy of that clock signal. If done correctly this means 250 ppm or better, but it may still be a better idea to use a dedicated clock IC for keeping track of time with second precision over long periods of time. (250 ppm is about 1 second per hour.)&lt;/p&gt;
&lt;p&gt;If you want to use the RTC for keeping track of time, you will have to set it up to generate an event at a certain period (say 1 second) and use that event to increment a variable holding the current time as a unix timestamp value (number of seconds since January 1st 1970). If initially set to the current time, this timestamp value will contain the current time (with a clock drift within the accuracy of the LFCLK source.)&lt;/p&gt;
&lt;p&gt;&lt;code&gt;RTC0_CONFIG_FREQUENCY&lt;/code&gt; is the frequency for the RTC in ticks per second. What happens in your code is that RTC0 is initially starting at 0 (January 1st 1970 at 00:00:00) then incrementing at the &lt;code&gt;RTC0_CONFIG_FREQUENCY&lt;/code&gt; frequency. As you read the RTC0 value every second, when you use a frequency of 8 Hz you will get timestamp values with increments of 8 seconds. Similarly you get larger increments when using a higher frequency. (It is not increments of exactly 32768 seconds because of inaccuracies both for the RTC and for the sleep function.)&lt;/p&gt;
&lt;p&gt;Regards, Terje&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>