<?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>Weird SPI timings when using Zephyr SPI driver</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/81078/weird-spi-timings-when-using-zephyr-spi-driver</link><description>I&amp;#39;ve tried sending ASCII &amp;quot;Hello world&amp;quot; over SPI with various data rates. Somehow clock signal given by SPI is not continuous. This discontinuouty differs with clock frequency. Here it&amp;#39;s the screenshots of the logic analyzer with SPI frequencies in order</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 17 Nov 2021 06:34:21 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/81078/weird-spi-timings-when-using-zephyr-spi-driver" /><item><title>RE: Weird SPI timings when using Zephyr SPI driver</title><link>https://devzone.nordicsemi.com/thread/339334?ContentTypeID=1</link><pubDate>Wed, 17 Nov 2021 06:34:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bb96b8c4-8833-422e-a724-bf064d893d95</guid><dc:creator>seneryilmaz</dc:creator><description>&lt;p&gt;When I used SPIM driver instead of SPI, time intervals between bytes are disappeared.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Weird SPI timings when using Zephyr SPI driver</title><link>https://devzone.nordicsemi.com/thread/336780?ContentTypeID=1</link><pubDate>Mon, 01 Nov 2021 08:07:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dd66a715-7d7a-4254-8399-cb0df8374bc1</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;I was not able to reproduce this. I tested on a nRF52840DK.&lt;/p&gt;
&lt;p&gt;Here is the code I used:&lt;br /&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/2465.spi.zip"&gt;devzone.nordicsemi.com/.../2465.spi.zip&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Weird SPI timings when using Zephyr SPI driver</title><link>https://devzone.nordicsemi.com/thread/335925?ContentTypeID=1</link><pubDate>Tue, 26 Oct 2021 10:58:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bfd63379-803f-4e14-b4ac-c41ac102da46</guid><dc:creator>seneryilmaz</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;1) NRF52840 (PCA10059 Dongle)&lt;/p&gt;
&lt;p&gt;2)&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;const struct device *spi_device = device_get_binding(DT_LABEL(SPI));
if(spi_device == NULL)
{
    while(1)
    {
        gpio_pin_set(dev1, PIN1, (int)led_is_on);
        led_is_on = !led_is_on;
        k_msleep(100);
    }
}

struct spi_cs_control cs_control;
cs_control.gpio_dev = DEVICE_DT_GET(DT_NODELABEL(gpio0));
cs_control.delay = 1;
cs_control.gpio_pin = 13;
cs_control.gpio_dt_flags = GPIO_ACTIVE_LOW;

struct spi_config config;
config.frequency = 16000000U;
config.operation = SPI_WORD_SET(8) | SPI_TRANSFER_MSB | SPI_OP_MODE_MASTER;
config.slave = 0;
config.cs = &amp;amp;cs_control;

struct spi_buf spi_tx_buf;
spi_tx_buf.buf = spi_tx_message;
spi_tx_buf.len = strlen(spi_tx_message);

struct spi_buf_set spi_tx_buf_set;
spi_tx_buf_set.buffers = &amp;amp;spi_tx_buf;
spi_tx_buf_set.count = 1;

gpio_pin_set(dev0, PIN0, 0);
gpio_pin_set(dev1, PIN1, 0);

while(1)
{
    int ret_func = spi_write(spi_device, &amp;amp;config, &amp;amp;spi_tx_buf_set);
    if(ret_func == 0)
    {
        gpio_pin_set(dev0, PIN0, (int)led_is_on);
    }
    else
    {
        gpio_pin_set(dev1, PIN1, (int)led_is_on);
    }
    led_is_on = !led_is_on;
    k_msleep(SLEEP_TIME_MS);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;3) The latest release version which is 1.7.0&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Weird SPI timings when using Zephyr SPI driver</title><link>https://devzone.nordicsemi.com/thread/335923?ContentTypeID=1</link><pubDate>Tue, 26 Oct 2021 10:54:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7212b95f-f973-42a1-94ea-51d71d3cb9bd</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;1) What device are you using? nRF51, nRF52832, nRF52840, nRF5340, nRF9160, etc?&lt;/p&gt;
&lt;p&gt;2) Do you have some code snippets&amp;nbsp;or simple example code t&lt;span&gt;hat you used to test this, that you can share?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;3) What version of nRF Connect SDK(NCS) did you use?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>