<?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>Know when the softdevice / Interrupt took control</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/41522/know-when-the-softdevice-interrupt-took-control</link><description>Hi, 
 I&amp;#39;m developing a unit which i need from time to time to send a packet throw I/O lines (F.E.virtual uart) 
 However the packet bit timing is very critical. 
 As far as i understand, when using a softdevice, the softdevice can interrupt me whenever</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 12 Dec 2018 14:01:51 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/41522/know-when-the-softdevice-interrupt-took-control" /><item><title>RE: Know when the softdevice / Interrupt took control</title><link>https://devzone.nordicsemi.com/thread/161470?ContentTypeID=1</link><pubDate>Wed, 12 Dec 2018 14:01:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0eb345f4-9042-40f5-92a1-ace1d659955a</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;What I meant is that reading the timer value and setting a variable does not take many CPU instructions. Then you have the &lt;a href="https://community.arm.com/processors/b/blog/posts/beginner-guide-on-interrupt-latency-and-interrupt-latency-of-the-arm-cortex-m-processors"&gt;interrupt latency&lt;/a&gt; which adds a bit.&amp;nbsp;We are definitely talking about far less than 10&amp;nbsp;μs in this case.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Know when the softdevice / Interrupt took control</title><link>https://devzone.nordicsemi.com/thread/161466?ContentTypeID=1</link><pubDate>Wed, 12 Dec 2018 13:51:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9ebf55ce-2962-4eb1-bf2a-f60a08e28062</guid><dc:creator>yuval</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;No, There is no flow control. I can&amp;#39;t know when it transmit to me.&lt;/p&gt;
&lt;p&gt;About the 2nd question: what do you meen by &amp;quot;not take many instruction&amp;quot;?&lt;/p&gt;
&lt;p&gt;Is it up to 10us? 50us? 100us?&amp;nbsp; I don&amp;#39;t need very aqurate number from you but i need to know more or less how much time it will take...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Know when the softdevice / Interrupt took control</title><link>https://devzone.nordicsemi.com/thread/161457?ContentTypeID=1</link><pubDate>Wed, 12 Dec 2018 13:22:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:60d6da64-284f-4be1-a4ce-5648512a9e8c</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;&lt;span&gt;Hi&amp;nbsp;&lt;/span&gt;&lt;span&gt;Yuval,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Why do you absolutely need to handle the UART transaction immediately? Does the master device not support flow control?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I don&amp;#39;t have numbers for how long time your timer event would take, but it should not take many instructions per time.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Know when the softdevice / Interrupt took control</title><link>https://devzone.nordicsemi.com/thread/161433?ContentTypeID=1</link><pubDate>Wed, 12 Dec 2018 12:39:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cbcb47c5-5339-4595-abbb-620bbaf31fdf</guid><dc:creator>yuval</dc:creator><description>&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;But this not working for me since i&amp;#39;m the slave and not the master, so i don&amp;#39;t know when the other transmitter sends it&amp;#39;s data....(And i act according to the data)&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Another question,&lt;/p&gt;
&lt;p&gt;If i set a timer event for every 200 micro seconds, (f.e. Inside the event i have 1 line of code - advancing&amp;nbsp; a counter)&lt;/p&gt;
&lt;p&gt;How much time will be spent in going into the event, advancing the counter and return back to the regular program?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;B.r, Yuval.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Know when the softdevice / Interrupt took control</title><link>https://devzone.nordicsemi.com/thread/161415?ContentTypeID=1</link><pubDate>Wed, 12 Dec 2018 11:52:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:23e75b1a-b0c4-4236-b44f-457c83356a78</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;span&gt;Yuval,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Interrupts for the SoftDevice are not propagated to the application, except for in cases where the SoftDevice notifies the application about something in the form of an event by calling the registered event handler(s). Therefor the method of setting a flag in the application indicating that the SoftDevice has interrupted you will not work. However, that may not be needed as there are a few other options worth considering:&lt;/span&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span&gt;The application can use the &lt;a href="https://www.nordicsemi.com/DocLib/Content/SoftDevice_Spec/s132/latest/SDS/s1xx/multiprotocol_operation/multiprotocol_support"&gt;Timeslot API&lt;/a&gt; to obtain a timeslot where it is guaranteed to not be interrupted by the SoftDevice. This API is intended to be used for implementing a second concurrent radio protocol, but it can be used for any situation where the application needs full control for a limited duration of time with a guarantee that there will be no SoftDevice interrupts.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;The UART peripheral&amp;nbsp;support DMA, so a SoftDevice interrupt will not affect an ongoing transaction. The CPU is only needed to set up the transaction. If I understood your use case correctly, this will circumvent the whole problem.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span&gt;Br,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Einar&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>