<?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 in nrf52832</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/99839/rtc-in-nrf52832</link><description>Hi all, 
 I use the RTC to do something in freertos every 2ms. 
 and I use this code to start the rtc 
 
 the RTC0 have a interrupt to do something, and the RTC2 just used as a reference. 
 This is the IRQ handler. 
 
 I have 2 questions. 
 1. after the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 29 May 2023 09:20:44 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/99839/rtc-in-nrf52832" /><item><title>RE: RTC in nrf52832</title><link>https://devzone.nordicsemi.com/thread/427978?ContentTypeID=1</link><pubDate>Mon, 29 May 2023 09:20:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:baa4562f-3d45-4a32-96d9-ada996e80f46</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Glad I could help, If there is nothing else regarding this context, can you please mark this thread verified so that it could help other searching for similar issues.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RTC in nrf52832</title><link>https://devzone.nordicsemi.com/thread/427669?ContentTypeID=1</link><pubDate>Fri, 26 May 2023 07:11:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b5659855-2846-46e8-b95c-95ad659a925c</guid><dc:creator>Lurn_Z</dc:creator><description>&lt;p&gt;Thanks for your reply.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RTC in nrf52832</title><link>https://devzone.nordicsemi.com/thread/427667?ContentTypeID=1</link><pubDate>Fri, 26 May 2023 07:09:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4992036f-9846-4c02-98d5-000cd6e6f11d</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Then all the PPI channels below 20 are available to use which are not used for ESB.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RTC in nrf52832</title><link>https://devzone.nordicsemi.com/thread/427644?ContentTypeID=1</link><pubDate>Fri, 26 May 2023 05:51:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:be868913-befb-4664-97e7-2ef1b1fd9f0b</guid><dc:creator>Lurn_Z</dc:creator><description>&lt;p&gt;No, I didn&amp;#39;t use the softdevice, I used ESB and UARTE, and I only know which channels the ESB uses.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RTC in nrf52832</title><link>https://devzone.nordicsemi.com/thread/427643?ContentTypeID=1</link><pubDate>Fri, 26 May 2023 05:42:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c6fba6d9-90b0-49bf-b6fb-e0c5b04e2e1d</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;If you are using &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fsds_s140%2FSDS%2Fs1xx%2Fsd_resource_reqs%2Fppi.html"&gt;Softdevice&lt;/a&gt;/Thread/Zigbee stack then you need to check the &amp;quot;resource requirement&amp;quot; chapter of those protocols to see which PPI channels are reserved for the protocol stack. The FreeRTOS port does not use any PPI channels. Are you using any Softdevice?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RTC in nrf52832</title><link>https://devzone.nordicsemi.com/thread/427622?ContentTypeID=1</link><pubDate>Fri, 26 May 2023 01:19:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:64d75d64-4d2f-4aa1-a63a-0e199c2c5850</guid><dc:creator>Lurn_Z</dc:creator><description>[quote userid="6207" url="~/f/nordic-q-a/99839/rtc-in-nrf52832/427572"]Not sure what you mean here, in the code snippet you used two difference channels of PPI,[/quote]
