<?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 &amp;quot;tick&amp;quot; Interrupt Timing Anomaly</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/92242/rtc-tick-interrupt-timing-anomaly</link><description>In my nRF52810 based circuit board I&amp;#39;m trying to use the RTC along with the RTC tick interrupt to toggle an IO pin every 6msec. In main.c I use WFE to enter low power mode between the RTC tick event interrupts. This seems to work fine with the output</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 26 Sep 2022 07:25:27 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/92242/rtc-tick-interrupt-timing-anomaly" /><item><title>RE: RTC "tick" Interrupt Timing Anomaly</title><link>https://devzone.nordicsemi.com/thread/387805?ContentTypeID=1</link><pubDate>Mon, 26 Sep 2022 07:25:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:96a38b20-0ba3-4d2f-b2e3-6416e6bf473b</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Thank you for confirming what the problem was. I have not seen this failure mode before. When the wrong clock source is selected (i.e. using LFXO when crystal is not mounted), I normally expect the program to get &amp;quot;stuck&amp;quot; waiting for the &lt;span class="item"&gt;&lt;a title="EVENTS_LFCLKSTARTED" href="https://infocenter.nordicsemi.com/topic/ps_nrf52810/clock.html?cp=4_5_0_4_3_2_8#register.EVENTS_LFCLKSTARTED"&gt;EVENTS_LFCLKSTARTED&lt;/a&gt; event. However, in the RTC example we don&amp;#39;t wait for this event, but just start the RTC right away. This means the RTC will start off with the RC oscillator.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="item"&gt;From the 52810 PS:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;span class="item"&gt;&amp;quot;The LFCLK clock is started by first selecting the preferred clock source in register &lt;a class="xref" href="https://infocenter.nordicsemi.com/topic/ps_nrf52810/clock.html?cp=4_5_0_4_3_1#register.LFCLKSRC"&gt;LFCLKSRC&lt;/a&gt; and then triggering the LFCLKSTART task. If the LFXO is selected as the clock source, &lt;strong&gt;the LFCLK will initially start running from the 32.768 kHz LFRC while the LFXO is starting up and automatically switch to using the LFXO once this oscillator is running&lt;/strong&gt;. The LFCLKSTARTED event will be generated when the LFXO has been started.&amp;quot; (&lt;a class="" title="LFCLK clock controller" href="https://infocenter.nordicsemi.com/topic/ps_nrf52810/clock.html?cp=4_5_0_4_3_1#concept_xkj_np1_2r"&gt;LFCLK clock controller&lt;/a&gt;)&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RTC "tick" Interrupt Timing Anomaly</title><link>https://devzone.nordicsemi.com/thread/387759?ContentTypeID=1</link><pubDate>Sun, 25 Sep 2022 00:05:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b031ab62-571f-4cdf-b25a-9b2fbd8860fb</guid><dc:creator>Vincent1</dc:creator><description>&lt;p&gt;Marking as answered.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RTC "tick" Interrupt Timing Anomaly</title><link>https://devzone.nordicsemi.com/thread/387758?ContentTypeID=1</link><pubDate>Sun, 25 Sep 2022 00:03:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:375c8965-a43d-487c-ba46-76211d92dba3</guid><dc:creator>Vincent1</dc:creator><description>&lt;p&gt;Problem solved. &amp;nbsp;The clock module had been misconfigured in that the 32khz oscillator was configured to use an external xtal when the board actually relies on the 52810 internal RC oscillator. &amp;nbsp;Amazing it worked at all and I still don&amp;#39;t fully understand what was going on but once the 32khz clock source was correctly set in config.h (via CMSIS Wizard), the clocking is stable and the design works as intended.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RTC "tick" Interrupt Timing Anomaly</title><link>https://devzone.nordicsemi.com/thread/387741?ContentTypeID=1</link><pubDate>Fri, 23 Sep 2022 17:50:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7a449ccd-98b6-476e-8edd-17db4d8a3c3f</guid><dc:creator>Vincent1</dc:creator><description>&lt;p&gt;Vidar, &amp;nbsp;Much thanks for your fast response. &amp;nbsp;I tested the code that you provided exactly as written and it still fails the same way. &amp;nbsp;One more piece of information. &amp;nbsp;If I change the RTC pre-scaler from 203 to 406, the Period of the output toggle doubles as you would expect but after exactly 50 seconds of runtime, the toggle Period switches from the expected 12.4 msec to this odd new wavelength of 14 seconds which is exactly double that which I was seeing with a pre-scaler value of 203. &amp;nbsp;In other words, this long wavelength is related somehow to the value of the pre-scaler but can&amp;#39;t be explained entirely by the pre-scaler because you could never achieve an RTC tick interrupt of 14 seconds with the pre-scaler alone.&lt;/p&gt;
&lt;p&gt;In your attempt to reproduce the problem, were you running an nrf52810? &amp;nbsp;I saw some errata regarding the RTC and am just wondering. &amp;nbsp;I&amp;#39;m running out of ideas for things to look at. &amp;nbsp;If this were a board level hardware issue, I wouldn&amp;#39;t expect this odd result to repeat itself with such precise timing.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RTC "tick" Interrupt Timing Anomaly</title><link>https://devzone.nordicsemi.com/thread/387656?ContentTypeID=1</link><pubDate>Fri, 23 Sep 2022 10:37:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f5f38b4f-b0ac-461a-b457-98089b29b335</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I&amp;#39;m afraid I can&amp;#39;t think of any explanations for this behavior. I also tried to reproduce this here with the test example below (requires SDK 17.1.0) without any luck. Maybe you can try this example and see if you get the same result? I tested with both the RC oscillator and crystal oscillator as the 32K clock source, but it didn&amp;#39;t make any difference.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/0511.rtc_5F00_test.zip"&gt;devzone.nordicsemi.com/.../0511.rtc_5F00_test.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Logic trace after letting it run for a few minutes:&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1663929464065v2.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>