<?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>Delay Generation Using timer interrupt</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/47516/delay-generation-using-timer-interrupt</link><description>Hi All, 
 Currently in my project i&amp;#39;m using hard core delay and delay is custom i.e some places i have used millisecond and in some places used microsecond and in sec.But i wanted to generate delay using timer interrupt.Can anyone tell me how to generate</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 21 May 2019 06:24:42 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/47516/delay-generation-using-timer-interrupt" /><item><title>RE: Delay Generation Using timer interrupt</title><link>https://devzone.nordicsemi.com/thread/188083?ContentTypeID=1</link><pubDate>Tue, 21 May 2019 06:24:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:33083d79-b009-490b-bb7f-52583cbd725f</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I am not sure that I understand your question.&lt;/p&gt;
&lt;p&gt;You will either have to use nrf_delay.h&amp;nbsp;by using nrf_delay_us(), which will work as long as you don&amp;#39;t need exact timing and the code is not interrupted (in which case it will be that that much longer).&lt;/p&gt;
&lt;p&gt;You can use an RTC for this, but one is taken by the softdevice and the other by the app_timer module, so that might not work for you.&lt;/p&gt;
&lt;p&gt;Then the last option is to use a TIMER, for instance look a the \examples\peripheral\timer\ in the SDK, then you can use the nrf_drv_timer_us_to_ticks() to set the time until expire.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Amanda&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>