<?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>RTC Inaccuracy</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/26256/rtc-inaccuracy</link><description>I&amp;#39;m finding fairly large lags with the RTC2 I&amp;#39;m using. I use an app_timer to sample the current RTC count value as a timestamp (MM:SS:Hundredth-of-a-second) and send it out via an HVX. However I&amp;#39;m noticing after about 2mins the RTC is lagging a reference</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 07 Nov 2017 18:45:18 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/26256/rtc-inaccuracy" /><item><title>RE: RTC Inaccuracy</title><link>https://devzone.nordicsemi.com/thread/103365?ContentTypeID=1</link><pubDate>Tue, 07 Nov 2017 18:45:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e95a261f-f024-46cf-8bfe-33932cbb038b</guid><dc:creator>Dave_couling</dc:creator><description>&lt;p&gt;Yes, an I&amp;#39;ve verify similar inaccuracy with the RTC.  However the inaccuracy is affected by BLE traffic.  Testing with different connection parameters and data transfer rates, sampling the RTC rarely so as to not be affect by BLE interrupts, I see variance between 1-4sec per minute.  Worse with high BLE data thru put.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RTC Inaccuracy</title><link>https://devzone.nordicsemi.com/thread/103364?ContentTypeID=1</link><pubDate>Tue, 07 Nov 2017 03:20:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:28d1712f-8034-44a9-a0de-6a74c3ab047f</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;no Dave I meant absolutely nothing of the sort. Going back to my original answer have you actually measured the accuracy of your RTC using a GPIO yet and how accurate were your &amp;#39;about 2 minutes and about almost a second&amp;#39; which I asked way back at the start.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RTC Inaccuracy</title><link>https://devzone.nordicsemi.com/thread/103363?ContentTypeID=1</link><pubDate>Tue, 07 Nov 2017 02:27:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1f23a789-7c1f-4dff-9f38-044219be2db2</guid><dc:creator>Julie H</dc:creator><description>&lt;p&gt;Dave - Yes, you can use PPI so that when the RTC&amp;#39;s EVENT is triggered some TASK is started. But I&amp;#39;m more concerned with why this seems to have become so complex. The first issue is that you can&amp;#39;t get 10ms times from a 327 pre-scaler value. For that matter, you can&amp;#39;t get 1.000ms anything from a 32,768Hz clock. You can get a 1/1024th of a second, or 10/1024ths of a second, but those aren&amp;#39;t even multiples of 1.000ms. One solution would be to count 1/1024ths of a second, and convert that to 1ms approximations. If you multiply by 1,000 and then divide by 1,024, you&amp;#39;ll get something that&amp;#39;s pretty close. If you wrap your counter at 1,024, so that you never have more than 1,024 &amp;quot;mibiseconds&amp;quot;, the ((mibiseconds * 1000) / 1024) will never overflow and life will be just fine.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RTC Inaccuracy</title><link>https://devzone.nordicsemi.com/thread/103362?ContentTypeID=1</link><pubDate>Tue, 07 Nov 2017 01:09:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:45033fee-522b-4f09-9793-f970a55618ae</guid><dc:creator>Dave_couling</dc:creator><description>&lt;p&gt;Sorry, this just isn&amp;#39;t very clear to me.  Does this mean I could assign an RTC timeout to sample the value in a TIMER?  Since the TIMER values are abstracted this is all seems overly complex.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RTC Inaccuracy</title><link>https://devzone.nordicsemi.com/thread/103360?ContentTypeID=1</link><pubDate>Wed, 25 Oct 2017 21:38:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:312d9e2c-6d8f-4229-a9a3-0d2d75c4cb70</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;don&amp;#39;t really know what else you can say about PPI, you choose any EVENT register you like which you would check with if( NRF_XX-&amp;gt;EVENT_YY != 0 ) and put that in the source and any TASK register you&amp;#39;d usually set with NRF_AA-&amp;gt;TASK_BB=1 and put that in the destination. Then enable it.&lt;/p&gt;
&lt;p&gt;The occurrence of your EVENT will then trigger your TASK. It&amp;#39;s as if you had your own little hardware thread going&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;while(true)
{
    if(NRF_XX-&amp;gt;EVENT_YY)
    {
        NRF_XX-&amp;gt;EVENT_YY=0;
        NRF_AA-&amp;gt;TASK_BB = 1;
    }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;in the background.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RTC Inaccuracy</title><link>https://devzone.nordicsemi.com/thread/103361?ContentTypeID=1</link><pubDate>Wed, 25 Oct 2017 21:09:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:66aee6bb-5029-4b03-81c3-ae3f5761f7f3</guid><dc:creator>Dave_couling</dc:creator><description>&lt;p&gt;It shouldn&amp;#39;t be ;)  though to be fair the PPI module is quite under documented for usage without GPIOTE.  Its fairly straight forward for connect to GPIOs, but not for internal time keeping usage&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RTC Inaccuracy</title><link>https://devzone.nordicsemi.com/thread/103358?ContentTypeID=1</link><pubDate>Wed, 25 Oct 2017 18:30:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9ec0a4b2-bdef-47eb-a918-3a2dfddf5378</guid><dc:creator>Dave_couling</dc:creator><description>&lt;p&gt;I do use an external crystal.  Its a Rigado BMD300 module.  I&amp;#39;ve initialized it in FW.  I am disaplaying both on the Central receive side and via UART logging.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RTC Inaccuracy</title><link>https://devzone.nordicsemi.com/thread/103359?ContentTypeID=1</link><pubDate>Wed, 25 Oct 2017 09:53:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:22fd3174-1e01-4829-8d93-9dc55d935d57</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;No the BLE traffic doesn&amp;#39;t impact the RTC2 counter in any way. It&amp;#39;s hardware. So what&amp;#39;s your LF clock source for a start, how accurate is that? Given your use of 327 you should be lagging about 1/4 second after 2 minutes. So how accurate is your &amp;#39;about 2 minutes&amp;#39; and how accurate is your &amp;#39;almost a second&amp;#39;? Because if it&amp;#39;s really 4 minutes and it&amp;#39;s really 1/2 second .. that&amp;#39;s about to be expected.&lt;/p&gt;
&lt;p&gt;You should set up a bare board test of your clock source outputting to a GPIO using hardware, PPI whatever you have and measure with some kind of signal analyser. In fact you could fairly easily add the PPI GPIO toggle to your current implementation and count rollover times or something, that will give you a reasonable way of determining what the RTC is counting.&lt;/p&gt;
&lt;p&gt;You seem to have inordinate difficulties with something very simple, both using the RTC and the HF clock (I saw the last post). It really shouldn&amp;#39;t be hard at all.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RTC Inaccuracy</title><link>https://devzone.nordicsemi.com/thread/103357?ContentTypeID=1</link><pubDate>Wed, 25 Oct 2017 08:18:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:14104e9f-6e62-4d35-989c-75cad7757437</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;It should be more related to LF CLK source. Do you have external 32kHz crystal and is it used during SD enabling? Once it runs there should be no interference between RTC HW peripheral and MCU activity... also question how exactly you &amp;quot;display&amp;quot; the RTC counter from main FW (because there might be delays between your read of counter and when you &amp;quot;look&amp;quot; at it from the outside;)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>