&lt;p&gt;I means if I want to use more channels, how can I be sure that these channels are available (not&amp;nbsp;used by others)?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RTC in nrf52832</title><link>https://devzone.nordicsemi.com/thread/427572?ContentTypeID=1</link><pubDate>Thu, 25 May 2023 14:46:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e50ae00b-dd1b-4331-a901-ecc0f6ce4a2e</guid><dc:creator>Susheel Nuguru</dc:creator><description>[quote user="Lurn_Z"]Q1:Since I want to use multiple PPI channels, how do I get the PPI channels that I can use?[/quote]
&lt;p&gt;Not sure what you mean here, in the code snippet you used two difference channels of PPI,&amp;nbsp;CH[0] and&amp;nbsp;CH[1].&lt;/p&gt;
[quote user="Lurn_Z"]&lt;p&gt;Q2:&lt;/p&gt;
&lt;p&gt;Could I use this code to trigger the same IRQ ?&lt;/p&gt;[/quote]
&lt;p&gt;Yes, the code makes any of the below events to trigger EGU3_IRQ and will assert the relevant event in EGU3&lt;/p&gt;
&lt;p&gt;NRF_RTC0-&amp;gt;EVENTS_COMPARE[0] -&amp;gt; triggers EGU3-&amp;gt;EVENTS_TRIGGERED[0]&lt;br /&gt;NRF_RTC0-&amp;gt;EVENTS_COMPARE[1]; -&amp;gt; triggers EGU3-&amp;gt;EVENTS_TRIGGERED[1]&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RTC in nrf52832</title><link>https://devzone.nordicsemi.com/thread/427356?ContentTypeID=1</link><pubDate>Thu, 25 May 2023 01:55:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c6d8b7a1-2ea2-49c5-b440-51b282920b66</guid><dc:creator>Lurn_Z</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;span&gt;Susheel,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Q1:Since I want to use multiple PPI channels, how do I get the PPI channels that I can use?&lt;/p&gt;
&lt;p&gt;Q2:&lt;/p&gt;
&lt;p&gt;Could I use this code to trigger the same IRQ ?&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;    NVIC_SetPriority(SWI3_EGU3_IRQn, 6);
    NVIC_EnableIRQ(SWI3_EGU3_IRQn);

    NRF_EGU3-&amp;gt;INTENSET = EGU_INTEN_TRIGGERED0_Msk;

    NRF_PPI-&amp;gt;CH[0].EEP = (uint32_t)&amp;amp;NRF_RTC0-&amp;gt;EVENTS_COMPARE[0];
    NRF_PPI-&amp;gt;CH[0].TEP = (uint32_t)&amp;amp;NRF_EGU3-&amp;gt;TASKS_TRIGGER[0];
    
    NRF_PPI-&amp;gt;CH[1].EEP = (uint32_t)&amp;amp;NRF_RTC0-&amp;gt;EVENTS_COMPARE[1];
    NRF_PPI-&amp;gt;CH[1].TEP = (uint32_t)&amp;amp;NRF_EGU3-&amp;gt;TASKS_TRIGGER[0];&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Lurn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RTC in nrf52832</title><link>https://devzone.nordicsemi.com/thread/427120?ContentTypeID=1</link><pubDate>Wed, 24 May 2023 08:09:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:36c0d3b3-66fd-4145-9f5e-298692b5f5c9</guid><dc:creator>Lurn_Z</dc:creator><description>&lt;p&gt;Thanks for your explanation.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RTC in nrf52832</title><link>https://devzone.nordicsemi.com/thread/427119?ContentTypeID=1</link><pubDate>Wed, 24 May 2023 08:06:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:005ffa84-e65e-4714-a52f-ccf305cbd79f</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;you do not need to restart it. The RTC is still running when you clear the counter, so it continue counting&amp;nbsp;just that the counter is cleared.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RTC in nrf52832</title><link>https://devzone.nordicsemi.com/thread/427105?ContentTypeID=1</link><pubDate>Wed, 24 May 2023 07:39:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7988edf3-c138-4d0f-ae65-d1a7b6542afc</guid><dc:creator>Lurn_Z</dc:creator><description>&lt;p&gt;And also I don&amp;#39;t need to restart it? use NRF_RTCn-&amp;gt;TASKS_START = 1.&lt;/p&gt;
