<?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>how can i change RTC Interrupt calling time?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/17242/how-can-i-change-rtc-interrupt-calling-time</link><description>i m using pca10028.. and sdk12 with eclipse gcc tool chain setup on windows..im run Peripheral&amp;gt;rtc example successfully... interrupt call every 0.125sec but now i want to interrupt call every 1 sec... i m change config, prescaler value form 4095 to (4095</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 24 Oct 2016 18:56:44 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/17242/how-can-i-change-rtc-interrupt-calling-time" /><item><title>RE: how can i change RTC Interrupt calling time?</title><link>https://devzone.nordicsemi.com/thread/66230?ContentTypeID=1</link><pubDate>Mon, 24 Oct 2016 18:56:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9a6b812e-cdf5-4d74-9d88-d07ba3302d1b</guid><dc:creator>jignesh</dc:creator><description>&lt;p&gt;can i get accurate 1 second interrupt by timer... same as rtc....&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how can i change RTC Interrupt calling time?</title><link>https://devzone.nordicsemi.com/thread/66229?ContentTypeID=1</link><pubDate>Mon, 24 Oct 2016 09:39:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f435073f-0da9-435e-bf22-d782e6f40bf5</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;The &lt;code&gt;COUNTER_PRESCALER&lt;/code&gt; is used to set the NRF_RTC0-&amp;gt;PRESCALER register. The prescaler register of the RTC is a 12 bit wide register, which means that the maximum value the prescaler is capable of holding is 2^12 - 1 = 4095.&lt;/p&gt;
&lt;p&gt;The RTC uses the 32KHz (actually 32768Hz) clock, so the formula for calculating the prescaler value is:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Prescaler value = 32768 / Frequency - 1
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;So if we want a frequency of 1, we get an prescaler value of 32768 / 1 - 1 = 32767. This number is too big to fit inside the prescale register (16 bits is required to represent 32767), so we get an overflow.&lt;/p&gt;
&lt;p&gt;We can change the formula to calculate frequency instead:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Frequency = 32768 / (Precsaler value + 1)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Setting the prescaler value to the maximum value gives: 32768 / (4095 + 1) = &lt;code&gt;8 Hz&lt;/code&gt;. This is the lowest frequency possible in the RTC. (interrupt every 0.125sec)&lt;/p&gt;
&lt;p&gt;So to get an interrupt every 1 second, I would recommend to use either the &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v12.0.0/group__nrf__timer.html?cp=4_0_0_6_6_21"&gt;timer&lt;/a&gt; or &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v12.0.0/lib_timer.html?cp=4_0_0_3_28"&gt;application timer&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Take a look at e.g. the &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v12.0.0/nrf_dev_timer_example.html?cp=4_0_0_4_5_35"&gt;Timer example&lt;/a&gt;. Here you can set &lt;code&gt;uint32_t time_ms&lt;/code&gt; in main.c to 1000 to get the interrupt &lt;code&gt;timer_led_event_handler&lt;/code&gt; to trigger every 1 second.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how can i change RTC Interrupt calling time?</title><link>https://devzone.nordicsemi.com/thread/66228?ContentTypeID=1</link><pubDate>Mon, 24 Oct 2016 03:16:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6bb69be8-a92e-443c-9907-5f91c8142aa5</guid><dc:creator>jignesh</dc:creator><description>&lt;p&gt;please give me solution&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>