<?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 not accurate</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/77970/rtc-not-accurate</link><description>hi support team, 
 
 i have ESB project for customer, and now i have one fundamental question about RTC cc compare event, i am struggled in this problem. 
 static __INLINE void radio_rtc_compare0_set(uint32_t value) 
 { 
 RADIO_RTC-&amp;gt;CC[0] = value -1;</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 29 Jul 2021 14:33:42 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/77970/rtc-not-accurate" /><item><title>RE: RTC not accurate</title><link>https://devzone.nordicsemi.com/thread/322513?ContentTypeID=1</link><pubDate>Thu, 29 Jul 2021 14:33:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e15d162d-1905-438e-9232-e568b483b282</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi William,&lt;/p&gt;
&lt;p&gt;Yes, it looks like that is correct. I created a sample application that will use PPI+GPIOTE to toggle GPIOs on the TICK and COMPARE0 events from the RTC. The COMPARE0 event will also clear the RTC through a PPI fork.&lt;/p&gt;
&lt;p&gt;As you can see from the logic trance, there is a delay between the COMPARE0 event where the RTC is cleared before the first TICK event occurs. This is what is described in the image you posted.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x176/__key/communityserver-discussions-components-files/4/rtc_5F00_tick_5F00_compare_5F00_logic.png" /&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Jørgen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RTC not accurate</title><link>https://devzone.nordicsemi.com/thread/322132?ContentTypeID=1</link><pubDate>Tue, 27 Jul 2021 09:01:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c5c73b5d-4447-4f9b-903c-3b483b92370b</guid><dc:creator>William.wei</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;span&gt;Jørgen,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;is it related to such document in the spec? i am not sure because of this&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1627376425957v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;William.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RTC not accurate</title><link>https://devzone.nordicsemi.com/thread/322131?ContentTypeID=1</link><pubDate>Tue, 27 Jul 2021 08:16:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a7704693-0df4-4e49-8bb5-23dc5b85a852</guid><dc:creator>William.wei</dc:creator><description>&lt;ul&gt;
&lt;li&gt;&lt;span&gt;Which clock source are you using for the LFCLK?&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/clock.html?cp=4_2_0_18_1_0#concept_acb_q5y_2q"&gt;LFRC&lt;/a&gt;&amp;nbsp;or&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/clock.html?cp=4_2_0_18_1_3#concept_pln_z5y_2q"&gt;LFXO&lt;/a&gt;?&amp;nbsp;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="color:rgba(0, 0, 255, 1);"&gt;&lt;strong&gt;xtal 32K;&lt;/strong&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;If using LFRC, do you&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/clock.html?cp=4_2_0_18_1_1#calibrating_32768khz_rcosc"&gt;calibrate&lt;/a&gt;&amp;nbsp;the LFCLK after powerup and at regular intervals?&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;Is there any other peripherals running at higher priority that could delay the handling of the RTC event? To get exact timing without being affected by other higher priority peripherals, you can connect the COMPARE event from the RTC to a toggle a GPIO using GPIOTE through PPI.&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="color:rgba(0, 0, 255, 1);"&gt;&lt;strong&gt;directly interrupt handler&lt;/strong&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="color:rgba(0, 0, 255, 1);"&gt;&lt;strong&gt;void RADIO_RTC_IRQHandler(void)&lt;br /&gt;{&lt;br /&gt; if (RADIO_RTC-&amp;gt;EVENTS_COMPARE[0] == 1) &lt;br /&gt; {&lt;br /&gt; RADIO_RTC-&amp;gt;EVENTS_COMPARE[0] =0; //clear rtc compare event&lt;br /&gt; }&lt;br /&gt; nrf_gpio_pin_toggle(DATA_SENDING_P1);&lt;br /&gt; if(on_radio_rtc_interrupt)&lt;br /&gt; on_radio_rtc_interrupt(); &lt;br /&gt;}&lt;/strong&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;Is the delay in RTC event handling consistent for every event, or does it differ&amp;nbsp;after powerup?&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="color:rgba(0, 0, 255, 1);"&gt;&lt;strong&gt;no delay in the handler as upper code,sometimes it is correct, sometimes it is not correct, looks like there is one tick delay(randomly) after&amp;nbsp;device resetting.&lt;/strong&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;Are you seeing this on multiple devices, or just one device?&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="color:rgba(0, 0, 255, 1);"&gt;&lt;strong&gt;multi DK boards, i believe it is common phenomenon;&lt;/strong&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Regards,&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;William.&lt;/strong&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RTC not accurate</title><link>https://devzone.nordicsemi.com/thread/322130?ContentTypeID=1</link><pubDate>Mon, 26 Jul 2021 10:19:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4450c848-4339-46db-bed9-50e3ae4006cd</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;span&gt;William,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I have some questions that needs clarification:&lt;/span&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span&gt;Which clock source are you using for the LFCLK? &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/clock.html?cp=4_2_0_18_1_0#concept_acb_q5y_2q"&gt;LFRC&lt;/a&gt; or &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/clock.html?cp=4_2_0_18_1_3#concept_pln_z5y_2q"&gt;LFXO&lt;/a&gt;?&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;If using LFRC, do you &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/clock.html?cp=4_2_0_18_1_1#calibrating_32768khz_rcosc"&gt;calibrate&lt;/a&gt; the LFCLK after powerup and at regular intervals?&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;Is there any other peripherals running at higher priority that could delay the handling of the RTC event? To get exact timing without being affected by other higher priority peripherals, you can connect the COMPARE event from the RTC to a toggle a GPIO using GPIOTE through PPI.&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;Is the delay in RTC event handling consistent for every event, or does it differ&amp;nbsp;after powerup?&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;Are you seeing this on multiple devices, or just one device?&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;br /&gt;Jørgen&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>