<?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>Latency of 2us when set up the SPIM transmit and receive buffer</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/43143/latency-of-2us-when-set-up-the-spim-transmit-and-receive-buffer</link><description>Hi Nordic, 
 Currently I am using the nRF5_SDK_15.2.0_9412b96 to develop SPI interface with a sensor using SPIM for nRF52832. 
 Within the spim_xfer(NRF_SPIM_Type * p_spim, spim_control_block_t * p_cb, nrfx_spim_xfer_desc_t const * p_xfer_desc, uint32_t</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 30 Jan 2019 13:47:33 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/43143/latency-of-2us-when-set-up-the-spim-transmit-and-receive-buffer" /><item><title>RE: Latency of 2us when set up the SPIM transmit and receive buffer</title><link>https://devzone.nordicsemi.com/thread/168720?ContentTypeID=1</link><pubDate>Wed, 30 Jan 2019 13:47:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:372c8824-0cbf-4ee3-93af-70a4310944aa</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;So I assume you have measured that&amp;nbsp;&lt;span&gt;spim_xfer() takes 2us to execute here, and that there is no delay due to wakeup from sleep that take is part of the 2us.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;To speed up transfer you&amp;nbsp;can call&amp;nbsp;spim_xfer() with&amp;nbsp;NRFX_SPIM_FLAG_HOLD_XFER flag to setup the SPI transfer before SS pin. You can get the task to start the transfer by calling&amp;nbsp;nrfx_spim_start_task_get():&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.nordicsemi.com/DocLib/Content/SDK_Doc/nRF5_SDK/v15-2-0/group__nrfx__spim#gadb5b212e351bd65958c6be78a957ac65"&gt;https://www.nordicsemi.com/DocLib/Content/SDK_Doc/nRF5_SDK/v15-2-0/group__nrfx__spim#gadb5b212e351bd65958c6be78a957ac65&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Then&amp;nbsp;you only need to call the start task to trigger the SPIM transfer (for instance through PPI or from application).&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;br /&gt;Kenneth&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>