<?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>Timekeeping drift with nRF54L15 + GRTC + Date-Time library</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/122176/timekeeping-drift-with-nrf54l15-grtc-date-time-library</link><description>I&amp;#39;m writing an application for the nRF54L15 that periodically receives the local time via bluetooth and keeps track of time on its own between syncs. I&amp;#39;m using a 10ppm external oscillator as LFCLK for the GRTC. I&amp;#39;m following the date-time lib docs like</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 26 Jun 2025 06:32:52 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/122176/timekeeping-drift-with-nrf54l15-grtc-date-time-library" /><item><title>RE: Timekeeping drift with nRF54L15 + GRTC + Date-Time library</title><link>https://devzone.nordicsemi.com/thread/540534?ContentTypeID=1</link><pubDate>Thu, 26 Jun 2025 06:32:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:de7b642d-a1aa-40af-89d0-89b284aa6fdf</guid><dc:creator>rba</dc:creator><description>&lt;p&gt;Thanks for the pointers. I&amp;#39;ve marked the accepted answer.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Timekeeping drift with nRF54L15 + GRTC + Date-Time library</title><link>https://devzone.nordicsemi.com/thread/540482?ContentTypeID=1</link><pubDate>Wed, 25 Jun 2025 12:28:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0721b079-c995-4c24-bb4a-7a61fc9a1b40</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;This is described here:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://docs.nordicsemi.com/bundle/ps_nrf54L15/page/chapters/oscillators.html#ariaid-title5"&gt;https://docs.nordicsemi.com/bundle/ps_nrf54L15/page/chapters/oscillators.html#ariaid-title5&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;the CPin is described in the Electrical specification:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://docs.nordicsemi.com/bundle/ps_nrf54L15/page/_tmp/nrf54l15/autodita/OSCILLATORS/parameters.low_frequency_crystal_oscillator.html"&gt;https://docs.nordicsemi.com/bundle/ps_nrf54L15/page/_tmp/nrf54l15/autodita/OSCILLATORS/parameters.low_frequency_crystal_oscillator.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The equation from the first link can be simplified:&lt;/p&gt;
&lt;p&gt;C = 2*Cxo - Cpin. Cxo is from the XO specification, and Cpin = 3pF. Let us say we have a 9pF XO, then C will be C = 2*9 - 3 = 15pF.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Why it is 15.5pF in our board files, I am not sure. I assume this is based on testing, and they found this to be the best value for the best accuracy.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Timekeeping drift with nRF54L15 + GRTC + Date-Time library</title><link>https://devzone.nordicsemi.com/thread/540096?ContentTypeID=1</link><pubDate>Sat, 21 Jun 2025 06:45:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:39ac0ca9-286b-4051-9f84-c094717aed5c</guid><dc:creator>rba</dc:creator><description>&lt;p&gt;That&amp;#39;s a great find, thanks Edvin.&lt;/p&gt;
&lt;p&gt;For future readers, indeed I double checked that the nRF54l15dk (&lt;a href="https://www.nordicsemi.com/Products/Development-hardware/nRF54L15-DK/Hardware-files?lang=en#infotabs"&gt;0.9.3 BOM&lt;/a&gt;) and it has a 9pF LXFO:&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/dk_2D00_ci.png" /&gt;&lt;/p&gt;
&lt;p&gt;The LXFO is connected directly without external caps, and also saw that the &lt;a href="https://github.com/zephyrproject-rtos/zephyr/blob/3ce2ef7fddf109706ee24a73e7366caf38cfb425/boards/nordic/nrf54l15dk/nrf54l_05_10_15_cpuapp_common.dtsi#L31"&gt;dts file sets the internal load capacitance&lt;/a&gt;&amp;nbsp;for the DK as follows:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;amp;lfxo {
	load-capacitors = &amp;quot;internal&amp;quot;;
	load-capacitance-femtofarad = &amp;lt;17000&amp;gt;;
};&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;This has been recently changed from 15.5pF &lt;a href="https://github.com/zephyrproject-rtos/zephyr/commit/3ce2ef7fddf109706ee24a73e7366caf38cfb425"&gt;around a month ago&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;It&amp;#39;s more of an academic curiosity at this point, but I wonder how this value was chosen, and what&amp;#39;s the impact of inherent tolerances or measurement imprecisions in the capacitance value. I.e.: in which scenario can I expect the GRTC to have the accuracy of my LXFO? And if the nRF54L15 &amp;quot;sees&amp;quot; a 17pF in the DK&amp;#39;s LFXO, does it mean it&amp;#39;s also out of spec?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks once again!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Timekeeping drift with nRF54L15 + GRTC + Date-Time library</title><link>https://devzone.nordicsemi.com/thread/540051?ContentTypeID=1</link><pubDate>Fri, 20 Jun 2025 13:51:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d4a64d14-67ab-4f86-880c-dc19a12408de</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;The LFXO you are using seems to be out of spec.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://docs.nordicsemi.com/bundle/ps_nrf54L15/page/_tmp/nrf54l15/autodita/OSCILLATORS/parameters.low_frequency_crystal_oscillator.html"&gt;https://docs.nordicsemi.com/bundle/ps_nrf54L15/page/_tmp/nrf54l15/autodita/OSCILLATORS/parameters.low_frequency_crystal_oscillator.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The max Cl should be 9pF, while your is 12.5.&lt;/p&gt;
&lt;p&gt;You may (! not sure) be able to get it to work by setting the load-capactors to 21pF, but the internal ones only go up to 18pF, so you would need some external capacitors. Or you need to change to another LFXO that is actually inside the specification.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;So the load-capacitors in the dts file is not the same as the Cl of the XO. It is used to set the overall correct capacitance.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Timekeeping drift with nRF54L15 + GRTC + Date-Time library</title><link>https://devzone.nordicsemi.com/thread/539936?ContentTypeID=1</link><pubDate>Thu, 19 Jun 2025 18:26:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5b2a2982-6251-4e10-af31-d2c5a43c1c8e</guid><dc:creator>rba</dc:creator><description>&lt;p&gt;Thanks once again Edvin.&lt;/p&gt;
&lt;p&gt;By this I meant I&amp;#39;m using an external 32 kHz LFXO XTAL. The&amp;nbsp;crystal oscillator part number is&amp;nbsp;&lt;span&gt;Q13FC13500005 from Epson (&lt;a href="https://download.epsondevice.com/td/pdf/td_xtal_32khz/FC-135_Q13FC13500005_en.pdf"&gt;datasheet&lt;/a&gt;). I am using the recommended 12.5pF load capacitors in my dts file as follows:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;amp;lfxo {
	load-capacitors = &amp;quot;internal&amp;quot;;
	// 12.5pF.
	load-capacitance-femtofarad = &amp;lt;12500&amp;gt;;
};&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I think it could be a couple of things:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;- Some misconfiguration on my part somewhere&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;- Things could be working as expected and my measurements are off. I&amp;#39;m using a simple method of comparing it with my phone (against which I did the original sync): right after the sync the minutes flip at the same time; in the next morning there is a visible 3 seconds offset when the minute flips on the phone to when it flips on the nRF54.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;I will try to pipe the LFXO clock to a GPIO and measure it with an oscilloscope. Meanwhile, I was wondering if there&amp;#39;s a&amp;nbsp;more reliable test I could run. Let me know if you have something I can also run on the nRF54L15dk and on my custom nRF54L15 board. This would rule out any mistakes on my side.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Timekeeping drift with nRF54L15 + GRTC + Date-Time library</title><link>https://devzone.nordicsemi.com/thread/539784?ContentTypeID=1</link><pubDate>Wed, 18 Jun 2025 20:02:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0e508fbb-9e29-4491-a1d4-3cfb9fe9f6e7</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Yes, we found your findings curious. Basically, the accuracy of the GRTC should be equal to the accuracy of the LFCLK (32.768kHz clock). If your external clock is 10ppm, this means that it will drift 10 seconds per 1 million seconds (or less). 8 hours = 28800 seconds, so you should expect a drift of 0.288 seconds or less per 8 hours. What you are seeing is roughly 10 times that, so that is 10 per 100 000 or 1/10 000, or 100ppm (if my math is correct)&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;What you could do is to set up a small application using &lt;a href="https://docs.nordicsemi.com/bundle/ps_nrf54L15/page/dppi.html"&gt;DPPI&lt;/a&gt;, connecting the GRTC to a GPIO, and toggling it every given amount of time/ticks, and measure this GPIO using a logic analyzer, to see how long it takes.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user=""] I&amp;#39;m using a 10ppm external oscillator as LFCLK for the GRTC[/quote]
&lt;p&gt;Just to be sure, this means some sort of external signal generator, and not a 32kHz LFXO? Can you share the part number? (sorry if that is a dumb question, but this is new for the nRF54 series, and I am no HW expert).&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Timekeeping drift with nRF54L15 + GRTC + Date-Time library</title><link>https://devzone.nordicsemi.com/thread/539780?ContentTypeID=1</link><pubDate>Wed, 18 Jun 2025 18:51:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:206b3b35-288d-4794-bcdb-24e4423903d9</guid><dc:creator>rba</dc:creator><description>&lt;p&gt;Hey &lt;a href="https://devzone.nordicsemi.com/members/edvin-holmseth"&gt;Edvin&lt;/a&gt;&amp;nbsp;, thank you for your reply. Absolutely no need to apologize.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;In my initial tests the phone is not connected, except for the initial time sync, after which the BLE connection is shut down. I wanted to really test the accuracy of the RTC timekeeping by itself.&lt;/p&gt;
&lt;p&gt;I will repeat my tests for a longer period and see if the drift is somewhat linear like you suggested. In the end, I opted for doing a periodic time sync with the Current Time Service every one hour, which is more than fine for my use case.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m just now mostly curious to check if there&amp;#39;s any easy wins to be even more accurate. I will report back as soon as I manage to collect the data.&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Timekeeping drift with nRF54L15 + GRTC + Date-Time library</title><link>https://devzone.nordicsemi.com/thread/539454?ContentTypeID=1</link><pubDate>Mon, 16 Jun 2025 20:56:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5229ed22-aefc-4d30-a764-b46b01eca7a6</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I am terribly sorry for the late reply. We are a bit short staffed, and we are doing our best to keep the wait time down to a minimum. Sorry for the inconvenience!&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;During these 8 hours, are you connecting to your phone after the initial connection? Or does the nRF54L15 get the time from the phone after you started the 8h test?&lt;/p&gt;
&lt;p&gt;If so, can you try setting up a timer, and print the value of the clock, e.g every 5 minutes, or 30 minutes? Just to see if the clock is drifting without being interfered by the phone?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t suspect that the phone&amp;#39;s clock is drifting, but depending on your connection interval, the exact timestamp may be inacurate. Let us say that you have a connection interval of 4 seconds, then the time you receive from the phone may be everything from 0 to 4 seconds off, depending on when the phone queued the time message. It will first be sent after the next connection interval has passed, and that could have anything between 0 and 4 seconds remaining.&lt;/p&gt;
&lt;p&gt;If you leave your test running even further. Does the clock keep drifting 3 seconds every 8 hours? So 9 seconds per 24h?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>