<?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>Why does nRF51822 spi_master.c have timeout code?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/1515/why-does-nrf51822-spi_master-c-have-timeout-code</link><description>The provided module spi_master.c has timeout code and error returns from spi_master_tx_rx(...) 
 Given that there are no external control signals to the SPI block, only a data input, it should be impossible for this hardware to timeout. I checked the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 08 May 2014 16:39:57 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/1515/why-does-nrf51822-spi_master-c-have-timeout-code" /><item><title>RE: Why does nRF51822 spi_master.c have timeout code?</title><link>https://devzone.nordicsemi.com/thread/6741?ContentTypeID=1</link><pubDate>Thu, 08 May 2014 16:39:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c0429f85-3cf7-46d1-97a7-60dd45bf9137</guid><dc:creator>Paolo D</dc:creator><description>&lt;p&gt;There is a bug in this driver which causes problems when using it with two SPI modules simultaneously. The variable &amp;#39;SPI&amp;#39; which is global should instead be local to each function which uses it. Otherwise a function could set the variable and be interrupted by a function which tries to use the other SPI peripheral, overwriting the variable and causing the wrong peripheral to be used.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why does nRF51822 spi_master.c have timeout code?</title><link>https://devzone.nordicsemi.com/thread/6740?ContentTypeID=1</link><pubDate>Tue, 11 Feb 2014 16:39:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0e4bb02d-0279-48ac-9aef-5cd0a17321d7</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Philip&lt;/p&gt;
&lt;p&gt;The SPI driver in the SDK is quite old, and was written for a very early revision of the nRF51822 chip. Back then the SPI hardware was less reliable, and the time out mechanism was put in place in case of HW issues.&lt;/p&gt;
&lt;p&gt;You are correct that this is not really needed any more, as there are no known issues with the current SPI implementation.&lt;/p&gt;
&lt;p&gt;For an example of an SPI driver without any timeout code, please have a look at the attached example. It is quick enough to write and read data back to back at 2 MHz (though there are some microseconds of delay before and after a transaction).&lt;/p&gt;
&lt;p&gt;Best regards
Torbjørn&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/8015.SPI-master-example.zip"&gt;SPI master example.zip&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>