<?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>Strange MOSI behaviour on SPI2(Mode 0)(Data not ready on sampling clock)</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/63389/strange-mosi-behaviour-on-spi2-mode-0-data-not-ready-on-sampling-clock</link><description>I&amp;#39;ve been observing a strange behaviour on the MOSI line using SPI2 in Mode 0(nRF52832) with connected ST7789 based display, 
 The data happens to be not available at the time of the sampling clock. This happens rarely, only in Mode 0 and only with the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sat, 04 Jul 2020 18:06:44 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/63389/strange-mosi-behaviour-on-spi2-mode-0-data-not-ready-on-sampling-clock" /><item><title>RE: Strange MOSI behaviour on SPI2(Mode 0)(Data not ready on sampling clock)</title><link>https://devzone.nordicsemi.com/thread/258446?ContentTypeID=1</link><pubDate>Sat, 04 Jul 2020 18:06:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4cca4c40-cd85-45f7-8c67-adc3d27b3e50</guid><dc:creator>Stefan Tsenev</dc:creator><description>&lt;p&gt;Thank you for the hint.&lt;/p&gt;
&lt;p&gt;It seems that I have misread the specs for ST7789 and following you comment I made a test on 250kHz with analogue channel to find my mistake(The pin could be 3-state in some cases).&lt;/p&gt;
&lt;p&gt;It is clearly visible that MOSI is driven high but on the other side is pulled low until the clock appears:&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/Mode3_5F00_ST7789_5F00_Analogue.png" /&gt;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Stefan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Strange MOSI behaviour on SPI2(Mode 0)(Data not ready on sampling clock)</title><link>https://devzone.nordicsemi.com/thread/258445?ContentTypeID=1</link><pubDate>Sat, 04 Jul 2020 17:43:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:da6c5c46-f3bd-469c-a06e-cbd0ec1c1c4c</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;Try this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;    APP_ERROR_CHECK(nrf_drv_spi_init(&amp;amp;spi, &amp;amp;spi_config, spi_event_handler, NULL));
    // Boost drive to MOSI and MCLK to sharpen clock edges and timing
    nrf_gpio_cfg(TFT_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(TFT_MCLK, 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;p&gt;The reason is that the logic analyser/&amp;#39;scope is hiding information from you, the edges are really not as sharp as displayed and the timing is too sloppy with S0S1 drive levels at 8MHz&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>