&lt;p&gt;I see, thanks a lot.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RTC in nrf52832</title><link>https://devzone.nordicsemi.com/thread/427103?ContentTypeID=1</link><pubDate>Wed, 24 May 2023 07:35:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cbebe08e-e9d0-4b11-b93b-0ff4261cc6a4</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;No, only the counter value is cleared and the rest of the configuration should stay intact. So the timeout your configured in CC should become periodic after this short with PPI is enabled.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RTC in nrf52832</title><link>https://devzone.nordicsemi.com/thread/427075?ContentTypeID=1</link><pubDate>Wed, 24 May 2023 05:24:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:34b13b3b-38d6-42b1-a6e5-f82c884b6631</guid><dc:creator>Lurn_Z</dc:creator><description>&lt;p&gt;After clear the tasks should I&amp;nbsp;reconfigure it?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RTC in nrf52832</title><link>https://devzone.nordicsemi.com/thread/427070?ContentTypeID=1</link><pubDate>Wed, 24 May 2023 04:30:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2df36971-1b22-450c-9867-b9791024bf5e</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Please write 1 to&amp;nbsp;&lt;span&gt;&amp;nbsp;NRF_RTCn-&amp;gt;TASKS_CLEAR&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt; NRF_RTCn-&amp;gt;TASKS_CLEAR = 1;&lt;/pre&gt;&lt;/p&gt;
&lt;div style="left:216px;top:5.62216px;"&gt;
&lt;div&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RTC in nrf52832</title><link>https://devzone.nordicsemi.com/thread/427062?ContentTypeID=1</link><pubDate>Wed, 24 May 2023 03:21:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1de50772-909c-42da-88c2-362047a429d4</guid><dc:creator>Lurn_Z</dc:creator><description>&lt;p&gt;Hi Susheel,&lt;/p&gt;
&lt;p&gt;Can I reset the RTC and make the NRF_RTCn-&amp;gt;COUNTER to zero?&lt;/p&gt;
&lt;p&gt;How to do this?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Lurn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RTC in nrf52832</title><link>https://devzone.nordicsemi.com/thread/427050?ContentTypeID=1</link><pubDate>Wed, 24 May 2023 01:07:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:98e60346-078f-4a4e-bcff-588c12661897</guid><dc:creator>Lurn_Z</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I didn&amp;#39;t configure the RTC2 CC, the RTC2 is used to count.&lt;/p&gt;
&lt;p&gt;And since I didn&amp;#39;t know how to run it auto on ISR at first so I change it to PPI, and now it looks good.&lt;/p&gt;
&lt;p&gt;Thanks.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Lurn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RTC in nrf52832</title><link>https://devzone.nordicsemi.com/thread/427031?ContentTypeID=1</link><pubDate>Tue, 23 May 2023 18:11:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:91ef14d4-5192-403d-a9a9-a25c84dfb13f</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;I am not sure what you configured RTC2 with CC value? I can only see RTC0 configuration.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Instead of clearing the event and starting the RTC START tasks, you can use a PPI to connect this event to the tasks_clear. Why rely on the variable ISR completion time when you can configure PPI to make this very predictable in terms of timing.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RTC in nrf52832</title><link>https://devzone.nordicsemi.com/thread/426768?ContentTypeID=1</link><pubDate>Tue, 23 May 2023 07:47:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a7a4d791-3615-4ef6-a74f-97b8a09869fc</guid><dc:creator>Lurn_Z</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Thanks for your reply.&lt;/p&gt;
&lt;p&gt;Q1.&lt;/p&gt;
[quote userid="6207" url="~/f/nordic-q-a/99839/rtc-in-nrf52832/426756"]Maybe you should add some code like below to connect event to clear the counter in rtc_config[/quote]
&lt;p&gt;I can&amp;#39;t understand you about this, what did you mean about the below? Is what I did in IRQ handler or you just forget include the code?&lt;/p&gt;
&lt;p&gt;The information I found says the RTC didn&amp;#39;t have the SHORTS like TIMER, so we have to config it after the interrupt.&lt;/p&gt;
&lt;p&gt;And like I said, I can use PPI to do this.&lt;/p&gt;
&lt;p&gt;Q2,&lt;/p&gt;
&lt;p&gt;I will try&amp;nbsp;it to start both RTC at the same time.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Lurn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RTC in nrf52832</title><link>https://devzone.nordicsemi.com/thread/426756?ContentTypeID=1</link><pubDate>Tue, 23 May 2023 07:13:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d47db768-1b39-453e-b4b6-cc678324ae62</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Thanks for your patience during our holiday period.&lt;/p&gt;
[quote user=""]1. after the RTC0 interrupt triggered, the RTC0 will not run to next interrupt auto, so I have to do this. How to modify the config can make it continue trigger auto?[/quote]
&lt;p&gt;If you want a periodic timer using RTC, then once you have your interrupt triggered when CC value matches the counter, then you should clear the RTC counter value, so that the RTC start counting again from the start. Maybe you should add some code like below to connect event to clear the counter in rtc_config&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user=""]2. In IRQ handle I print the RTC count, and I think the value should be ((2000 * 32768)/ 1000000U)= 65.[/quote]
&lt;p&gt;I would suggest you to start both RTC instances at the same time like below.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;NRF_RTC0-&amp;gt;TASKS_START = 1;
NRF_RTC2-&amp;gt;TASKS_START = 1;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Also, it depends on how and when you are capturing the RTC counter values. If the reads for these two instances can be interrupted by some other higher priority contexts, then you can see some differences in the two counter values.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RTC in nrf52832</title><link>https://devzone.nordicsemi.com/thread/426237?ContentTypeID=1</link><pubDate>Fri, 19 May 2023 11:32:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ee7c1cbe-7be8-4e7d-8103-61bfc5bb98ba</guid><dc:creator>Menon</dc:creator><description>&lt;p&gt;Hello,&lt;br /&gt;I am sorry, but we are short staffed this week due to Public Holidays in Norway. We will be back on Monday 22nd and hope to be able to answer all incoming requests within a couple of days, depending on the backlog. I am sorry for the inconvenience.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Abhijith&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RTC in nrf52832</title><link>https://devzone.nordicsemi.com/thread/426200?ContentTypeID=1</link><pubDate>Fri, 19 May 2023 08:11:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4255ebe3-c4c1-4f58-8a21-9bfd921d1978</guid><dc:creator>Lurn_Z</dc:creator><description>&lt;p&gt;1.&lt;/p&gt;
&lt;p&gt;I solved it with PPI but still don&amp;#39;t know why it doesn&amp;#39;t work automatically.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;    NVIC_SetPriority(SWI3_EGU3_IRQn, 6);
    NVIC_EnableIRQ(SWI3_EGU3_IRQn);
    NRF_EGU3-&amp;gt;INTENSET = EGU_INTEN_TRIGGERED0_Msk;

    NRF_PPI-&amp;gt;CH[0].EEP = (uint32_t) &amp;amp;NRF_RTC0-&amp;gt;EVENTS_COMPARE[0];
    NRF_PPI-&amp;gt;CH[0].TEP = (uint32_t) &amp;amp;NRF_EGU3-&amp;gt;TASKS_TRIGGER[0];

    NRF_PPI-&amp;gt;FORK[0].TEP = (uint32_t) &amp;amp;NRF_RTC0-&amp;gt;TASKS_CLEAR;

    NRF_PPI-&amp;gt;CHENSET = PPI_CHENSET_CH0_Msk;&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>