<?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>Writing to Multiple SPI Devices in Parallel</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/80044/writing-to-multiple-spi-devices-in-parallel</link><description>Hi, 
 We have a requirement to connect a SPI device to each SPI interface present on nRF52840, and we want to write to those multiple devices in parallel. Is there any API available they could let us write to those SPI devices connected to different SPI</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 01 Oct 2021 10:02:43 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/80044/writing-to-multiple-spi-devices-in-parallel" /><item><title>RE: Writing to Multiple SPI Devices in Parallel</title><link>https://devzone.nordicsemi.com/thread/332099?ContentTypeID=1</link><pubDate>Fri, 01 Oct 2021 10:02:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:da1eaa15-ac2d-4030-a54d-7916d95b3494</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;The driver can&amp;#39;t write in parallel but the HAL can with the aid of the PPI and EGU.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;The idea is to intitialize the SPIM&amp;#39;s and their buffers, and then trigger the&amp;nbsp;&lt;a title="TASKS_START" href="https://infocenter.nordicsemi.com/topic/ps_nrf52840/spim.html?cp=4_0_0_5_24_5_0#register.TASKS_START"&gt;TASKS_START&lt;/a&gt;&amp;nbsp;in all SPIM&amp;#39;s at the same time via the PPI system.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;In order to trigger 2 tasks from one SW call you need to use the&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/ps_nrf52840/egu.html?cp=4_0_0_5_7"&gt;EGU — Event generator unit&lt;/a&gt;&amp;nbsp;to generate a PPI event, this PPI event&amp;nbsp;can then be &amp;#39;forked&amp;#39; to the two SPIM&amp;#39;s START tasks.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Writing to Multiple SPI Devices in Parallel</title><link>https://devzone.nordicsemi.com/thread/331300?ContentTypeID=1</link><pubDate>Mon, 27 Sep 2021 12:05:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:05235f74-2376-4019-8aad-5b539886ec6e</guid><dc:creator>Omer Farooq</dc:creator><description>&lt;p&gt;Hi Haakonsh,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; Can you please comment on the following, as the link you shared doesn&amp;#39;t explicitly states something w.r.t. my problem.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thanks. Let&amp;#39;s take an example. We suppose that I have two devices A and B. I want to connect A on SPI interface 1 and B to SPI interface 2. I want to write 0x01 to A and 0x02 to B in parallel. From your reply it seems that I can&amp;#39;t do it in parallel, rather what I can do is to call nrfx_spim_xfer device twice first with data buffer containing value 0x01 and then call it again with data buffer containing value 0x02. This means we can only do sequential write and parallel writes are not possible in this case?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Omer&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Writing to Multiple SPI Devices in Parallel</title><link>https://devzone.nordicsemi.com/thread/331296?ContentTypeID=1</link><pubDate>Mon, 27 Sep 2021 11:56:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:50a005c6-8394-4a5c-b20f-0b66b38c9b73</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;See&amp;nbsp;&lt;a title="SPIM" href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/group__nrf__spim.html?cp=8_1_6_8_0_32"&gt;SPIM&lt;/a&gt;&amp;nbsp;API docs and&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/ps_nrf52840/spim.html?cp=4_0_0_5_24"&gt;SPIM — Serial peripheral interface master with EasyDMA&lt;/a&gt;&amp;nbsp;technical specification.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Writing to Multiple SPI Devices in Parallel</title><link>https://devzone.nordicsemi.com/thread/331285?ContentTypeID=1</link><pubDate>Mon, 27 Sep 2021 11:14:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ce80a18b-a538-43ee-acbc-d548c5b1bc5d</guid><dc:creator>Omer Farooq</dc:creator><description>&lt;p&gt;Thanks. Let&amp;#39;s take an example. We suppose that I have two devices A and B. I want to connect A on SPI interface 1 and B to SPI interface 2. I want to write 0x01 to A and 0x02 to B in parallel. From your reply it seems that I can&amp;#39;t do it in parallel, rather what I can do is to call nrfx_spim_xfer device twice first with data buffer containing value 0x01 and then call it again with data buffer containing value 0x02. This means we can only do sequential write and parallel writes are not possible in this case?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Omer&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Writing to Multiple SPI Devices in Parallel</title><link>https://devzone.nordicsemi.com/thread/331279?ContentTypeID=1</link><pubDate>Mon, 27 Sep 2021 10:51:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:72c92d40-2286-45c1-b5c9-7cc39f04dca0</guid><dc:creator>Turbo J</dc:creator><description>&lt;p&gt;No but you can call this function multiple times and thus let it run in parallel. API is on the infocenter.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Writing to Multiple SPI Devices in Parallel</title><link>https://devzone.nordicsemi.com/thread/331273?ContentTypeID=1</link><pubDate>Mon, 27 Sep 2021 10:34:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e88b50eb-e157-4c06-9823-840d2988c99a</guid><dc:creator>Omer Farooq</dc:creator><description>&lt;p&gt;One more thing can nrfx_spim_xfer() in parallel write different data to different SPI instances? Please also point me to the API documentation.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Writing to Multiple SPI Devices in Parallel</title><link>https://devzone.nordicsemi.com/thread/331259?ContentTypeID=1</link><pubDate>Mon, 27 Sep 2021 10:10:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eaf75d82-8735-4e31-add7-4ee847625ff5</guid><dc:creator>Omer Farooq</dc:creator><description>&lt;p&gt;Can you please share the documentation of nrfx_spim APIs?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Writing to Multiple SPI Devices in Parallel</title><link>https://devzone.nordicsemi.com/thread/331258?ContentTypeID=1</link><pubDate>Mon, 27 Sep 2021 10:06:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d3a15792-c1e3-407f-a0c6-b82f49899f0d</guid><dc:creator>Turbo J</dc:creator><description>&lt;p&gt;One idea is to use nrfx_spim_xfer() in non-blocking mode.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>