<?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>SPIM task START synchronization</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/127527/spim-task-start-synchronization</link><description>Hi, 
 I have a question about SPIM. Is it possible to have two events via DPPI that will start different SPIM transfers for the same SPIM channel? 
 What would happen if a task start happened for one transfer before the other one finished the transfer</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 25 Mar 2026 09:55:42 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/127527/spim-task-start-synchronization" /><item><title>RE: SPIM task START synchronization</title><link>https://devzone.nordicsemi.com/thread/564012?ContentTypeID=1</link><pubDate>Wed, 25 Mar 2026 09:55:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8a171c64-7517-4cac-9cbe-0855c92ab6d3</guid><dc:creator>Emil Lenngren</dc:creator><description>&lt;p&gt;If the idea is to have two prepared transfers (i.e. prepared outgoing data) and be able to, through DPPI, trigger any one of these, then this is not possible. The SPIM peripheral only has a single START task, which will start the transfer with the data prepared according to the set data pointer.&lt;/p&gt;
&lt;p&gt;However, if you know that you will send the two transfers in sequence, then you can use &amp;quot;&lt;span&gt;EasyDMA list type&amp;quot;, which means that the SPIM peripheral will send different data the second time the START task is triggered. You could for example have it so that the GPIOTE event triggers the first SPIM transfer, and at the same time start a TIMER. When the TIMER triggers some time later, the second SPIM transfer will finish. Just make sure you don&amp;#39;t exceed the size of the array by triggering too many START tasks. You should set up an interrupt to handle the received data anyway I guess, so you probably need to wake up the CPU anyway.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;You can use the&amp;nbsp;SUBSCRIBE_CHG[n].DIS feature of DPPI to make the triggers &amp;quot;one-shot&amp;quot;. Then re-set everything from the CPU side when you have finished processing the data from the SPI slave.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPIM task START synchronization</title><link>https://devzone.nordicsemi.com/thread/563919?ContentTypeID=1</link><pubDate>Tue, 24 Mar 2026 06:36:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:80eda64f-55f3-47f8-aca5-3b37519378b8</guid><dc:creator>Kazi Afroza Sultana</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;&amp;#39;&amp;#39;&lt;span&gt;Is it possible to have two events via DPPI that will start different SPIM transfers for the same SPIM channel?&amp;#39;&amp;#39;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;This is possible. DPPI supports one to one and many to many and many to one connection. Many to one connection means multiple events can be published to the same channel, or different tasks can subscribe to different channels (&lt;a href="https://docs.nordicsemi.com/bundle/ps_nrf5340/page/dppi.html#ariaid-title1"&gt;https://docs.nordicsemi.com/bundle/ps_nrf5340/page/dppi.html#ariaid-title1&lt;/a&gt;&amp;nbsp;)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;#39;&amp;#39;My idea is to have GPIOTE pin that will trigger a SPIM reading of ADC and the other is TIMER to do a SPIM transfer to set ADC in standby mode all connected via DPPI, i&lt;span lang="en"&gt;s it possible to do that&amp;#39;&amp;#39;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span lang="en"&gt;In this case you would set up two different channels for two different events. For example, one channel can be triggered by GPIOTE event and another can be triggered by timer event- each subscribing to the SPIM START task.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span lang="en"&gt;&amp;#39;&amp;#39;What would happen if a task start happened for one transfer before the other one finished the transfer?&amp;#39;&amp;#39;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span lang="en"&gt;According to SPIM driver documentation,&amp;nbsp;if the driver is in a busy state (transfer ongoing), a new transfer request will return&amp;nbsp;&lt;code dir="ltr"&gt;-EBUSY&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span lang="en"&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1774333644293v1.png" alt=" " /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://docs.nordicsemi.com/bundle/ps_nrf5340/page/dppi.html#ariaid-title1"&gt;https://docs.nordicsemi.com/bundle/ps_nrf5340/page/dppi.html#ariaid-title1&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;However, I have not found an ready sample for your idea. There is no built-in hardware protection when a second task arrives in the mid of ongoing one. You should design your system so that the timer event only fired when GPIOTE-triggered transfer is completed.&lt;/p&gt;
&lt;p&gt;Thanks.&lt;/p&gt;
&lt;p&gt;BR&lt;/p&gt;
&lt;p&gt;Kazi&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>