<?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>Maximum expected interrupt delay when using Softdevice</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/29193/maximum-expected-interrupt-delay-when-using-softdevice</link><description>I am trying to create an 80ms pulse by setting a GPIO high, starting an application timer with 80ms timeout and then setting the GPIO low in the timer ISR. I am aware that it is a common problem when trying to time accurately with the Softdevice also</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 15 Jan 2018 15:58:58 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/29193/maximum-expected-interrupt-delay-when-using-softdevice" /><item><title>RE: Maximum expected interrupt delay when using Softdevice</title><link>https://devzone.nordicsemi.com/thread/116064?ContentTypeID=1</link><pubDate>Mon, 15 Jan 2018 15:58:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2f310c55-bc5f-4c3a-b0cd-e72dc4f83927</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;If you want to investigate that I think we will need to see your code. You can edit your question here and attach your code as a file, or you can open a case in mypage, our official support portal, if you prefer confidentiality.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Maximum expected interrupt delay when using Softdevice</title><link>https://devzone.nordicsemi.com/thread/116063?ContentTypeID=1</link><pubDate>Wed, 10 Jan 2018 16:02:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4e64babe-d3f2-4c97-bebc-458459e2825e</guid><dc:creator>pajo</dc:creator><description>&lt;p&gt;I can&amp;#39;t fully explain why the delay of 50ms was occurring, but it only happened when using the APP timer. When I switched to using a h/w timer the maximum delay to service the ISR was &amp;lt;1ms.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Maximum expected interrupt delay when using Softdevice</title><link>https://devzone.nordicsemi.com/thread/116061?ContentTypeID=1</link><pubDate>Wed, 03 Jan 2018 16:01:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c95a2b73-a296-429c-b6c1-c1ca425c5a93</guid><dc:creator>pajo</dc:creator><description>&lt;p&gt;Thanks Martin. That&amp;#39;s what I thought, 50ms seems too long. We are using the BLE uart service for debug messages so it&amp;#39;s possible that we have quite a lot of traffic. That would also explain why the timing is so much more accurate in release mode. The only other option is that another ISR at priority 2 is pre-empting for an extended period, but from examining the code that seems unlikely. I&amp;#39;m looking into the GPIOTE option.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Maximum expected interrupt delay when using Softdevice</title><link>https://devzone.nordicsemi.com/thread/116060?ContentTypeID=1</link><pubDate>Wed, 03 Jan 2018 13:37:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4938e1c8-3931-4535-b6e8-6f6b71fb5aa0</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;Delays of 50ms is  definitely not to be expected. Here you can see what to expect: &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s130.sds/dita/softdevices/s130/processor_avail_interrupt_latency/ble_usage_patterns.html?cp=3_7_2_0_15_2_2"&gt;Processor usage patterns and availability&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Maybe you should look into using PPI together with GPIOTE and a Timer. It is possible to make a GPIO toggle completely autonomously without interfering with the CPU (or the Softdevice) at all. Dependent on your use case, you can probably also use two timers and/or two capture/compare registers to generate a periodic pulse train.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Maximum expected interrupt delay when using Softdevice</title><link>https://devzone.nordicsemi.com/thread/116059?ContentTypeID=1</link><pubDate>Wed, 03 Jan 2018 10:52:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:de173a6a-6587-4dbc-b0d3-2c890be7c411</guid><dc:creator>pajo</dc:creator><description>&lt;p&gt;Thanks Dave. I&amp;#39;ll give that a try. I also have noticed that it only occurs in debug mode. In release mode the timing is fine.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Maximum expected interrupt delay when using Softdevice</title><link>https://devzone.nordicsemi.com/thread/116062?ContentTypeID=1</link><pubDate>Tue, 02 Jan 2018 20:01:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:19ddc847-4381-47ab-863a-23fb6f786868</guid><dc:creator>Dave_couling</dc:creator><description>&lt;p&gt;That seems a bit too long of a block time for the Softdevice.  So something else might be going on.  However to answer your question, the most accurate way of doing this is through PPI and GPIOTE.  This eliminates the need for the CPU to execute code to toggle your GPIO pin.  Its the Peripherals which are configured to do this for you.  So Softdevice blocking the CPU doesn&amp;#39;t affect your timing.  Look into the GPIOTE examples for source code.  Its a little hard to wrap your head around. But once you do, its a very powerful tool.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>