<?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>Using RTC to get real time for nRF9160DK</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/65311/using-rtc-to-get-real-time-for-nrf9160dk</link><description>Hi Dev team, 
 I had an issue regarding getting the real time using RTC. I tried to follow the below dev zone blog but the CAL_RTC does not work in my code. 
 As such, I am unable to use this to build my application. Does nR9160DK not support &amp;quot;CAL_RTC</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 18 Sep 2020 08:55:28 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/65311/using-rtc-to-get-real-time-for-nrf9160dk" /><item><title>RE: Using RTC to get real time for nRF9160DK</title><link>https://devzone.nordicsemi.com/thread/270277?ContentTypeID=1</link><pubDate>Fri, 18 Sep 2020 08:55:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5943d44e-c790-468a-a3f5-510b9201a821</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Adeel&lt;/p&gt;
&lt;p&gt;I&amp;#39;m happy to help, good to hear you got it working &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using RTC to get real time for nRF9160DK</title><link>https://devzone.nordicsemi.com/thread/270123?ContentTypeID=1</link><pubDate>Thu, 17 Sep 2020 13:28:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:747626fb-9e10-4732-944b-8f41a22f8dba</guid><dc:creator>Adeel</dc:creator><description>&lt;p&gt;Hi Tobjorn,&lt;/p&gt;
&lt;p&gt;Yes, This works. I forgot about the&amp;nbsp;nrfx_rtc_counter_get() function in order to get the counter value &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f926.svg" title="Face palm"&gt;&amp;#x1f926;&lt;/span&gt; &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks for helping me out here :).&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Adeel.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using RTC to get real time for nRF9160DK</title><link>https://devzone.nordicsemi.com/thread/270095?ContentTypeID=1</link><pubDate>Thu, 17 Sep 2020 12:44:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7e94b9d3-32bd-4c9e-87b1-4b5d4ea22cac</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Adeel&lt;/p&gt;
&lt;p&gt;I updated the Rallare RTC example to update the CC register as you describe, and it seems to work fine for me.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The only change I did was to update the rtc_handler function like this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;static void rtc_handler(nrfx_rtc_int_type_t int_type)
{
	int rtc_value;
	if (int_type == NRFX_RTC_INT_COMPARE0) {
		nrf_gpio_pin_toggle(LED_0);

		// Get the current counter value, add COMPARE_COUNTERTIME * 8, and update the CC 0 register
		rtc_value = nrfx_rtc_counter_get(&amp;amp;rtc);
		rtc_value += COMPARE_COUNTERTIME * 8;
		nrfx_rtc_cc_set(&amp;amp;rtc, 0, rtc_value, true);

	} else if (int_type == NRFX_RTC_INT_TICK) {
		nrf_gpio_pin_toggle(LED_1);
	}
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Flashing the code I can see LED1 on the DK (referred to as LED_0 in the code) blink every few seconds.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using RTC to get real time for nRF9160DK</title><link>https://devzone.nordicsemi.com/thread/269921?ContentTypeID=1</link><pubDate>Wed, 16 Sep 2020 15:30:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f40fa1ee-b3c2-40f4-a8f2-d215f18e1833</guid><dc:creator>Adeel</dc:creator><description>&lt;p&gt;Hi Tobjorn,&lt;/p&gt;
&lt;p&gt;Continuing my previous question, I had an issue regarding setting the RTC compare value for periodic compare events.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/Rallare/fw-nrfconnect-nrf/tree/nrf9160_samples/samples/nrf9160/nrfx/rtc"&gt;https://github.com/Rallare/fw-nrfconnect-nrf/tree/nrf9160_samples/samples/nrf9160/nrfx/rtc&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I used the following example and was building on it. Its working fine for 1 compare event but I wish to have periodic compare events at my scheduled times.&lt;/p&gt;
&lt;p&gt;To do that, I am trying to update the compare value by adding it to the counter value in the rtc_handler() part of the code as soon as I get my 1st compare event.&lt;/p&gt;
&lt;p&gt;The ideas was this: NEW_COMPARE_VALUE = CURRENT_COUNTER_VALUE + PREVIOUS_COMPARE_VALUE;&lt;/p&gt;
&lt;p&gt;For some reason, the compare value does not update and I don&amp;#39;t get the next compare event. Could you help me with the code structure that updates the compare value of the counter for periodic events.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Adeel.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using RTC to get real time for nRF9160DK</title><link>https://devzone.nordicsemi.com/thread/269868?ContentTypeID=1</link><pubDate>Wed, 16 Sep 2020 12:37:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e3d7f4b6-ce4b-462e-b959-b0e8ca207ed0</guid><dc:creator>Adeel</dc:creator><description>&lt;p&gt;Hi Tobjorn,&lt;/p&gt;
&lt;p&gt;One basic question regarding the same observation:&lt;/p&gt;
&lt;p&gt;&lt;span&gt;NRF_RTC0-&amp;gt;&lt;/span&gt;&lt;span class="pl-smi"&gt;EVENTS_COMPARE&lt;/span&gt;&lt;span&gt;[&lt;/span&gt;&lt;span class="pl-c1"&gt;0&lt;/span&gt;&lt;span&gt;] = &lt;/span&gt;&lt;span class="pl-c1"&gt;0&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/p&gt;
&lt;table class="highlight tab-size js-file-line-container" height="43" width="306"&gt;
&lt;tbody&gt;
&lt;tr&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="blob-code blob-code-inner js-file-line" id="LC42"&gt;NRF_RTC0-&amp;gt;&lt;span class="pl-smi"&gt;CC&lt;/span&gt;[&lt;span class="pl-c1"&gt;0&lt;/span&gt;] = NRF_RTC0-&amp;gt;&lt;span class="pl-smi"&gt;COUNTER&lt;/span&gt; + &lt;span class="pl-c1"&gt;1000&lt;/span&gt;;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="blob-num js-line-number" id="L43"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;Do these commands also not work with the nRF91 series ? I am trying to use them but I see no effect.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using RTC to get real time for nRF9160DK</title><link>https://devzone.nordicsemi.com/thread/269398?ContentTypeID=1</link><pubDate>Mon, 14 Sep 2020 13:34:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:537524b4-2ea9-4ac7-b558-a40aaf7501f4</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Great Adeel, I am happy to help &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using RTC to get real time for nRF9160DK</title><link>https://devzone.nordicsemi.com/thread/269298?ContentTypeID=1</link><pubDate>Mon, 14 Sep 2020 07:48:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1231ff8a-56df-43cd-a75c-a2f1fc475c2b</guid><dc:creator>Adeel</dc:creator><description>&lt;p&gt;Hi Tobjorn,&lt;/p&gt;
&lt;p&gt;Thanks for the help. This clears up the doubts I had regarding the interrupts :).&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Adeel.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using RTC to get real time for nRF9160DK</title><link>https://devzone.nordicsemi.com/thread/268681?ContentTypeID=1</link><pubDate>Wed, 09 Sep 2020 08:58:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:87951af0-1bcc-4085-bed7-ba5df2637541</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Adeel&lt;/p&gt;
&lt;p&gt;It is not supported in Zephyr, no.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I am guessing all the examples you found using NVIC are based on the nRF5 SDK, not on Zephyr.&lt;/p&gt;
&lt;p&gt;For nRF52 development the nRF5 SDK is a good option, and you can use that if you want, but for the nRF53 series, nRF91 series and future chip series we will not support the nRF5 SDK.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using RTC to get real time for nRF9160DK</title><link>https://devzone.nordicsemi.com/thread/268500?ContentTypeID=1</link><pubDate>Tue, 08 Sep 2020 11:51:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7d5641ac-b7b4-496c-a3c7-574c8c0f3cd1</guid><dc:creator>Adeel</dc:creator><description>&lt;p&gt;Hi Tobjorn,&lt;/p&gt;
&lt;p&gt;Oh okay. I found some examples that used NVIC. Is it compatible for the nRF52 series ?&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Adeel.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using RTC to get real time for nRF9160DK</title><link>https://devzone.nordicsemi.com/thread/268316?ContentTypeID=1</link><pubDate>Mon, 07 Sep 2020 12:47:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:80336b2f-b8dd-49ac-b0a9-ee7898f984fd</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Adeel&lt;/p&gt;
&lt;p&gt;The NVIC API is not supported in Zephyr.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;To enable an interrupt you have to do the following (using the RTC1 interrupt as an example):&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;IRQ_DIRECT_CONNECT(RTC1_IRQn, 0, RTC1_IRQHandler, 0);
irq_enable(RTC1_IRQn);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using RTC to get real time for nRF9160DK</title><link>https://devzone.nordicsemi.com/thread/268084?ContentTypeID=1</link><pubDate>Fri, 04 Sep 2020 13:04:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:86a253d1-33a4-449f-9c26-55feb95a7bde</guid><dc:creator>Adeel</dc:creator><description>&lt;p&gt;Hi Tobjorn,&lt;/p&gt;
&lt;p&gt;Yes. It could be and I am able to use the k_timers for generating timer interrupts after a certain defined time interval. But I also wanted to generate interrupts through an interrupt handler function that caters to the interrupts instantly through a handler.&lt;/p&gt;
&lt;p&gt;I tried it in the example mentioned above to try and enable an interrupt through NVIC_EnableIRQ (RTC0_IRQn). As per my understanding , this enabling of the interrupt should transfer the program to its handler function :&amp;nbsp;void RTC0_IRQHandler(void) wherein I have a certain task written inside the handler function.&lt;/p&gt;
&lt;p&gt;Is there another example with the interrupt handler functions wherein I could check its functionality. I am basically trying to work on high priority interrupts.&amp;nbsp; &amp;nbsp;&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Adeel.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using RTC to get real time for nRF9160DK</title><link>https://devzone.nordicsemi.com/thread/268041?ContentTypeID=1</link><pubDate>Fri, 04 Sep 2020 11:34:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b27b10ab-8873-4b36-9997-41cb53a18a1c</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Adeel&lt;/p&gt;
&lt;p&gt;Would the k_timer approach I suggested in one of the other cases be an alternative?&lt;/p&gt;
&lt;p&gt;It shouldn&amp;#39;t be necessary to use a dedicated RTC for timing, since you have Zephyr timers available (similar to the app_timer module in the nRF5 SDK, if you have any experience with that).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using RTC to get real time for nRF9160DK</title><link>https://devzone.nordicsemi.com/thread/267610?ContentTypeID=1</link><pubDate>Wed, 02 Sep 2020 11:19:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e6dca237-3b39-4571-b433-80cbeab94540</guid><dc:creator>Adeel</dc:creator><description>&lt;p&gt;Hi Tobjorn,&lt;/p&gt;
&lt;p&gt;Yes, I had tried this basic RTC example and it worked for me. I was working on the other example as it was more of what I wanted when working with an interrupt.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/andenore/NordicSnippets/blob/master/examples/rtc/main.c"&gt;https://github.com/andenore/NordicSnippets/blob/master/examples/rtc/main.c&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The code works and I was trying to generate an interrupt on a compare event and that does not happen.&lt;/p&gt;
&lt;p&gt;I want to generate a compare event every 10 secs and so I set my CC[0] value to 327680. I want to trigger an interrupt as soon as the compare event is achieved and the interrupt should join back to the original program after 10 secs.&lt;/p&gt;
&lt;p&gt;When I run the code and view it in debug mode, I see that the counter as well as the compare register CC[0] resets to zero after the compare is achieved and the interrupt is not triggered. I assume that the code has to execute the interrupt handler RTC0_IRQHandler() after the compare event is done and the CC[0] value should not be reset to 0 automatically after the compare event.&lt;/p&gt;
&lt;p&gt;I have used the same code above and just changed the CC[0] value to 327680.&lt;/p&gt;
&lt;p&gt;Can you help me in identifying the issue here.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Adeel.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using RTC to get real time for nRF9160DK</title><link>https://devzone.nordicsemi.com/thread/267572?ContentTypeID=1</link><pubDate>Wed, 02 Sep 2020 09:14:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ff204884-02b4-44af-92c3-3ade8beb82d5</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Adeel&lt;/p&gt;
&lt;p&gt;One of my colleagues wrote a number of small examples showing how to use various peripherals in the nRF9160, including this one for the RTC:&lt;br /&gt;&lt;a href="https://github.com/Rallare/fw-nrfconnect-nrf/tree/nrf9160_samples/samples/nrf9160/nrfx/rtc"&gt;https://github.com/Rallare/fw-nrfconnect-nrf/tree/nrf9160_samples/samples/nrf9160/nrfx/rtc&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I tried to integrate it in my own example, and got it working quite easily. The only change I did was to replace the toggling of LED&amp;#39;s with a printk() call.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The critical thing is to include the following line from the prj.conf file:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_COMPILER_OPT=&amp;quot;-DNRFX_RTC_ENABLED=1 -DNRFX_RTC0_ENABLED=1&amp;quot;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;And the following line from the Kconfig file:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;config FORCE_NRFX_MODULES
	bool &amp;quot;Test to force nrfx enabled&amp;quot;
	select NRFX_RTC
	default y&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;You can also consider using a Zephyr timer object, which is provided as a part of the Zephyr RTOS:&lt;br /&gt;&lt;a href="https://docs.zephyrproject.org/1.12.0/kernel/timing/timers.html"&gt;https://docs.zephyrproject.org/1.12.0/kernel/timing/timers.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I confirmed internally that the Zephyr timers should be as accurate as the 32kHz clock you are using (RC or XO), which means if you use an external 32kHz crystal as the source they can be quite accurate.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using RTC to get real time for nRF9160DK</title><link>https://devzone.nordicsemi.com/thread/267415?ContentTypeID=1</link><pubDate>Tue, 01 Sep 2020 09:40:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:15560c0c-0fa9-4803-b137-eb2c9ad9e0ad</guid><dc:creator>Adeel</dc:creator><description>&lt;p&gt;Hi Tobjorn,&lt;/p&gt;
