<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://test-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>Incrementing the TX buffer in PPI-driven SPI</title><link>https://test-devzone.nordicsemi.com/f/nordic-q-a/88162/incrementing-the-tx-buffer-in-ppi-driven-spi</link><description>I transfer data by ESB between send and receive. And I want to transfer 2 bytes x 10 data that is received by ESB every T[s] to ESB receive (trigger) -&amp;gt; PPI-&amp;gt;SPIM, 2 bytes every T/10[s]. We have already confirmed that the hardware can correctly drive</description><dc:language>en-US</dc:language><generator>Telligent Community 13 Non-Production</generator><lastBuildDate>Mon, 30 May 2022 11:08:03 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://test-devzone.nordicsemi.com/f/nordic-q-a/88162/incrementing-the-tx-buffer-in-ppi-driven-spi" /><item><title>RE: Incrementing the TX buffer in PPI-driven SPI</title><link>https://test-devzone.nordicsemi.com/thread/369952?ContentTypeID=1</link><pubDate>Mon, 30 May 2022 11:08:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5baf72dd-ce77-49e3-9cdf-f6b12ae0b715</guid><dc:creator>user113706</dc:creator><description>&lt;p&gt;Sorry for the late reply.&lt;/p&gt;
&lt;p&gt;I am currently on another task and will try the method you advised once that is complete.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Incrementing the TX buffer in PPI-driven SPI</title><link>https://test-devzone.nordicsemi.com/thread/369193?ContentTypeID=1</link><pubDate>Tue, 24 May 2022 07:55:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1450e6a2-29f0-4484-bd5c-a97f0b8364e4</guid><dc:creator>user2111</dc:creator><description>&lt;p&gt;So you need to for intance set SPIM.TXD_MAXCNT and SPIM.TXD_PTR like any SPIM transfer, however if you also enable SPIM.TXD_LIST, then for each &amp;#39;n&amp;#39; SPIM transfer that you call SPIM.TASKS_START then the TXD_PTR will point to the memory address &lt;span&gt;TXD_PTR&lt;/span&gt;+MACNT*&amp;#39;n&amp;#39;.&lt;/p&gt;
&lt;p&gt;So that is why you need to define for instance:&lt;/p&gt;
&lt;p&gt;#define BUFFER_SIZE 2&lt;br /&gt; &lt;br /&gt; typedef struct ArrayList&lt;br /&gt; {&lt;br /&gt; uint8_t buffer[BUFFER_SIZE];&lt;br /&gt; } ArrayList_type;&lt;br /&gt; &lt;br /&gt; ArrayList_type TXDList[10] ;&lt;/p&gt;
&lt;p&gt;NRF_SPIM-&amp;gt;TXD.MAXCNT = BUFFER_SIZE;&lt;br /&gt;NRF_SPIM-&amp;gt;TXD.PTR = &amp;amp;&lt;span&gt;TXDList&lt;/span&gt;;&lt;br /&gt;NRF_SPIM-&amp;gt;TXD.LIST = 1;&lt;/p&gt;
&lt;p&gt;You may also need to do the same for RXD buffer if you want it to increment the same way.&lt;/p&gt;
&lt;p&gt;If you want to start from the beginning of the ArraList again then you need to write one time to&amp;nbsp;&lt;span&gt;NRF_SPIM&lt;/span&gt;&lt;span&gt;-&amp;gt;&lt;/span&gt;&lt;span&gt;TXD&lt;/span&gt;&lt;span&gt;.PTR before calling start task again.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Incrementing the TX buffer in PPI-driven SPI</title><link>https://test-devzone.nordicsemi.com/thread/369147?ContentTypeID=1</link><pubDate>Tue, 24 May 2022 04:34:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f748629c-5b89-4a66-9a10-fe7ade4de6ec</guid><dc:creator>user113706</dc:creator><description>&lt;p&gt;Reply, thanks.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/ps_nrf52840/easydma.html#arraylist"&gt;https://infocenter.nordicsemi.com/topic/ps_nrf52840/easydma.html#arraylist&lt;/a&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;in the EasyDMA array list for examples and Figure 3.&lt;br /&gt;So the questions are.&lt;/p&gt;
&lt;p&gt;(1) &amp;rsquo;Then each start task will increment the buffer pointer:&amp;rsquo;&lt;br /&gt;What is a pointer in this case? Does the pointer here mean READER.PTR = &amp;amp;ReaderList = 0x20000000?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;(2) Read order&lt;br /&gt;In this example, does this mean that the address to be read is incremented as follows?&lt;br /&gt;RaderList[0]-buffer[0]---&amp;gt;RaderList[0]-buffer[1]---&amp;gt;RaderList[0]-buffer[2]---&amp;gt;RaderList[0]-buffer[3]---&amp;gt;RaderList[1]-buffer[0]---&amp;gt;RaderList[1]-buffer[1]---&amp;gt;---&amp;gt;---&amp;gt;---&amp;gt;---&amp;gt;---&amp;gt;---&amp;gt;---&amp;gt;---&amp;gt;---&amp;gt;---&amp;gt;-----&amp;gt;---&amp;gt;---&amp;gt;---&amp;gt;---&amp;gt;---&amp;gt;---&amp;gt;---&amp;gt;---&amp;gt;---&amp;gt;RaderList[2]-buffer[2]---&amp;gt;RaderList[2]-buffer[3].&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;(3) &amp;#39;Then you need to update the buffer array and set the pointer to the start of the buffer array again.&amp;#39;&lt;br /&gt;The following is a list of the Specifically.&lt;br /&gt;--RaderList[0]-buffer[0] to RaderList[2]-buffer[3] then you need to update the contents of the buffer array.&lt;br /&gt;--READER.PTR = &amp;amp;ReaderList = 0x20000000, revert.&lt;br /&gt;Does this mean?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Incrementing the TX buffer in PPI-driven SPI</title><link>https://test-devzone.nordicsemi.com/thread/369068?ContentTypeID=1</link><pubDate>Mon, 23 May 2022 13:49:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:11ceb48b-1a84-49ac-89ad-86f895dd612f</guid><dc:creator>user2111</dc:creator><description>&lt;p&gt;Sounds to me that you need to look at array list, then each start task will increment the buffer pointer:&lt;br /&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/ps_nrf52840/easydma.html#arraylist"&gt;https://infocenter.nordicsemi.com/topic/ps_nrf52840/easydma.html#arraylist&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Then after executing the start task let&amp;#39;s say 10 times, then you need to update the buffer array and set the pointer to the start of the buffer array again.&lt;/p&gt;
&lt;p&gt;Alternatively you need to look into giving the spi interrupt priority 0, but that may affect the real-time handling of the ESB protocol in a negative way (e.g. affect ack).&lt;/p&gt;
&lt;p&gt;In either case the CPU will need to do some CPU processing before/after e.g. 10 transfers.&lt;/p&gt;
&lt;p&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>