<?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>Retaining RTC Time After resetting NRF52840.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/85221/retaining-rtc-time-after-resetting-nrf52840</link><description>Hello Respected members, I have a question regarding the #nrf5-calendar example that is, is there any way to retain the NRF52 time after resetting the device. I am using the nrf_calendar example which is using RTC0 and when I reset the device the time</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 02 Mar 2022 09:45:54 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/85221/retaining-rtc-time-after-resetting-nrf52840" /><item><title>RE: Retaining RTC Time After resetting NRF52840.</title><link>https://devzone.nordicsemi.com/thread/355753?ContentTypeID=1</link><pubDate>Wed, 02 Mar 2022 09:45:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5d1f0df2-5977-4b90-9dd7-9a7d4a8f41da</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;No problem at all,&amp;nbsp;&lt;span&gt;Sami Ul Haq - I am happy to help you!&lt;br /&gt;&lt;br /&gt;Please do not hesitate to open another ticket if you should encounter any other issues or questions in the future.&lt;br /&gt;&lt;br /&gt;Good luck with your development!&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Retaining RTC Time After resetting NRF52840.</title><link>https://devzone.nordicsemi.com/thread/355691?ContentTypeID=1</link><pubDate>Wed, 02 Mar 2022 05:00:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:88e92b59-69e2-49af-b771-92006acfc4ee</guid><dc:creator>Sami Ul Haq</dc:creator><description>&lt;p&gt;I got it, Sir. Thank you so much for such an amazing explanation.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind Regards,&lt;/p&gt;
&lt;p&gt;Sami Ul Haq.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Retaining RTC Time After resetting NRF52840.</title><link>https://devzone.nordicsemi.com/thread/355562?ContentTypeID=1</link><pubDate>Tue, 01 Mar 2022 13:21:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d55a78d6-5f8a-4734-b1ff-1b8e8ff9b28d</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;The internal RTC can operate on this battery as well. Just switch the SW9 power switch to battery powered, then this coin cell battery will be used instead.&lt;br /&gt;The RTC is internal to the nRF52840, so the entire nRF52840 will need to be powered for the RTC to function.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Retaining RTC Time After resetting NRF52840.</title><link>https://devzone.nordicsemi.com/thread/355554?ContentTypeID=1</link><pubDate>Tue, 01 Mar 2022 13:00:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:15fbefbe-2e31-438d-9d00-073d1ef8fe21</guid><dc:creator>Sami Ul Haq</dc:creator><description>[quote userid="87869" url="~/f/nordic-q-a/85221/retaining-rtc-time-after-resetting-nrf52840/355522#355522"]I am glad to hear that it is now clear.[/quote]
&lt;p&gt;I am glad too, to hear from you, and sorry for disturbing you. Sir, I have a question regarding the Button battery which are on the backside of the NRF52840 Development board, as you can see in the attached picture. The question is what is the purpose of that button battery&lt;img class="align-right" style="float:right;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/254x478/__key/communityserver-discussions-components-files/4/board.jpeg" /&gt;? Is it used for an external RTC or Internal RTC can also operate on that cell?&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Retaining RTC Time After resetting NRF52840.</title><link>https://devzone.nordicsemi.com/thread/355522?ContentTypeID=1</link><pubDate>Tue, 01 Mar 2022 11:47:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:48fef2f5-39e0-48ae-8210-dd72c1d66820</guid><dc:creator>Karl Ylvisaker</dc:creator><description>[quote user="Sami Ul Haq"]I got it, You are amazing Sir.[/quote]
&lt;p&gt;Thank you for saying so!&lt;/p&gt;
[quote user="Sami Ul Haq"]For now, my concept is cleared. If there is any other doubt with the passage of time I will let you know.[/quote]
&lt;p&gt;I am glad to hear that it is now clear. Please do not hesitate to open another ticket if you should encounter any issues or questions in the future.&lt;br /&gt;&lt;br /&gt;Good luck with your development!&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Retaining RTC Time After resetting NRF52840.</title><link>https://devzone.nordicsemi.com/thread/355514?ContentTypeID=1</link><pubDate>Tue, 01 Mar 2022 11:18:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:468030d9-36da-400a-9a40-c58d1ecff409</guid><dc:creator>Sami Ul Haq</dc:creator><description>&lt;p&gt;Sami Ul Haq,&lt;/p&gt;
&lt;p&gt;I got it, You are amazing Sir. For now, my concept is cleared. If there is any other doubt with the passage of time I will let you know. Please respond to my reply whenever there are any other questions.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Again thank you so much.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind Regards,&lt;/p&gt;
&lt;p&gt;Sami Ul Haq&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Retaining RTC Time After resetting NRF52840.</title><link>https://devzone.nordicsemi.com/thread/355503?ContentTypeID=1</link><pubDate>Tue, 01 Mar 2022 10:56:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e45493ac-80b0-4c7a-aa44-522dd14bbfac</guid><dc:creator>Karl Ylvisaker</dc:creator><description>[quote user="Sami Ul Haq"]Thank you so much for a thorough explanation.[/quote]
&lt;p&gt;No problem at all, I am happy to help!&lt;/p&gt;
[quote user="Sami Ul Haq"]I mean that when I set time from GUI and then RTC start incrementing after every second, then where these values are stored and whether these values will also be cleared whenever there is RESET from a button.&amp;nbsp;[/quote]
&lt;p&gt;During normal operation the incrementing RTC value will be stored in the COUNTER register of the RTC peripheral that I just linked you. So the counter value will be lost unless it is stored somewhere else that is persistent, like in Flash, however writing to flash every second will cause excessing flash wear over time, so it might not be a feasible solution either.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Retaining RTC Time After resetting NRF52840.</title><link>https://devzone.nordicsemi.com/thread/355493?ContentTypeID=1</link><pubDate>Tue, 01 Mar 2022 10:25:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6a774a67-90db-4067-9a80-c4c62971a311</guid><dc:creator>Sami Ul Haq</dc:creator><description>&lt;p&gt;Hello Karl Sir,&lt;/p&gt;
&lt;p&gt;Thank you so much for a thorough explanation. But sir I am a little confused about where the time is being stored when setting it from GUI, I mean that when I set time from GUI and then RTC start incrementing after every second, then where these values are stored and whether these values will also be cleared whenever there is RESET from a button.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Sami Ul Haq&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Retaining RTC Time After resetting NRF52840.</title><link>https://devzone.nordicsemi.com/thread/355460?ContentTypeID=1</link><pubDate>Tue, 01 Mar 2022 09:11:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8d38bbd6-dea4-4aea-906e-e794882a4706</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello&amp;nbsp;&lt;span&gt;Sami Ul Haq,&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
[quote user="Sami Ul Haq"]I am not talking about the SYSTEM_OFF MODE, the device will be in SYSTEM_ON MODE where the RTC will be running[/quote]
&lt;p&gt;Aha - then I have misunderstood you, I thought you were talking about the device being in SYSTEM_OFF mode.&lt;br /&gt;The RTC will keep running while the device is in SYSTEM_ON mode, no problem. It will have no issue keeping the time as long as it stays in SYSTEM_ON sleep mode.&lt;/p&gt;
[quote user="Sami Ul Haq"]but I am confused about the Reset from the button(Whether RTC stopped or not).&amp;nbsp;[/quote]
&lt;p&gt;The RTC counter will be reset if the device is reset, yes. As you can see in &lt;a href="https://infocenter.nordicsemi.com/topic/ps_nrf52840/rtc.html?cp=4_0_0_5_21_9_12#register.COUNTER"&gt;the COUNTER register documentation&lt;/a&gt; it is set to 0x0 upon reset.&lt;/p&gt;
[quote user="Sami Ul Haq"]Also can you please elaborate the all possible reset behaviours of NRF52840?[/quote]
&lt;p&gt;What exactly would you like me to elaborate on? You can read about the device&amp;#39;s reset behavior in &lt;a href="https://infocenter.nordicsemi.com/topic/ps_nrf52840/power.html?cp=4_0_0_4_2_5#unique_448672166"&gt;the Reset documentation&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Retaining RTC Time After resetting NRF52840.</title><link>https://devzone.nordicsemi.com/thread/355420?ContentTypeID=1</link><pubDate>Tue, 01 Mar 2022 06:22:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:92feb86e-148e-4f25-8107-0c76597bcf88</guid><dc:creator>Sami Ul Haq</dc:creator><description>&lt;p&gt;Hello, Again&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="https://devzone.nordicsemi.com/members/karl-ylvisaker"&gt;Karl Ylvisaker&lt;/a&gt;&amp;nbsp;Sir.&lt;/p&gt;
&lt;p&gt;Sir can you please tell me, Is the power remains uncut(from the chip or RTC)during reset(button reset)? If No, then RTC must be running during button reset because the power is flowing to the RTC during button reset., right? I am not talking about the SYSTEM_OFF MODE, the device will be in SYSTEM_ON MODE where the RTC will be running, but I am confused about the Reset from the button(Whether RTC stopped or not).&amp;nbsp; Also can you please elaborate the all possible reset behaviours of NRF52840?&lt;/p&gt;
&lt;p&gt;Kind Regards,&lt;/p&gt;
&lt;p&gt;Sami Ul Haq&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Retaining RTC Time After resetting NRF52840.</title><link>https://devzone.nordicsemi.com/thread/355241?ContentTypeID=1</link><pubDate>Mon, 28 Feb 2022 11:06:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:78f19874-388b-4fee-bb05-38146dbc7c44</guid><dc:creator>Sami Ul Haq</dc:creator><description>&lt;p&gt;Hell&amp;nbsp;&lt;a class="internal-link view-user-profile" href="https://devzone.nordicsemi.com/members/karl-ylvisaker"&gt;Karl Ylvisaker&lt;/a&gt;&amp;nbsp;sir. Thank you again, I am glad to hear from you.&lt;/p&gt;
&lt;p&gt;I am working on a project named &amp;quot;sports tracker&amp;quot; which will be doing specific work, and I have to set its time from python GUI once, and when I set the time for one time, then the device time is retained even though I press the reset button or the device is in SYSTEM_OFF Mode. Let me talk to the boss about whether we can use an external RTC or not. If external RTC is the last option then definitely we will use external RTC but if there is any other solution I will go for it.&lt;/p&gt;
&lt;p&gt;Thanks, And Regards,&lt;/p&gt;
&lt;p&gt;Sami Ul Haq&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Retaining RTC Time After resetting NRF52840.</title><link>https://devzone.nordicsemi.com/thread/355235?ContentTypeID=1</link><pubDate>Mon, 28 Feb 2022 10:39:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:692020e5-3ab4-4d02-9858-7c0e47689f06</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello again,&amp;nbsp;&lt;span&gt;Sami Ul Haq&lt;/span&gt;&lt;/p&gt;
[quote user="Sami Ul Haq"]Thank you for your reply.[/quote]
&lt;p&gt;No problem at all, I am happy to help!&lt;/p&gt;
[quote user="Sami Ul Haq"]I got it but what will be the solution when I know the time for which the device will be in SYSTEM_OFF mode? as you said we do not know the time for which the device will be in SYSTEM_OFF mode.[/quote]
&lt;p&gt;These statements seems to be conflicting, but if you know exactly how long the device will be in SYSTEM_OFF mode then you may load the previous timestamp from flash, and then increment it with the time it has been in SYSTEM_OFF sleep, yes.&lt;/p&gt;
[quote user="Sami Ul Haq"]I have one more thing in mind that is it possible that the time will increment/update after each second in flash.?[/quote]
&lt;p&gt;You can write / update flash every second, but writing to flash both takes time to do, and wears the flash out over time. I am not sure that this would be an ideal solution for keeping time. If I could ask, what will you be using these real-time timestamps for?&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Retaining RTC Time After resetting NRF52840.</title><link>https://devzone.nordicsemi.com/thread/355233?ContentTypeID=1</link><pubDate>Mon, 28 Feb 2022 10:32:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:61ceb9e8-6f9e-47fc-ad8f-a4bb1c696e8e</guid><dc:creator>Sami Ul Haq</dc:creator><description>&lt;div class="content full threaded-reply-content user-defined-markup"&gt;
&lt;div class="content"&gt;
&lt;p&gt;Hello Karl sir,&lt;/p&gt;
&lt;p&gt;Thank you for your reply. I got it but what will be the solution when I know the time for which the device will be in SYSTEM_OFF mode? as you said we do not know the time for which the device will be in SYSTEM_OFF mode. And I have one more thing in mind that is it possible that the time will increment/update after each second in flash.?&lt;/p&gt;
&lt;p&gt;Thanks and Regards,&lt;/p&gt;
&lt;p&gt;Sami Ul Haq&lt;/p&gt;
&lt;div&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="edit-form"&gt;&lt;/div&gt;
&lt;div class="actions meta default"&gt;
&lt;div class="navigation-list"&gt;
&lt;div class="container"&gt;
&lt;ul&gt;
&lt;li class="navigation-list-item vote"&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Retaining RTC Time After resetting NRF52840.</title><link>https://devzone.nordicsemi.com/thread/355175?ContentTypeID=1</link><pubDate>Mon, 28 Feb 2022 08:03:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:202a4808-38ab-4456-bd77-f822ab1a2003</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello&amp;nbsp;Sami Ul Haq,&lt;br /&gt;&lt;br /&gt;While it could be possible to store the date to flash, I am not sure that this would be feasible for a calendar application since the device does not know how long it has been in SYSTEM_OFF mode - so if the last thing written to flash was 60 days ago, it will not have any way to know this, and it will resume its RTC as if no time has passed.&lt;br /&gt;The only thing this would tell is with certainty is that the date and time in flash has passed, at least.&lt;br /&gt;&lt;br /&gt;There is unfortunately no way to resume the RTC and date-time keeping in a more accurate way through a SYSTEM_OFF, since the RTC also is off during this time. My advice would be to connect to the device following a reset, and update / synchronize the calendar time before starting operation again.&lt;br /&gt;&lt;br /&gt;If your application really needs to keep track of the time passed in SYSTEM_OFF sleep you might have to add an external RTC that could do this for you while the nRF is in SYSTEM_OFF sleep.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>