<?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>SPIS ORC register not being used</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/3435/spis-orc-register-not-being-used</link><description>I have managed to get the SPIS block working using standard sets of read and transmit buffers. This all works. 
 I am now trying to use the ORC register to send a single byte to be transmitted rather than supplying a separate buffer, because in the main</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 11 Sep 2014 11:45:55 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/3435/spis-orc-register-not-being-used" /><item><title>RE: SPIS ORC register not being used</title><link>https://devzone.nordicsemi.com/thread/12448?ContentTypeID=1</link><pubDate>Thu, 11 Sep 2014 11:45:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d8720783-c08d-4898-b3cf-06bda560bd34</guid><dc:creator>Stefan Birnir Sverrisson</dc:creator><description>&lt;p&gt;The bug has been confirmed. It will be reported in future versions of the nRF51822/nRF51422 PAN (product anomaly notification) documents. Workaround is as previously stated.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPIS ORC register not being used</title><link>https://devzone.nordicsemi.com/thread/12447?ContentTypeID=1</link><pubDate>Mon, 08 Sep 2014 10:01:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:95d91968-fb21-4efc-9536-ecc75437aced</guid><dc:creator>Peter Myerscough-Jackopson</dc:creator><description>&lt;p&gt;please can you alter this or comment if after chatting with the SPIS people this needs updating.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPIS ORC register not being used</title><link>https://devzone.nordicsemi.com/thread/12445?ContentTypeID=1</link><pubDate>Thu, 14 Aug 2014 16:02:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e32d2b4f-1c05-44a6-b968-c3442631d8b3</guid><dc:creator>Peter Myerscough-Jackopson</dc:creator><description>&lt;p&gt;Thank you for looking at this. I will convert your previous comment to an answer, and select it once you confirm with the SPIS people when they get back in...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPIS ORC register not being used</title><link>https://devzone.nordicsemi.com/thread/12446?ContentTypeID=1</link><pubDate>Thu, 14 Aug 2014 10:38:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f5335e38-df37-4c90-bb7e-079b7c8c4363</guid><dc:creator>Stefan Birnir Sverrisson</dc:creator><description>&lt;p&gt;I actually tried to set MAXTX = 1 and MAXTX = 3 and that worked, but after trying MAXTX = 0, I get the same results as you, there is nothing sent out on MISO. According to the reference manual, ORC should be clocked out on MISO if transmitted bytes exceed the value of MAXTX, including when MAXTX = 0. The most knowledgeable people on SPIS are not in office today, I will discuss the issue with them when they are available. Meanwhile I report this as a bug. If the slave has no data to send, I guess the workaround could be to set MAXTX = 1 and write the ORC value manually to  the TX buffer.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPIS ORC register not being used</title><link>https://devzone.nordicsemi.com/thread/12444?ContentTypeID=1</link><pubDate>Wed, 13 Aug 2014 14:03:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d81e68eb-b705-4d7e-a8ae-ba5ec4a354ad</guid><dc:creator>Peter Myerscough-Jackopson</dc:creator><description>&lt;p&gt;Hi Stefan,
&lt;br /&gt;&lt;br /&gt;
I have tried the following line:
&lt;br /&gt;&lt;br /&gt;
spi_slave_buffers_set(m_tx_buf, m_rx_buf, 0, sizeof(m_rx_buf));
&lt;br /&gt;&lt;br /&gt;
This transmits the first byte of the m_tx_buf, followed by all 0s. (I am using a logic analyzer to see the lines.)
&lt;br /&gt;&lt;br /&gt;
Alternatively, after removing the NULL pointer detection, in spi_slave_buffers_set(...), I tried this code:
&lt;br /&gt;&lt;br /&gt;
spi_slave_buffers_set(NULL, m_rx_buf, 0, sizeof(m_rx_buf));
&lt;br /&gt;&lt;br /&gt;
This transmits all 0s, and not the ORC byte. I have also tried setting all four bytes of the ORC register to see if the higher bytes are actually being used.
&lt;br /&gt;&lt;br /&gt;
N.B. If I transmit one byte, i.e. spi_slave_buffers_set(m_tx_buf, m_rx_buf, 1, sizeof(m_rx_buf)) the ORC byte is transmitted.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPIS ORC register not being used</title><link>https://devzone.nordicsemi.com/thread/12443?ContentTypeID=1</link><pubDate>Wed, 13 Aug 2014 09:36:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e2bcbc63-5c7c-4959-a671-b50b6ff41a1f</guid><dc:creator>Stefan Birnir Sverrisson</dc:creator><description>&lt;p&gt;Hi Peter&lt;/p&gt;
&lt;p&gt;Are you setting your NRF_SPIS1-&amp;gt;MAXTX = 0 in the spi_slave_init function? If so, that does not work because the MAXTX configuration is overwritten when you call spi_slave_buffers_set. To adjust the MAXTX, modify the third parameter when you call spi_slave_buffers_set function. The spi_slave_buffers_set function is called for the first SPI transaction in spi_slave_example_init but for all subsequent SPI transaction in the SPIS handler, i.e. spi_slave_event_handle. So to set MAXTX as e.g. 3, set&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;err_code = spi_slave_buffers_set(m_tx_buf, m_rx_buf, 3, sizeof(m_rx_buf));
APP_ERROR_CHECK(err_code);
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>