<?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>How to run low-latency tasks?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/53164/how-to-run-low-latency-tasks</link><description>I need to use a nRF52 chip to handle interrupts with low (and known) latency. Basically, there are specific ~100 us long intervals during which I need interrupt latency to be in the 1 us range. These intervals happen on an irregular (but known in advance</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 16 Oct 2019 09:00:40 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/53164/how-to-run-low-latency-tasks" /><item><title>RE: How to run low-latency tasks?</title><link>https://devzone.nordicsemi.com/thread/215230?ContentTypeID=1</link><pubDate>Wed, 16 Oct 2019 09:00:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9a22ad77-a507-47ab-bc76-8d757c5ba190</guid><dc:creator>Dmitry</dc:creator><description>[quote userid="7377" url="~/f/nordic-q-a/53164/how-to-run-low-latency-tasks/215219"]Yes, if you are granted a timeslot by the SoftDevice, you are also guaranteed that there will not be any SoftDevice interrupt for that duration.[/quote]
&lt;p&gt;I can confirm this. My below message regarding slot scheduler - there&amp;#39;s no guarantee that we will obtain a slot at required time, moreover, already sheduled slot may be canceled afterwards. The only solution I found is to set high local latency (BLE_GAP_OPT_LOCAL_CONN_LATENCY) for the time when I&amp;#39;m working with time-critical peripheral, then switch it back to 0.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to run low-latency tasks?</title><link>https://devzone.nordicsemi.com/thread/215219?ContentTypeID=1</link><pubDate>Wed, 16 Oct 2019 08:36:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:64d58b8a-2697-4988-bd9b-f37ca36c3789</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi Alex,&lt;/p&gt;
&lt;p&gt;Yes, if you are granted a timeslot by the SoftDevice, you are also guaranteed that there will not be any SoftDevice interrupt for that duration. Other interrupts that you manage yourself could, of course, happen if you have them enabled, but that is all up to the application to handle.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to run low-latency tasks?</title><link>https://devzone.nordicsemi.com/thread/215191?ContentTypeID=1</link><pubDate>Wed, 16 Oct 2019 04:03:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e28d9c23-c0ae-4704-b144-89de31f6d9c1</guid><dc:creator>Alex</dc:creator><description>&lt;p&gt;Hello Einar - Thanks, I&amp;#39;ll try that. &lt;/p&gt;
&lt;p&gt;Could you please confirm that the timeslot API **guarantees** no interruptions?&lt;/p&gt;
&lt;p&gt;Per Dimitry&amp;#39;s reply below that seems to not be the case.&lt;/p&gt;
&lt;p&gt;Best,&lt;/p&gt;
&lt;p&gt;Alex&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to run low-latency tasks?</title><link>https://devzone.nordicsemi.com/thread/214837?ContentTypeID=1</link><pubDate>Mon, 14 Oct 2019 12:41:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cbaaff9d-22fe-4781-aac4-05eaa59b1cee</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Radio notification only informs you when the radio is in use (such as when there is a BLE connectinon event). You should probably use the timeslot API instead if you need some time where the application is guaranteed to not be interrupted.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to run low-latency tasks?</title><link>https://devzone.nordicsemi.com/thread/214686?ContentTypeID=1</link><pubDate>Sun, 13 Oct 2019 04:46:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6be04f22-1256-427a-9cba-54745f7212d1</guid><dc:creator>Alex</dc:creator><description>&lt;p&gt;Thank you, this looks quite interesting.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Does the radio notification happen before &lt;strong&gt;radio &lt;/strong&gt;usage, or before any non-interruptible CPU usage by the softdevice?&amp;nbsp; (is there even a difference between these two - ie does the softdevice ever reserve the CPU in a way that does not call this event handler?)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to run low-latency tasks?</title><link>https://devzone.nordicsemi.com/thread/214673?ContentTypeID=1</link><pubDate>Sat, 12 Oct 2019 16:39:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6ba3dcb5-e19d-4804-b8ff-5becad53f017</guid><dc:creator>Dmitry</dc:creator><description>[quote userid="10008" url="~/f/nordic-q-a/53164/how-to-run-low-latency-tasks"]Is it possible to briefly reserve the CPU for user code during an active connection?&amp;nbsp;[/quote]
&lt;p&gt;Good question. There&amp;#39;s a timeslot API for such things, but it&amp;#39;s &amp;quot;high&amp;quot; priority is in fact &amp;quot;a bit higher than normal&amp;quot;. It would be nice to have a &amp;quot;guaranteed&amp;quot; priority level - to be sure that slot is sheduled in any case (sometimes lost BLE connection is not so catastrophic as unhandled hardware event).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to run low-latency tasks?</title><link>https://devzone.nordicsemi.com/thread/214669?ContentTypeID=1</link><pubDate>Sat, 12 Oct 2019 12:46:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:263f4523-73ed-4f81-a68d-94780fa66d01</guid><dc:creator>Turbo J</dc:creator><description>[quote userid="10008" url="~/f/nordic-q-a/53164/how-to-run-low-latency-tasks"] to reset timers and/or flip a couple of GPIO pins[/quote]
&lt;p&gt;Sounds like it could be done in hardware via PPI channels (see GPIOTE, PPI and Timer Tasks/Events) - without using CPU interrupts.&lt;/p&gt;
&lt;p&gt;There is a radio notification event handler library. This would call an application event handler X ms (see NRF_RADIO_NOTIFICATION_DISTANCES) before the actual radio usage.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>