<?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 in nRF51822</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/65146/using-rtc-in-nrf51822</link><description>hi all, 
 I am using the following example: 
 &amp;quot;..\nRF5_SDK_12.3.0_d7731ad\examples\ble_peripheral\ble_app_uart_adc_scan_mode&amp;quot; to send via bluetooth data coming from ADC. 
 I have a question. Could it possibile to introduce an RTC in that example? If answer</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 25 Aug 2020 12:41:28 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/65146/using-rtc-in-nrf51822" /><item><title>RE: using RTC in nRF51822</title><link>https://devzone.nordicsemi.com/thread/266236?ContentTypeID=1</link><pubDate>Tue, 25 Aug 2020 12:41:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bcaef2d5-78f0-4815-91dd-cb4d8a0feb5c</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;I see. Then you want to use the app_timer library, which is already used in the example you use. This is a library that is designed to create an arbitrary number of timers using a single RTC instance and is used all over the SDK for such purposes.&lt;/p&gt;
&lt;p&gt;You should create a repeated app timer, and do your periodic work there. I suggest you refer to the &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v12.3.0/lib_timer.html"&gt;app_timer documentation&lt;/a&gt;. You may also find the &lt;a href="https://devzone.nordicsemi.com/nordic/short-range-guides/b/software-development-kit/posts/application-timer-tutorial"&gt;app_timer tutorial&lt;/a&gt; useful, though it is no longer 100% accurate for SDK 12.3.&lt;/p&gt;
&lt;p&gt;As the example already initialize the app timer, you essentially just need to add a few pieces of code for your timer. One simple example can be found in &amp;lt;SDK 12.3&amp;gt;\examples\peripheral\wdt\main.c, where the app timer is used to regularly feed the WDT. Your application already initializes the app timer module, but you should refer to this example to see how to create and start an app timer instance.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: using RTC in nRF51822</title><link>https://devzone.nordicsemi.com/thread/266226?ContentTypeID=1</link><pubDate>Tue, 25 Aug 2020 12:14:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:866d262a-1fff-4d88-9b0a-a48d689e46d2</guid><dc:creator>Angelo Cotroneo</dc:creator><description>&lt;p&gt;Thanks a lot. I don&amp;#39;t know what is the best solution.&lt;/p&gt;
&lt;p&gt;My scope is to set the chip in sleep mode (after a trasmission of the data) and every &amp;#39;x&amp;#39; seconds (thanks to the RTC) wake up the chip and repeat the trasmission. &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: using RTC in nRF51822</title><link>https://devzone.nordicsemi.com/thread/266208?ContentTypeID=1</link><pubDate>Tue, 25 Aug 2020 11:37:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4c1c2db5-2738-49f5-a5e6-7572ac2e97aa</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Yes, I can suggest modifications. But first please clarify what exactly you want to achieve, as that determines which approach you should use.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: using RTC in nRF51822</title><link>https://devzone.nordicsemi.com/thread/266205?ContentTypeID=1</link><pubDate>Tue, 25 Aug 2020 11:33:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:33ef1922-a56a-4263-9123-0330f25eca26</guid><dc:creator>Angelo Cotroneo</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;thanks a lot for the answer. The post that you have linked is correct. Can you help me how to modify the code?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: using RTC in nRF51822</title><link>https://devzone.nordicsemi.com/thread/266163?ContentTypeID=1</link><pubDate>Tue, 25 Aug 2020 09:36:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1b65b7f9-69c6-4f8b-8786-71dd73c709ec</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I assume you are referring to the example from &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/19813/adc-ppi-sdk-v11-0-0-works-but-v12-2-0-does-not/77067#77067"&gt;this post&lt;/a&gt;? It is possible to use the RTC in this example. Ther are a few things to note, though. The nRF51 has only two RTC peripherals. RTC0 is used by the SoftDevice, so that is already taken in this example, which uses a SoftDevice. RTC1 is used by the &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v12.3.0/lib_timer.html"&gt;app_timer library&lt;/a&gt;, which is also used in this example, as it is used by the BSP module.&lt;/p&gt;
&lt;p&gt;If you need to use an RTC your options are to either use it via the app_timer library, or to remove the app_timer library, and use it directly. Which makes most sense depends on your requirements.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>