<?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>Counting Ticks vs Setting Timer</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/77216/counting-ticks-vs-setting-timer</link><description>Hi All, 
 
 wondering if anyone else has experienced this. I&amp;#39;m currently developing a program based off of the ble_hids example in SDK17. Currently I&amp;#39;m using the app_timer to give me a repeated trigger every 20ms. This seems to be working well based off</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 08 Jul 2021 12:27:56 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/77216/counting-ticks-vs-setting-timer" /><item><title>RE: Counting Ticks vs Setting Timer</title><link>https://devzone.nordicsemi.com/thread/319169?ContentTypeID=1</link><pubDate>Thu, 08 Jul 2021 12:27:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:403cd507-15cf-4841-8a27-acd23a54482c</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;/p&gt;
&lt;p&gt;How do you measure the 11ms delay when hanging in the loop?&lt;/p&gt;
&lt;p&gt;Do you know if you are using the internal RC oscillator or an external 32.768kHz crystal as source for the low frequency clock?&lt;/p&gt;
&lt;p&gt;If you use the internal RC oscillator you can have a rather large frequency offset, unless the RC calibration routine is run repeatedly (if you have a Bluetooth SoftDevice running then calibration should be run automatically).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Also, I would&amp;nbsp;recommend using a second app_timer instance to schedule this delay rather than relying on a loop. Even if you need to make your code blocking you could then go to sleep while waiting for the callback to trigger, rather than run a loop continuously.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>