<?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>nRF52 sending an octet</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/10068/nrf52-sending-an-octet</link><description>Hello, 
 I have been trying to use the nRF52 preview DK board as a master device with another chip as its slave device. Now I know that to read or write the function used is spi_send_recv which is provided in the example code for spi master. The chip</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 20 Jan 2016 18:21:41 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/10068/nrf52-sending-an-octet" /><item><title>RE: nRF52 sending an octet</title><link>https://devzone.nordicsemi.com/thread/37337?ContentTypeID=1</link><pubDate>Wed, 20 Jan 2016 18:21:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:360ef50a-fe80-4049-94e3-13c188d6fa08</guid><dc:creator>Elaine</dc:creator><description>&lt;p&gt;Ok, I&amp;#39;ve attached my code in a different post: &lt;a href="https://devzone.nordicsemi.com/question/65248/problems-implementing-workaround-to-get-nrf52-to-send-an-octet-one-byte-through-spi/"&gt;devzone.nordicsemi.com/.../&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52 sending an octet</title><link>https://devzone.nordicsemi.com/thread/37336?ContentTypeID=1</link><pubDate>Wed, 20 Jan 2016 08:14:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:10cd449a-7765-44b0-a8bc-b604421e30b4</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Hi Elaine,
Sorry for late response, This workaround is not being applied in the SDK yet and there are no other examples to show this. I can help you to apply this to your code, attach the code where you have difficulty understanding this. You just need to use one unused GPIOTE and PPI channel to automatically trigger SPI-&amp;gt;TASKS_STOP when the clock toggles, which will result in one byte transfer as SPI cannot stop the transfer mid byte.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52 sending an octet</title><link>https://devzone.nordicsemi.com/thread/37335?ContentTypeID=1</link><pubDate>Fri, 15 Jan 2016 18:58:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a3fa244c-8e8f-4571-bd3c-0b084b2ba73a</guid><dc:creator>Elaine</dc:creator><description>&lt;p&gt;Hi Aryan, I&amp;#39;m trying to implement this workaround and am having some difficulties figuring out how to pass in the required parameters to run this piece of code. Is there an example code that I can refer to?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52 sending an octet</title><link>https://devzone.nordicsemi.com/thread/37334?ContentTypeID=1</link><pubDate>Wed, 16 Dec 2015 12:05:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dbe07aa7-4a04-4691-aade-a18ee4fa60ea</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;No it is not fixed yet, so for one byte transfers using DMA, you have to use this workaround.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52 sending an octet</title><link>https://devzone.nordicsemi.com/thread/37333?ContentTypeID=1</link><pubDate>Tue, 15 Dec 2015 19:35:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0c4b5cb2-e216-4314-b449-6e811ff4465e</guid><dc:creator>Abhi</dc:creator><description>&lt;p&gt;Thanks for letting me know about this, sorry for replying so late. I was wondering if this is still the only way around to send an octet?  Or has the issue with using the DMA been fixed?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52 sending an octet</title><link>https://devzone.nordicsemi.com/thread/37332?ContentTypeID=1</link><pubDate>Wed, 18 Nov 2015 08:33:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e36464e0-48d6-472a-b203-1f06413b78bf</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;There is a PAN for this with the workaround, you can see this &lt;a href="http://infocenter.nordicsemi.com/pdf/nRF52832_Errata_v1.1.pdf"&gt;here&lt;/a&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;[58] SPIM: SPIM clocks out an
additional byte when RXD.MAXCNT = 1&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;You can use the SPI module same as nRF51 (depreciated but still available at same register addresses) That SPI module can be use for one byte transfers. Else you need to use below workaround&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;/**
 * @brief Work-around for transmitting 1 byte with SPIM.
 *
 * @param spim: The SPIM instance that is in use.
 * @param ppi_channel: An unused PPI channel that will be used by the
 workaround.
 * @param gpiote_channel: An unused GPIOTE channel that will be used by
 the workaround.
 *
 * @warning Must not be used when transmitting multiple bytes.
 * @warning After this workaround is used, the user must reset the PPI
 channel and the GPIOTE channel before attempting to transmit multiple
 bytes.
 */
void setup_workaround_for_ftpan_58(NRF_SPIM_Type * spim, uint32_t
 ppi_channel, uint32_t gpiote_channel)
{
 // Create an event when SCK toggles.
 NRF_GPIOTE-&amp;gt;CONFIG[gpiote_channel] = (
 GPIOTE_CONFIG_MODE_Event &amp;lt;&amp;lt;
 GPIOTE_CONFIG_MODE_Pos
 ) | (
 spim-&amp;gt;PSEL.SCK &amp;lt;&amp;lt;
 GPIOTE_CONFIG_PSEL_Pos
 ) | (
 GPIOTE_CONFIG_POLARITY_Toggle &amp;lt;&amp;lt;
 GPIOTE_CONFIG_POLARITY_Pos
 );
 // Stop the spim instance when SCK toggles.
 NRF_PPI-&amp;gt;CH[ppi_channel].EEP = (uint32_t)&amp;amp;NRF_GPIOTE-
&amp;gt;EVENTS_IN[gpiote_channel];
 NRF_PPI-&amp;gt;CH[ppi_channel].TEP = (uint32_t)&amp;amp;spim-&amp;gt;TASKS_STOP;
 NRF_PPI-&amp;gt;CHENSET = 1U &amp;lt;&amp;lt; ppi_channel;
3 New and inherited anomalies
Page 12
 // The spim instance cannot be stopped mid-byte, so it will finish
 // transmitting the first byte and then stop. Effectively ensuring
 // that only 1 byte is transmitted.
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;What this workaround does is that it uses GPIOTE and PPI to trigger the SPI-&amp;gt;TASKS_STOP when the SPI_CLOCK toggles. And since the SPI transaction cannot be stopped mid byte, it will complete that one byte transfer.&lt;/p&gt;
&lt;p&gt;You have to remember to enable the GPIOTE and PPI channel used for this workaround just before one byte transfer and then disable them when you want to transfer multiple bytes. This is little ugly but works.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52 sending an octet</title><link>https://devzone.nordicsemi.com/thread/37331?ContentTypeID=1</link><pubDate>Wed, 04 Nov 2015 17:47:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f6b5c9c8-6e15-4739-b86a-4eaa5a0f8bdb</guid><dc:creator>Abhi</dc:creator><description>&lt;p&gt;Yes, that post covers the same issue. Ok, so I was wondering if it is possible to shorten the time for which SS is set to low by half then? Because the 8 bits that I need to send contain a command that will execute on the rising edge of the SS after those 8 bits have been sent.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52 sending an octet</title><link>https://devzone.nordicsemi.com/thread/37330?ContentTypeID=1</link><pubDate>Wed, 04 Nov 2015 08:54:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:24889577-3992-4be6-85a6-952a280ce5a4</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Have not looked into this driver but, if it is using DMA then there is a known issue regarding this.
You can find the related post &lt;a href="https://devzone.nordicsemi.com/question/49425/cant-transmit-single-byte-over-spim-with-dma/"&gt;here&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>