<?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>Sync RTC to GNSS time without large time step</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/112227/sync-rtc-to-gnss-time-without-large-time-step</link><description>Hi Nordic Dev team, I&amp;#39;m using the older nRF SDK in a project that is built using a nRF52840. I have an RTC and a GNSS connected to the nRF52840. I use one of the LP timers internally to keep track of time as an internal RTC that can quickly be accessed</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 23 Jul 2024 23:01:46 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/112227/sync-rtc-to-gnss-time-without-large-time-step" /><item><title>RE: Sync RTC to GNSS time without large time step</title><link>https://devzone.nordicsemi.com/thread/495306?ContentTypeID=1</link><pubDate>Tue, 23 Jul 2024 23:01:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b47d8c52-6d8b-4208-9827-ab86deb885c1</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;If using an interrupt to increment the timestamp you can do the same kind of adjustment as (say) temperature calibration. The trick is very slow adjustments as you note in the post.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;    else if (NRF_RTC1-&amp;gt;EVENTS_TICK == 1)
    {
        NRF_RTC1-&amp;gt;EVENTS_TICK = 0;
#if defined(V_AND_V_TEST_CODE)
        nrf_gpio_pin_toggle(TICK_EVENT_OUTPUT);
#endif
        // 8Hz tick gives us 17 years operation using 32-bit unsigned timers
        // Coin cells are unlikely to last that long, maybe a year or more
        if (mAdjustTickCount &amp;lt; 0)
        {
           // Slow down, don&amp;#39;t increment the 125mSec tick
           mAdjustTickCount++;
        }
        else if (mAdjustTickCount == 0)
        {
           // Spot on, usual situation
           mRTC_PacketSampleTimer++;
        }
        else
        {
           // Speed up
           mRTC_PacketSampleTimer+=2;
           mAdjustTickCount--;
        }
     }&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sync RTC to GNSS time without large time step</title><link>https://devzone.nordicsemi.com/thread/495304?ContentTypeID=1</link><pubDate>Tue, 23 Jul 2024 22:01:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0ae7b9bd-ac9e-4543-889a-936f468b1cb4</guid><dc:creator>WestCoastDaz</dc:creator><description>&lt;p&gt;Sorry for the delay, &amp;nbsp;we need time to be quite accurate in our system. &amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sync RTC to GNSS time without large time step</title><link>https://devzone.nordicsemi.com/thread/489761?ContentTypeID=1</link><pubDate>Thu, 20 Jun 2024 13:05:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:19bc6b51-6593-49eb-8064-39b330cb1ce5</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Can I interest you in &lt;a href="https://gist.github.com/timvisee/fcda9bbdff88d45cc9061606b4b923ca"&gt;Falsehoods programmers believe about time&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Related: &lt;a href="https://xkcd.com/2867/"&gt;https://xkcd.com/2867/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I suggest that you adapt your error analyses to allow for time to flow backwards occasionally. &lt;/p&gt;
&lt;p&gt;I guess in the end it is a question of &amp;quot;how acurate do you need?&amp;quot; and &amp;quot;how often does it happen&amp;quot;? To decide if it is can be improved or if is &amp;quot;just something you have to deal with when working with time&amp;quot;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sync RTC to GNSS time without large time step</title><link>https://devzone.nordicsemi.com/thread/489588?ContentTypeID=1</link><pubDate>Wed, 19 Jun 2024 17:11:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:54d2eb50-4927-4fdc-a92e-18162adc820a</guid><dc:creator>WestCoastDaz</dc:creator><description>&lt;p&gt;Hi Sigurd,&amp;nbsp;&lt;br /&gt;&lt;br /&gt;I am using the RTC to provide a UTC timestamp for each sensor reading. &amp;nbsp;This stored in RAM and then sent via serial to be downloaded by the customer. &amp;nbsp;When correcting a slow&amp;nbsp;RTC with GNSS&amp;nbsp;time we get discontinuity in the timestamps as time appears to jump backwards. &amp;nbsp;The requirements are asking for very accurate timestamps as they may be used in failure analysis.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sync RTC to GNSS time without large time</title><link>https://devzone.nordicsemi.com/thread/489504?ContentTypeID=1</link><pubDate>Wed, 19 Jun 2024 12:22:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8d869f37-e4f7-4998-8c3e-6d5ae3bd8918</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;For me to better understand the issue here:&lt;/p&gt;
&lt;p&gt;What is the thing that does not work because of the drift? &lt;br /&gt;Im checking for &lt;a href="https://en.wikipedia.org/wiki/XY_problem"&gt;an XY problem&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Sigurd Hellesvik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>