<?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>Efficient SPIM with periodical slave</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/55056/efficient-spim-with-periodical-slave</link><description>Dear nRF52832 experts, 
 
 I have a SPI slave device which can periodically notify the MCU with data ready (DRDY) signal. For each DRDY signal, we should perform a SPI transaction to read a sample of less than 30 bytes into RAM buffer. The process will</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 04 Dec 2019 23:57:41 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/55056/efficient-spim-with-periodical-slave" /><item><title>RE: Efficient SPIM with periodical slave</title><link>https://devzone.nordicsemi.com/thread/223727?ContentTypeID=1</link><pubDate>Wed, 04 Dec 2019 23:57:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d00a7f17-6557-43be-bebb-297597c22596</guid><dc:creator>yf13</dc:creator><description>&lt;p&gt;Thank you a lot for the explanations. I will close this ticket.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Efficient SPIM with periodical slave</title><link>https://devzone.nordicsemi.com/thread/223689?ContentTypeID=1</link><pubDate>Wed, 04 Dec 2019 16:17:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2a83d6e9-e5be-49c2-9754-10dd05a45ada</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Yes, any peripheral driver apart from the ones mentioned under &amp;quot;migration not possible&amp;quot; in the &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v16.0.0/nrfx_migration_user_guide.html?cp=6_1_2_6_1_0#getting_started_replace_nrf_drv_scenarios"&gt;nrfx migration guide&lt;/a&gt; can be migrated to nrfx drivers. It is possible to mix legacy and nrfx drivers for separate peripherals.&lt;/p&gt;
&lt;p&gt;As far as I know, the value in the PTR register will be incremented during transfers, and this will not be reset to its original value by itself. If you were to start the transfer again, it would start in the last buffer of the array list and increment from this point. You will have to reset the buffer pointer in SW before starting a new transfer.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Efficient SPIM with periodical slave</title><link>https://devzone.nordicsemi.com/thread/223452?ContentTypeID=1</link><pubDate>Wed, 04 Dec 2019 00:53:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d34292d1-bae0-453b-9465-a10bb5b55c04</guid><dc:creator>yf13</dc:creator><description>&lt;p&gt;So in my case, I want use s112 with above mentioned SPIM (with GPIOTE/TIMER via PPI), plus console port logging during development phase, can I still take the &amp;quot;nrfx&amp;quot; API approach?&lt;/p&gt;
&lt;p&gt;Yet another question:&amp;nbsp; given the SPIM has been set to use array list to read samples, once the last&amp;nbsp;sample buffer was&amp;nbsp;filled by SPIM, upon the next SPIM START task, will it restart from the first sample buffer? If yes, this means that we don&amp;#39;t have to change SPIM settings in the counter event handler.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;yf13&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Efficient SPIM with periodical slave</title><link>https://devzone.nordicsemi.com/thread/223368?ContentTypeID=1</link><pubDate>Tue, 03 Dec 2019 14:12:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:09fe8912-3771-4d41-ac56-e317b2a168b0</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;For SPI master it should not make much difference if you use the legacy driver API or the new nrfx API. There is no performance difference, but using nrfx may simplify debugging a bit since you do not need to go through the legacy layer. Both alternatives use the nrfx driver in the lower levels.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Efficient SPIM with periodical slave</title><link>https://devzone.nordicsemi.com/thread/223288?ContentTypeID=1</link><pubDate>Tue, 03 Dec 2019 11:06:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c152e3b4-6db3-4d0c-99c1-0c735057892c</guid><dc:creator>yf13</dc:creator><description>&lt;p&gt;Thanks for the information. I will need time to try it out.&lt;/p&gt;
&lt;p&gt;Can I ask whether I should follow the examples and legacy flavor APIs or I should start using the new &amp;quot;nrfx&amp;quot;&amp;nbsp;APIs directly?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;yf13&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Efficient SPIM with periodical slave</title><link>https://devzone.nordicsemi.com/thread/223069?ContentTypeID=1</link><pubDate>Mon, 02 Dec 2019 13:37:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:17fd4cee-ad73-4334-9faa-656a19726a99</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The SPIM peripheral will by default transfer data to/from RAM and give you &lt;a href="https://infocenter.nordicsemi.com/topic/ps_nrf52840/spim.html?cp=4_0_0_5_24_5_6#register.EVENTS_END"&gt;an event&lt;/a&gt; once the entire transfer is completed. It is possible to enable events&amp;nbsp;at end of TX and RX operations alone as well, but these are not used by the SPI master driver. Performing multiple consecutive transfers without CPU intervention requires use of &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/spim.html?cp=4_2_0_30_1_0#topic"&gt;EasyDMA ArrayList feature&lt;/a&gt;. Support for this is &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v16.0.0/hardware_driver_spi_master.html?cp=6_1_2_0_13_2#hardware_driver_spi_advanced"&gt;implemented in the SPI master driver for SPIM peripheral&lt;/a&gt; by using the flags&amp;nbsp;described on the linked page. This page also includes a code sample for exactly what you are requesting.&lt;/p&gt;
&lt;p&gt;If you want to get an interrupt only after a certain number of samples, the END event needs to be connected to a TIMER in&amp;nbsp;COUNT mode.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Jørgen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>