<?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>Not sure if understand APP_TIMER_TICKS macro.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/9229/not-sure-if-understand-app_timer_ticks-macro</link><description>Hi, 
 I know that there is documentation, and that there are some answered questions abaut this, but still i dont think i understood how macro APP_TIMER_TICKS works. I need to read adc with frequency 500hz, and i2c with frequency 20hz. i am using NRF51DK</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 25 Apr 2017 10:56:37 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/9229/not-sure-if-understand-app_timer_ticks-macro" /><item><title>RE: Not sure if understand APP_TIMER_TICKS macro.</title><link>https://devzone.nordicsemi.com/thread/34072?ContentTypeID=1</link><pubDate>Tue, 25 Apr 2017 10:56:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c8d13a39-7100-4413-afc8-83c9bc9813da</guid><dc:creator>Nabil</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I have read that but I don&amp;#39;t understand.&lt;/p&gt;
&lt;p&gt;The minimum resolution is 1 ms ?&lt;/p&gt;
&lt;p&gt;Solved :&lt;/p&gt;
&lt;p&gt;with PRESCALER of 22 I can have 39.2 uS&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Not sure if understand APP_TIMER_TICKS macro.</title><link>https://devzone.nordicsemi.com/thread/34071?ContentTypeID=1</link><pubDate>Tue, 25 Apr 2017 10:54:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:381ecae0-5c20-4bd8-b99d-8c9b0381cd30</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;You need to configure app_timer with atleast 5 RTC ticks minimum . With 1 tick about 30.5uS, the minimum you can use with app_timer is 153uS.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Not sure if understand APP_TIMER_TICKS macro.</title><link>https://devzone.nordicsemi.com/thread/34070?ContentTypeID=1</link><pubDate>Tue, 25 Apr 2017 10:13:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a090235f-d638-4da0-92cc-0befa0ba7022</guid><dc:creator>Nabil</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Is it possible to configure the timer for 100 uS with APP_TIMER?&lt;/p&gt;
&lt;p&gt;Thank you&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Not sure if understand APP_TIMER_TICKS macro.</title><link>https://devzone.nordicsemi.com/thread/34069?ContentTypeID=1</link><pubDate>Wed, 27 Jul 2016 09:31:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:421e016e-4d56-4bf4-a572-74ca5a3cb5f9</guid><dc:creator>lee.W</dc:creator><description>&lt;p&gt;I couldn&amp;#39;t even find the include file to use this macro so your doing better than me already!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Not sure if understand APP_TIMER_TICKS macro.</title><link>https://devzone.nordicsemi.com/thread/34068?ContentTypeID=1</link><pubDate>Tue, 15 Sep 2015 08:16:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:82719048-67a0-44a3-9a0a-39fd36a4b609</guid><dc:creator>Ina</dc:creator><description>&lt;p&gt;Thank You very much for quick and detailed answer, it really helped me!
Regards, Ina&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Not sure if understand APP_TIMER_TICKS macro.</title><link>https://devzone.nordicsemi.com/thread/34067?ContentTypeID=1</link><pubDate>Tue, 15 Sep 2015 07:36:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6fe4ee14-a319-4a21-9cb5-54b96b76b688</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;APP_TIMER is running with frequency 32768 Hz.&lt;/p&gt;
&lt;p&gt;This means that with prescaler 0, it will generate 32768 ticks per second.&lt;/p&gt;
&lt;p&gt;Since the app_timer_start function arguments needs the time in ticks and not in millisecond, we need to convert the interval in ms after which you need your timer_callback to be called into app_timer ticks.&lt;/p&gt;
&lt;p&gt;This can be done using APP_TIMER_TICKS(X,Y)&lt;/p&gt;
&lt;p&gt;500Hz sampling means that you you need one sample every 1/500 = 2ms, so to convert this sampling interval into app_timer ticks you need&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;APP_TIMER_TICKS(2, APP_TIMER_PRESCALER)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;20Hz sampling means that you you need one sample every 1/20= 50ms, so to convert this sampling interval into app_timer into ticks you need&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;APP_TIMER_TICKS(50, APP_TIMER_PRESCALER)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;So yes, you got it right :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>