<?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 not operating correctly at high speeds</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/64647/spi-not-operating-correctly-at-high-speeds</link><description>Hello, 
 
 I&amp;#39;m having issues getting my SPI to work at high transfer speeds. I have my pins configured to have high drive. 
 SPI is set to MSB first, Mode 0. 
 Colors: 
 Brown = SCK 
 Red = MOSI 
 Orange = MISO 
 Yellow = CS 
 
 This is a transaction</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 12 Aug 2020 15:40:01 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/64647/spi-not-operating-correctly-at-high-speeds" /><item><title>RE: SPI not operating correctly at high speeds</title><link>https://devzone.nordicsemi.com/thread/264324?ContentTypeID=1</link><pubDate>Wed, 12 Aug 2020 15:40:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0bc239a3-4b25-4b16-bd82-db5778248f37</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;Sorry to be pedantic, but standard drive will &lt;em&gt;not&lt;/em&gt; look the same as high drive on your scope, even with significant wire lengths; if it does look the same, then high drive has not been applied correctly. Perhaps review this setting again, the high drive must be set &lt;em&gt;after&lt;/em&gt; any SPI init otherwise it will be overwritten by that SPI init.&lt;/p&gt;
&lt;p&gt;Also place one channel of the scope on SCK at the Nordic end &lt;em&gt;with the scope Gnd on Nordic Gnd&lt;/em&gt;, and place a second scope channel on SCK (same signal) on the remote device end with that second scope Gnd &lt;em&gt;at the Gnd on the remote device end&lt;/em&gt;. Capture the trace and post them here. They will not look the same if the scope probes are placed correctly even though they are connected by a 6 inch jumper.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI not operating correctly at high speeds</title><link>https://devzone.nordicsemi.com/thread/264294?ContentTypeID=1</link><pubDate>Wed, 12 Aug 2020 13:57:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b8a91b60-0f9c-422f-8d34-12a2e88ca013</guid><dc:creator>T IJ</dc:creator><description>&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1597240371881v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;This is clock on Pin 8, still the same.&lt;/p&gt;
[quote userid="5418" url="~/f/nordic-q-a/64647/spi-not-operating-correctly-at-high-speeds/264284"]On 52832 DK, pin 7 is a CTS signal of debug UART - this may cause an issue.[/quote]
&lt;p&gt;I have turned off the UART debug output in the CMSIS config wizzard. I always use the RTT option.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1597240599096v2.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Pin 11 also looks the same.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI not operating correctly at high speeds</title><link>https://devzone.nordicsemi.com/thread/264284?ContentTypeID=1</link><pubDate>Wed, 12 Aug 2020 13:19:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9265cf46-9c22-4aaf-9b6f-c35d86e1d8c7</guid><dc:creator>Dmitry</dc:creator><description>&lt;p&gt;On 52832 DK, pin 7 is a CTS signal of debug UART - this may cause an issue.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI not operating correctly at high speeds</title><link>https://devzone.nordicsemi.com/thread/264260?ContentTypeID=1</link><pubDate>Wed, 12 Aug 2020 12:20:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f202f10a-adb3-49b3-a8d8-dd9e6d94afee</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi Tom&lt;/p&gt;
&lt;p&gt;Seeing as the SCK signal seems to be the source of the problem here, have you tried switching this to be any other GPIO, to make sure that it isn&amp;#39;t specific to that one pin (just in case there is any issues with the soldering or connection on that GPIO.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI not operating correctly at high speeds</title><link>https://devzone.nordicsemi.com/thread/264150?ContentTypeID=1</link><pubDate>Wed, 12 Aug 2020 05:46:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5e072f22-4bf1-45de-9780-0fbffb2921d9</guid><dc:creator>T IJ</dc:creator><description>[quote userid="86994" url="~/f/nordic-q-a/64647/spi-not-operating-correctly-at-high-speeds"]I have my pins configured to have high drive.[/quote]
&lt;p&gt;I&amp;#39;ve done that already.&lt;/p&gt;
&lt;p&gt;Tested it with standard drive as well.&lt;/p&gt;
&lt;p&gt;It might be due to the wires and everything but in my opinion this shouldn&amp;#39;t make that much of a difference.&lt;/p&gt;
&lt;p&gt;If my SPI device is located at the other side of my circuit board do I get the same behavior as having it like I have now with the long wires?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve tried it with a simple Arduino pushing out at 8 MHz to compare to see if the analyzer is the problem but it isn&amp;#39;t. The Arduino has proper clocks instead of a sine that the NRF is producing.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI not operating correctly at high speeds</title><link>https://devzone.nordicsemi.com/thread/264121?ContentTypeID=1</link><pubDate>Tue, 11 Aug 2020 16:28:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dee02f93-9603-4f39-8b28-6cab64828c6e</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;Clock speed is only one consideration; the other is capacitive load on the outputs. Long leads such as these inevitably slow the clock edges and so therefore High Drive is required.&lt;/p&gt;
&lt;p&gt;Try this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#define SPI_MOSI 19
#define SPI_CLK   7
#define SPI_CS   25

