<?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>SPI clock issue</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/19324/spi-clock-issue</link><description>Hi, 
 I&amp;#39;m trying to use the SPI example from the SDK 11 to comunicate with a MPU accelerometer.
The first time it works well, but then the clock send only 8 peak, so the slave can&amp;#39;t answer. 
 Once 16 peak, once 8. Again and again 
 I don&amp;#39;t understand</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 31 Jan 2017 12:41:23 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/19324/spi-clock-issue" /><item><title>RE: SPI clock issue</title><link>https://devzone.nordicsemi.com/thread/74946?ContentTypeID=1</link><pubDate>Tue, 31 Jan 2017 12:41:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7dd67f69-c754-472e-8595-59f27dc87002</guid><dc:creator>Arthur</dc:creator><description>&lt;p&gt;I succeed to get the answer from my MPU with your advices !!
Thank you&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI clock issue</title><link>https://devzone.nordicsemi.com/thread/74943?ContentTypeID=1</link><pubDate>Tue, 31 Jan 2017 09:33:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0a283cdb-66cd-45bd-8d35-f997ca993e00</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;@Arthur: If your using a MPUxxxx accelerometer then I suggest that you take a look at &lt;a href="https://github.com/Martinsbl/nrf5-mpu-examples"&gt;this&lt;/a&gt; GitHub repo made by a colleauge, it contains SPI and TWI examples for MPUxxxx devices&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI clock issue</title><link>https://devzone.nordicsemi.com/thread/74945?ContentTypeID=1</link><pubDate>Mon, 30 Jan 2017 19:13:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:30f43334-2bd0-4288-959b-b85e0a8b9dcf</guid><dc:creator>artis</dc:creator><description>&lt;p&gt;I ran into the same problem. I think that the used interface is misleading  (it suggests that rx lengths and tx lengths are independent).
The best thing you can do is have your tx length and rx length the same. So if your command is 1 byte long and you are reading 2 bytes, make your tx and rx array 3 long. The command should be at tx[0]; the response will be available at rx[1] and rx[2].&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI clock issue</title><link>https://devzone.nordicsemi.com/thread/74942?ContentTypeID=1</link><pubDate>Mon, 30 Jan 2017 16:41:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c6b847cc-e4ab-41c1-81fc-7e729c813b3e</guid><dc:creator>Arthur</dc:creator><description>&lt;p&gt;I am using nRF52 DK with SPI_USE_EASY_DMA set to 1&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI clock issue</title><link>https://devzone.nordicsemi.com/thread/74944?ContentTypeID=1</link><pubDate>Mon, 30 Jan 2017 16:40:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fa6427f1-2eec-4b3d-b1b4-777b3bbd1283</guid><dc:creator>Arthur</dc:creator><description>&lt;p&gt;I replaced this :&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;static uint8_t       m_tx_buf[1] = {0xF5};
nrf_drv_spi_transfer(&amp;amp;spi, m_tx_buf		, 1, m_rx_data_spi	 , 1);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;with this :&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;static uint8_t       m_tx_buf[2] = {0xF5, 0x00};
nrf_drv_spi_transfer(&amp;amp;spi, m_tx_buf		, 2, m_rx_data_spi	 , 1);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;and know I get the correct signals in the oscilloscope.&lt;/p&gt;
&lt;p&gt;But m_rx_data_spi remain always empty.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI clock issue</title><link>https://devzone.nordicsemi.com/thread/74941?ContentTypeID=1</link><pubDate>Mon, 30 Jan 2017 14:23:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e1cb9a7f-b3b5-42fb-8879-a01d3b75c097</guid><dc:creator>Wojtek</dc:creator><description>&lt;p&gt;would be nice if you state what device You are using. If it is nRF52, this may be something with SPI DMA 1 byte transfer bug in the chip? You could check the errata to confirm that.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>