<?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>RTC0 nrf 52 read counter value</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/14982/rtc0-nrf-52-read-counter-value</link><description>Hi, 
 I am new to the nrf52. I want to implement the code that gives me current date and time value based on default set values. 
 for this i need to read the current counter value. Can any one tell me the simplest way to read the current counter value</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 01 Nov 2016 13:52:50 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/14982/rtc0-nrf-52-read-counter-value" /><item><title>RE: RTC0 nrf 52 read counter value</title><link>https://devzone.nordicsemi.com/thread/57169?ContentTypeID=1</link><pubDate>Tue, 01 Nov 2016 13:52:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a905a389-fb81-43ad-8928-93122e32a569</guid><dc:creator>Vishnu Pradeep</dc:creator><description>&lt;p&gt;Hi Ankush, could you post the rtc initialization?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RTC0 nrf 52 read counter value</title><link>https://devzone.nordicsemi.com/thread/57168?ContentTypeID=1</link><pubDate>Thu, 07 Jul 2016 15:38:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2f5bab89-f576-467d-9736-d1a702cfd5a4</guid><dc:creator>Ankush</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;i am able to read the value of counter by using&lt;/p&gt;
&lt;p&gt;count    =	NRF_RTC0-&amp;gt;COUNTER;&lt;/p&gt;
&lt;p&gt;Thanks for your support!!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RTC0 nrf 52 read counter value</title><link>https://devzone.nordicsemi.com/thread/57165?ContentTypeID=1</link><pubDate>Wed, 06 Jul 2016 11:18:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e35f3415-63f7-40de-8bb7-ff6d17fa28ad</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;You probably haven&amp;#39;t started a Low Frequency Clock, without one of those started, the counter doesn&amp;#39;t count. You can start the RC one (pretty inaccurate) or the XTAL one (if there&amp;#39;s a crystal mounted) which is more accurate. However, you have to start some LF clock.&lt;/p&gt;
&lt;p&gt;Usually this is taken care of by the softdevice initialisation as that needs an LF clock source, however if you&amp;#39;re not using a softdevice, ie no bluetooth, then nothing else is running one.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RTC0 nrf 52 read counter value</title><link>https://devzone.nordicsemi.com/thread/57166?ContentTypeID=1</link><pubDate>Wed, 06 Jul 2016 10:59:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c23ddaf1-7197-4ad7-8404-6d5eac3529f1</guid><dc:creator>Ankush</dc:creator><description>&lt;p&gt;Hi Terje,&lt;/p&gt;
&lt;p&gt;Actually I am using nrf_rtc_counter_get() function for getting the counter value but it is showing only one value when i print on UART terminal.
these are the statements i am using&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;         nrf_drv_rtc_t const *const    p_instance;
         temp=nrf_drv_rtc_counter_get   (p_instance)    ;
         printf(&amp;quot;current value is=%d\r\n&amp;quot;,temp);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;is it the right way ??&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RTC0 nrf 52 read counter value</title><link>https://devzone.nordicsemi.com/thread/57167?ContentTypeID=1</link><pubDate>Wed, 06 Jul 2016 10:25:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:97024382-74a8-45f2-b924-cf7034727e2a</guid><dc:creator>tesc</dc:creator><description>&lt;p&gt;Sorry, I missed the point. See the &lt;a href="http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v11.0.0%2Fgroup__nrf__rtc.html&amp;amp;cp=6_0_0_6_7_16"&gt;RTC HAL and driver&lt;/a&gt;, in particular &lt;a href="http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v11.0.0%2Fgroup__nrf__rtc__hal.html"&gt;RTC HAL&lt;/a&gt; and &lt;a href="http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v11.0.0%2Fgroup__nrf__rtc__hal.html&amp;amp;cp=6_0_0_6_7_16_0_7&amp;amp;anchor=gac530a192ba3559478b8c653ba924abfc"&gt;nrf_rtc_counter_get()&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RTC0 nrf 52 read counter value</title><link>https://devzone.nordicsemi.com/thread/57164?ContentTypeID=1</link><pubDate>Wed, 06 Jul 2016 09:58:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8727f293-fd59-4d68-8287-0f350faa0ff0</guid><dc:creator>Ankush</dc:creator><description>&lt;p&gt;thanks Terje for your reply.&lt;/p&gt;
&lt;p&gt;Do you have any idea how can I read the value of real time counter in nrf52?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RTC0 nrf 52 read counter value</title><link>https://devzone.nordicsemi.com/thread/57163?ContentTypeID=1</link><pubDate>Wed, 06 Jul 2016 09:41:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4b9bb6cb-5b29-43a5-a0d5-f24d899a1acb</guid><dc:creator>tesc</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;First I must stress that the real time counter (RTC) is a timer. It is not, as the abbreviation &amp;quot;RTC&amp;quot; may suggest, a real time clock. However, it runs off the 32 kHz clock and can be used to keep track of time within the accuracy of that clock signal.&lt;/p&gt;
&lt;p&gt;You will find that the &lt;a href="http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v11.0.0%2Frtc_example.html&amp;amp;cp=6_0_0_4_5_23"&gt;Real Time Counter Example&lt;/a&gt; of the latest SDK uses RTC on the nRF52.&lt;/p&gt;
&lt;p&gt;For date and time calculation I suggest that you use an existing time and date library, since there are a lot of pitfalls when working with time and date. I think the &lt;code&gt;ctime&lt;/code&gt; standard c library would be a good choice. Most likely the &lt;code&gt;time_t&lt;/code&gt; format will be a unix timestamp and it should be safe to increment a &amp;quot;current time&amp;quot; value of this type every second to keep it up to date.&lt;/p&gt;
&lt;p&gt;Regards, Terje&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RTC0 nrf 52 read counter value</title><link>https://devzone.nordicsemi.com/thread/57162?ContentTypeID=1</link><pubDate>Wed, 06 Jul 2016 09:16:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1bbe18cf-c039-46c0-9de9-ae4c316f777e</guid><dc:creator>Ankush</dc:creator><description>&lt;p&gt;I am using following instructions to read current value&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;              nrf_drv_rtc_t const *const 	p_instance;
             temp=nrf_drv_rtc_counter_get	(p_instance)	;
	printf(&amp;quot;current value is=%d\r\n&amp;quot;,temp);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Is it the right way to read value? I am getting only one value. here it is not updating.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>