// Init first then set High Drive 0 and 1 (something like this):
APP_ERROR_CHECK(nrf_drv_spi_init(&amp;amp;spi, &amp;amp;spi_config, spi_event_handler, NULL));
// Boost drive to MOSI and CLK and CS to sharpen clock edges and timing
nrf_gpio_cfg(SPI_MOSI, NRF_GPIO_PIN_DIR_OUTPUT, NRF_GPIO_PIN_INPUT_CONNECT, NRF_GPIO_PIN_NOPULL, NRF_GPIO_PIN_H0H1, NRF_GPIO_PIN_NOSENSE);
nrf_gpio_cfg(SPI_CLK,  NRF_GPIO_PIN_DIR_OUTPUT, NRF_GPIO_PIN_INPUT_CONNECT, NRF_GPIO_PIN_NOPULL, NRF_GPIO_PIN_H0H1, NRF_GPIO_PIN_NOSENSE);
nrf_gpio_cfg(SPI_CS,   NRF_GPIO_PIN_DIR_OUTPUT, NRF_GPIO_PIN_INPUT_CONNECT, NRF_GPIO_PIN_NOPULL, NRF_GPIO_PIN_H0H1, NRF_GPIO_PIN_NOSENSE);
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI not operating correctly at high speeds</title><link>https://devzone.nordicsemi.com/thread/264099?ContentTypeID=1</link><pubDate>Tue, 11 Aug 2020 13:48:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4238d7a2-a38c-43c1-9f2a-f1418f8494e1</guid><dc:creator>T IJ</dc:creator><description>&lt;p&gt;I am testing it like this, without any external device attached to it.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1597153679570v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Please tell me its a hardware issue&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI not operating correctly at high speeds</title><link>https://devzone.nordicsemi.com/thread/264090?ContentTypeID=1</link><pubDate>Tue, 11 Aug 2020 13:24:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0b2166a8-8cbb-4a7b-b9f8-2c9874bf9a8d</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Are you able to reproduce this on a DK, or are you only seeing this on a custom board? If this is specific to a custom board, please check your soldering, as the SCK pin may be connected somewhere it shouldn&amp;#39;t be, or the other way around. All the pins you&amp;#39;re using should be okay, and if that&amp;#39;s the only thing that has changed in your project code, everything points toward this being a HW issue.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI not operating correctly at high speeds</title><link>https://devzone.nordicsemi.com/thread/263986?ContentTypeID=1</link><pubDate>Tue, 11 Aug 2020 09:29:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:85bf63c6-bc8a-4231-b83b-7cb954cd4b5a</guid><dc:creator>T IJ</dc:creator><description>&lt;p&gt;I&amp;#39;ve done some further measurements and found out that the SCK signal isn&amp;#39;t looking that good.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1597138011896v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;This is done using 50Msps analyzer and the Vmin and Vmax are not what I expect them to be.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1597138139773v2.png" alt=" " /&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This is what the data looks like and here the Vmin and Vmax are what I expect them to be.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Anyone got a clue what is going on?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI not operating correctly at high speeds</title><link>https://devzone.nordicsemi.com/thread/263857?ContentTypeID=1</link><pubDate>Mon, 10 Aug 2020 13:36:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:09cf2814-bf20-4c39-a991-cf70881831ac</guid><dc:creator>T IJ</dc:creator><description>&lt;p&gt;I&amp;#39;ve used the example project and changed the pins to:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;spi_config.ss_pin = 25;
spi_config.miso_pin = 11;
spi_config.mosi_pin = 19;
spi_config.sck_pin = 7;&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI not operating correctly at high speeds</title><link>https://devzone.nordicsemi.com/thread/263852?ContentTypeID=1</link><pubDate>Mon, 10 Aug 2020 13:29:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:374357e5-c4b7-4d39-b96a-16392551f468</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Seeing issues at 500kbps already seems very strange, as that doesn&amp;#39;t really qualify as &amp;quot;high-speed&amp;quot;. What pins exactly are you using for SPI here? Is your project based on one of our example projects? If not, please check one of our &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.0/spi_master_example.html"&gt;SPI example projects&lt;/a&gt;, whether you&amp;#39;re able to reproduce this issue there as well.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>