&lt;p&gt;Thanks for the clarification. I wanted to run the device in a very low power mode and therefore calling NTP at regular intervals would really consume a lot of current. So, instead I was looking for some alternate solutions to get time through the hardware clock as such.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Also, regarding the interrupt, I tried to work with this snippet given from Nordic:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/andenore/NordicSnippets/blob/master/examples/rtc/main.c"&gt;https://github.com/andenore/NordicSnippets/blob/master/examples/rtc/main.c&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This explains very well the procedure of the code but I am unable to trigger the interrupt via this code. I was hoping to trigger the interrupt every second for now and kept the CC[0] register at 32768.&lt;/p&gt;
&lt;p&gt;Could you please have a look and let me know how to visualize if the interrupt is working or not in this case. I tried to see it in the debug mode and the register values vary at breakpoints set by me , but I would like to know how to see if the interrupt is working here.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Adeel.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using RTC to get real time for nRF9160DK</title><link>https://devzone.nordicsemi.com/thread/267369?ContentTypeID=1</link><pubDate>Tue, 01 Sep 2020 07:52:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d2ccc5df-fd65-4438-b327-8ec8b8593812</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Adeel&lt;/p&gt;
&lt;p&gt;The LFCLK and RTC can&amp;#39;t help in getting the real time, all they can do is keep track of time once you know what it is.&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t know what kind of resolution you need, but one method would be to use the time provided by the NTP server as explained in the other case, and then run an RTC timer&amp;nbsp;or a Zephyr timer from that point on.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Then you update the local time at a fixed interval, and use this interrupt to check if you should run any scheduled events.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Using a Zephyr timer is probably the easiest, but I have to do some checking internally to figure out if the Zephyr timer is accurate enough to be used for time tracking.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If this is not the case then you should use an RTC timer through the nrfx_rtc library.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using RTC to get real time for nRF9160DK</title><link>https://devzone.nordicsemi.com/thread/267257?ContentTypeID=1</link><pubDate>Mon, 31 Aug 2020 13:10:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:51315ff0-d332-4b24-b3cd-bb2c0fd8e70d</guid><dc:creator>Adeel</dc:creator><description>&lt;p&gt;Hi Tobjorn,&lt;/p&gt;
&lt;p&gt;I am basically stuck in an issue wherein I need to get the real time and schedule certain events at that time.&lt;/p&gt;
&lt;p&gt;The idea here was to use LFCLK and RTC to try and obtain the real time and schedule events and interrupts based on that.&lt;/p&gt;
&lt;p&gt;For that, I needed an idea in order to get and schedules events and interrupts through RTC and LFCLK.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Adeel.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using RTC to get real time for nRF9160DK</title><link>https://devzone.nordicsemi.com/thread/267194?ContentTypeID=1</link><pubDate>Mon, 31 Aug 2020 11:21:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dca21ca4-7496-4460-8cb5-66a09d01fe48</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Adeel&lt;/p&gt;
&lt;p&gt;How does this case relate to the other one you opened recently?&lt;br /&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/64931/using-rtc-to-control-the-real-timestamp"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/64931/using-rtc-to-control-the-real-timestamp&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;For simplicity I will handle both.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;CAL_RTC is simply a define in nrf_calendar.h, and is defined to NRF_RTC0 by default.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Please be aware that this example is not developed for&amp;nbsp;NCS/Zephyr, so I am not sure how well it works there. Ideally it would have to be modified to use the nrfx drivers, which are supported both in the nRF5 SDK and in&amp;nbsp;NCS.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>