<?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>SPIM EasyDMA - sending and reading one byte</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/13475/spim-easydma---sending-and-reading-one-byte</link><description>Hello,
I am developing custom HAL driver for SPI in NRF52 (PCA10040). The problem is that using the EasyDMA MAXCNT registers value must be between 1...255. It implicates that sending and receiving 1 Byte of data is impossible. SPIM alway clocks 16bit</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 27 Apr 2016 09:45:59 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/13475/spim-easydma---sending-and-reading-one-byte" /><item><title>RE: SPIM EasyDMA - sending and reading one byte</title><link>https://devzone.nordicsemi.com/thread/51416?ContentTypeID=1</link><pubDate>Wed, 27 Apr 2016 09:45:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:58f9d2da-54ea-4a8e-bf16-fad1f5797c0d</guid><dc:creator>Wojtek</dc:creator><description>&lt;p&gt;It is a bug in the chip project i think. It is described in &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.Rev1.errata/anomaly_832_58.html#anomaly_832_58"&gt;errata&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPIM EasyDMA - sending and reading one byte</title><link>https://devzone.nordicsemi.com/thread/51415?ContentTypeID=1</link><pubDate>Wed, 27 Apr 2016 08:52:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dc887745-3f3f-4cda-beae-c7556e415686</guid><dc:creator>kijemwoko</dc:creator><description>&lt;p&gt;I looked after nrf_drv_spi_transfer() function. There is simple setting of DMA registers as in my write function. Btw. I know the data should be in RAM section (I made a test - I located the transmit DMA buffer in flash and no error occured).&lt;/p&gt;
&lt;p&gt;Example provided below for reading one byte clocks 16bits of data:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;eventClear(Event::END);
spi.TXD.PTR = reinterpret_cast&amp;lt;uint32_t&amp;gt;(&amp;amp;write);
spi.TXD.MAXCNT = 0;    
spi.RXD.PTR = reinterpret_cast&amp;lt;uint32_t&amp;gt;(&amp;amp;buffer); 
spi.RXD.MAXCNT = 1;
spi.ORC = 0;
taskTrigger(Task::START);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Pertaining to the datasheet above solution shouldn&amp;#39;t be used because of 0 written to MAXCNT register. With ones in MAXCNT registers the situation is the same.&lt;/p&gt;
&lt;p&gt;My most recent test shows that calling above function (with 1 in TX MAXCNT and RX MAXCNT) clocks alternately 8bits and 16bits (16bits just after enabling SPIM) :) How to force the peripheral to send only 8bit?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPIM EasyDMA - sending and reading one byte</title><link>https://devzone.nordicsemi.com/thread/51414?ContentTypeID=1</link><pubDate>Wed, 27 Apr 2016 07:57:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d630bcca-c95d-445a-bfe9-ebd7d8dc0ba4</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Hi, I can confirm that if I use \examples\peripheral\spi\ in the nRF5 SDK v11, I can read and write only 8 bit by setting m_length = 1 when calling nrf_drv_spi_transfer(). This example use the nrf_drv_spi configured with easyDMA, maybe you can use it as reference.&lt;/p&gt;
&lt;p&gt;There is however an &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.Rev1.errata/anomaly_832_58.html?cp=1_3_1_0_1_8"&gt;Errata 58 : SPIM: An additional byte is clocked out when RXD.MAXCNT = 1&lt;/a&gt; that you should check out.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>