<?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>Updating SPI transfer with PPI</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/47385/updating-spi-transfer-with-ppi</link><description>Hello, I have a question about using PPI with a SPI transfer. 
 I’m using a NRF52832 custom board with the Softdevice. I’m reading sensor data every 20ms via TWI and sampling SAADC via a PPI Channel. This data is send to an Android with NUS- nordic uart</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 21 May 2019 09:13:00 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/47385/updating-spi-transfer-with-ppi" /><item><title>RE: Updating SPI transfer with PPI</title><link>https://devzone.nordicsemi.com/thread/188165?ContentTypeID=1</link><pubDate>Tue, 21 May 2019 09:13:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:96f4b4d1-b3d2-47b6-a8b9-994a6d972d07</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I am not sure this will solve the issue you have.&amp;nbsp;Is the time when you need to toggle between values constant, or does it depend on something else? If it is constant then it should be OK to use fixed length transfers and start the next transfer after the previous has finished via PPI (for instance by a timer like you do). However, the array list is not circular, so you will have to start again via SW when you have iterated through your array list.&lt;/p&gt;
&lt;p&gt;There is no example in the SDK that demonstrates &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/spim.html?cp=3_1_0_30_1_0#topic"&gt;EasyDMA array list&lt;/a&gt;, but the driver documentation covers this under &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/hardware_driver_spi_master.html?cp=5_1_2_0_13_2_1#hardware_driver_spi_repeated"&gt;Repeated transfers&lt;/a&gt;. Essentially you set up an array of transfers, and when you start a new transfer, this increases the array index list so that the next data array is used.&lt;/p&gt;
&lt;p&gt;I have not tested your code, but it looks like you have the main parts you need. However, I notice the following&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;You use&amp;nbsp;NRF_DRV_SPI_FLAG_RX_POSTINC, but it should be&amp;nbsp;NRF_DRV_SPI_FLAG_TX_POSTINC, which is probably what you want?&lt;/li&gt;
&lt;li&gt;Do you care about RX data? If you can use&amp;nbsp;NRF_DRV_SPI_XFER_TX, or just set the third parameter in&amp;nbsp;NRF_DRV_SPI_XFER_TRX to null.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If you go this route and have problems after testing it, can you provide updated code and a description of the problems you are seeing?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>