<?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_COMPARE_OFFSET_MIN value</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/5752/rtc_compare_offset_min-value</link><description>Hi, 
 If we set the prescalar for RTC1 to 0xFFF (i.e. max value allowed), tick event is getting generated every 125msec.
Using the below configuration i started a timer to trigger every 125msec 
 #define TICK_TIMER_TICKS APP_TIMER_TICKS(125, APP_TIMER_PRESCALER</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 27 Feb 2015 10:23:55 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/5752/rtc_compare_offset_min-value" /><item><title>RE: RTC_COMPARE_OFFSET_MIN value</title><link>https://devzone.nordicsemi.com/thread/20098?ContentTypeID=1</link><pubDate>Fri, 27 Feb 2015 10:23:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7ba53d20-c32a-4f5c-82ae-bf49d43247b8</guid><dc:creator>Stefan Birnir Sverrisson</dc:creator><description>&lt;p&gt;Hi Manju&lt;/p&gt;
&lt;p&gt;I recommend to set the app_timer prescaler with the following #define, as done in the examples in the SDK&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#define APP_TIMER_PRESCALER
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Setting RTC_COMPARE_OFFSET_MIN to 1 will contain the risk of app_timer not triggering, so that is not recommended.&lt;/p&gt;
&lt;p&gt;There seem to be two limiting factors to the setting of the prescaler:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#define RTC_COMPARE_OFFSET_MIN  3                 //in app_timer.c
#define APP_TIMER_MIN_TIMEOUT_TICKS  5            //in app_timer.h
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;The RTC_COMPARE_OFFSET_MIN  is set to ensure that the RTC CC register is not set too close to the current RTC1 counter value, which will risk that no interrupt will be triggered on CC compare match.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The APP_TIMER_MIN_TIMEOUT_TICKS which is set to ensure adequate timing accuracy of the app_timer.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;So if you set the prescaler to 0x2FF. With that, the tick frequency is 15.625ms and you can set the RTC CC register to N+8 with&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;APP_TIMER_TICKS(125, APP_TIMER_PRESCALER)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;That should be both safe and accurate&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>