<?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>Interrupts, Timers &amp;amp; SoftDevices</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/41139/interrupts-timers-softdevices</link><description>Hi there, 
 I&amp;#39;m looking at porting (i.e. re-implementing) an Arduino project to the nRF52832 to take advantage of the s212 or S332 softdevices. This chip is a few orders of complexity higher than Arduino, so I expect I&amp;#39;ve got a steep learning curve ahead</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 03 Jan 2019 07:38:00 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/41139/interrupts-timers-softdevices" /><item><title>RE: Interrupts, Timers &amp; SoftDevices</title><link>https://devzone.nordicsemi.com/thread/163653?ContentTypeID=1</link><pubDate>Thu, 03 Jan 2019 07:38:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:38e5f71b-f76c-4400-95e1-a6f4636b8136</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi Ron,&lt;/p&gt;
&lt;p&gt;The&amp;nbsp;nrf_delay_us() is a software busy wait implementation, so it will essentially consume CPU cycles for the specified amount of time. This means that it will block any same or lower priority interrupts and keep the CPU active, wasting current. So in sum it is primarily only suitable for testing/debugging or waiting for very short durations of time. It has no use in a PPI context. Using an &lt;a href="https://www.nordicsemi.com/DocLib/Content/SDK_Doc/nRF5_SDK/v15-2-0/lib_timer"&gt;app_timer&lt;/a&gt;&amp;nbsp;is probably the best way to wait in SW before triggering some task. It uses the RTC peripheral under the hood which is very power efficient, but has a very simple a flexible API that lets you create an arbitrary number of timers (single shot or repeated). The app_timer is used extensively throughout the SDK.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Interrupts, Timers &amp; SoftDevices</title><link>https://devzone.nordicsemi.com/thread/163531?ContentTypeID=1</link><pubDate>Wed, 02 Jan 2019 16:54:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5e322370-e3cb-4140-b77b-2226d9ba5f3b</guid><dc:creator>Ron</dc:creator><description>&lt;p&gt;Thanks Einar. I&amp;#39;ll take another run at the spec and see if I can figure it out fiddling with the samples. For my second use case, I&amp;#39;ve seen references to nrf_delay_us(), but the only reference in the SDK is as part of the deprecated TWI driver. Is this an available function? Is there an API doc I&amp;#39;m missing which describes this function? Would it be impacted by the operation of the SoftDevice?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Interrupts, Timers &amp; SoftDevices</title><link>https://devzone.nordicsemi.com/thread/163453?ContentTypeID=1</link><pubDate>Wed, 02 Jan 2019 13:43:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4448e25b-0771-4014-afc4-64c0d21146dd</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Conceptually, you can compare PPI with the programmable interconnect you have in FPGAs (there is no programmable logic, though). The event end point (EEP)&amp;nbsp;produces a pulse whenever there is an event. This can then be connected to a PPI channel, which in turn can be connected to a task end point (TEP). When there is a pulse on the task endpoint this triggers the corresponding task. Once configured this happens in HW, without using the CPU at all.&lt;/p&gt;
&lt;p&gt;The SDK itself provides drivers for configuring PPI and the peripherals, but the product specification is the proper place to look for details about PPI, as it is a hardware concept. The following parts of the product specification are useful for understanding PPI:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/peripheral_interface.html?cp=2_1_0_14#concept_twz_bpz_vr"&gt;Peripheral interface&lt;/a&gt; (particularly the figure in the top of the page)&lt;/li&gt;
&lt;li&gt;&lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/ppi.html?cp=2_1_0_21#concept_sxf_21l_1s"&gt;PPI — Programmable peripheral interconnect&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;The specific endpoints are documented in the product specification chapters for the peripherals you want to connect. In your case it seems you need &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/gpiote.html?cp=2_1_0_20#concept_knz_kww_lr"&gt;GPIOTE&lt;/a&gt; and &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/timer.html?cp=2_1_0_23#concept_xbd_hqp_sr"&gt;TIMER&lt;/a&gt; (or &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/rtc.html?cp=2_1_0_24#concept_rvn_vkj_sr"&gt;RTC&lt;/a&gt; if you want lower current consumption at the cost of lower accuracy).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I also want to clarify a few things. The end points are nothing like function pointers. They are essentially IDs referring to a physical connection point in the peripheral HW that can be connected together using the programmable interconnect (PPI). Moreover, events are not the same as interrupts. However, interrupts can generate interrupts if interrupts are enabled for that event. The event on the other hand is always generated as long as the condition is met (see the &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/peripheral_interface.html?cp=2_1_0_14#concept_twz_bpz_vr"&gt;peripheral interface&lt;/a&gt;&amp;nbsp;figure).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Interrupts, Timers &amp; SoftDevices</title><link>https://devzone.nordicsemi.com/thread/163343?ContentTypeID=1</link><pubDate>Wed, 02 Jan 2019 03:53:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:812fd684-0d00-4d78-a91a-a296ba2dd0fc</guid><dc:creator>Ron</dc:creator><description>&lt;p&gt;Hi. Coming back to this problem after some success with the ANT+ PC SDK building the ANT+ emitter for my project. Turning now to the DevKit and building the receiver. I have to say I&amp;#39;m struggling to get a handle on PPI and GPIOTE with the materials I&amp;#39;ve been able to find. The NRF SDK documentation is, shall we say, &amp;#39;terse&amp;#39;. The only other pertinent reference I&amp;#39;ve been able to find is&amp;nbsp;nRF52832 Product Specification, which, obviously is quite detailed, but I think I&amp;#39;m missing some basic fundamentals. I don&amp;#39;t think it&amp;#39;s fair to ask y&amp;#39;all to try and help me climb this learning curve in this forum.&lt;/p&gt;
&lt;p&gt;I was hoping there might be some other reference material I could be pointed to - especially fundamentals of PPI?&lt;/p&gt;
&lt;p&gt;Failing that, my struggle of the moment is to understand the meaning/ usage of PPI EEPs, TEPs, channels and channel groups. I think it would make sense to me if EEP/TEPs were function pointers, but the SDK defines them as uint32, so that&amp;#39;s not holding water. If I&amp;#39;m not firing interrupts and executing ISRs, how do I prescribe the behaviour to occur at timer end?&lt;/p&gt;
&lt;p&gt;Things I need to do:&lt;/p&gt;
&lt;p&gt;1. pull an IO pin HIGH after a calculated number of {100..5000} us and leave it HIGH for 40 us (i.e. deliver a 40 us pulse at the prescribed time)&lt;/p&gt;
&lt;p&gt;2. Programmatic delays of {1..50000} microseconds as part of interfacing to an 16x2 LCD. I haven&amp;#39;t found anything ready made so I&amp;#39;m looking to port the Arduino Liquidcrystal lib.&lt;/p&gt;
&lt;p&gt;Lost :-(&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Interrupts, Timers &amp; SoftDevices</title><link>https://devzone.nordicsemi.com/thread/159963?ContentTypeID=1</link><pubDate>Mon, 03 Dec 2018 13:06:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:13412497-b1a9-480f-b4a2-a9f3700f5a99</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;It seems like you can do all the time critical tasks with PPI. You can use the timer and most other peripherals with PPI and/or interrupts. In this case, there does not seem to be any need to generate interrupts at all, so it should not be a problem. You can see the principle demonstrated by the &lt;a href="https://www.nordicsemi.com/en/DocLib/Content/SDK_Doc/nRF5_SDK/v15-2-0/ppi_example"&gt;PPI Example.&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The SoftDevice will not cause any problem when no real time CPU involvement is needed.&amp;nbsp;&lt;em&gt;&lt;/em&gt;Regardless, you can see the maximum time the SoftDevice will block application interrupts in various roles &lt;a href="https://www.nordicsemi.com/DocLib/Content/SoftDevice_Spec/s132/latest/SDS/s1xx/processor_avail_interrupt_latency/ble_usage_patterns"&gt;here&lt;/a&gt; (in case it is useful in other scenarios).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>