<?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>SPIS data shifting</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/34965/spis-data-shifting</link><description>I am testing SPIS to transmit mass of data(255 bytes each call) from nrf5 DK. 
 I found SPIS data shifting randomly. 
 The testing data is 0x88 but sometimes can get 0x44. 
 Below is correct logs. 
 
 This is the wrong wave. 
 
 When I turn on the Log</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 07 Jun 2018 06:45:58 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/34965/spis-data-shifting" /><item><title>RE: SPIS data shifting</title><link>https://devzone.nordicsemi.com/thread/135057?ContentTypeID=1</link><pubDate>Thu, 07 Jun 2018 06:45:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:15f01890-5522-4dd7-b8da-b68666c4b13a</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Assuming your code goes to sleep you could try enabling constant latency mode. This will increase the current consumption, but should reduce the necessary delay between chip select and the SPI data.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Are you using a SoftDevice in your project or not?&lt;/p&gt;
&lt;p&gt;If you use a SoftDevice you have to enable constant latency mode like this:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;sd_power_mode_set(&lt;em&gt;NRF_POWER_MODE_CONSTLAT);&lt;/em&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;If you don&amp;#39;t use a SoftDevice you can enable it like this:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;NRF_POWER-&amp;gt;TASKS_CONSTLAT = 1;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPIS data shifting</title><link>https://devzone.nordicsemi.com/thread/134874?ContentTypeID=1</link><pubDate>Wed, 06 Jun 2018 09:20:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2dae574d-8817-4606-8340-8673ed7481f0</guid><dc:creator>arikyang</dc:creator><description>&lt;p&gt;I am unable to change the code in the MCU, also it is not a Nordic platform.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPIS data shifting</title><link>https://devzone.nordicsemi.com/thread/134830?ContentTypeID=1</link><pubDate>Wed, 06 Jun 2018 06:33:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fd5e79ae-30c7-46f8-a334-45f022652212</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Are you unable to put in a delay because the SPIM hardware controls the CS pin, or because you are unable to change the code in the MCU?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPIS data shifting</title><link>https://devzone.nordicsemi.com/thread/134565?ContentTypeID=1</link><pubDate>Mon, 04 Jun 2018 12:49:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6bf148c1-ec29-4aac-8f3d-985796dbb1da</guid><dc:creator>arikyang</dc:creator><description>&lt;p&gt;&lt;span&gt;The problem is SPIM is in another system which I cannot put a delay between CS and clock.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPIS data shifting</title><link>https://devzone.nordicsemi.com/thread/134564?ContentTypeID=1</link><pubDate>Mon, 04 Jun 2018 12:47:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:050d2e3b-2a7a-44ed-82e2-1ce9e5b3814c</guid><dc:creator>arikyang</dc:creator><description>&lt;p&gt;Have you measured the delay between CSN going low and the first bit being clocked out on the bus?&lt;/p&gt;
&lt;p&gt;- no,&amp;nbsp;&amp;nbsp;haven&amp;#39;t&amp;nbsp;chance to measure.&lt;/p&gt;
&lt;p&gt;Is the CPU on the slave side in sleep mode before the SPI interface is activated?&lt;/p&gt;
&lt;p&gt;-Where can I know if CPU is in sleep? There is the idle_state_handle() in the main loop. Is that mean CPU will go to sleep?&lt;/p&gt;
&lt;p&gt;As you can see&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/spis.html?cp=2_1_0_31_5_1#unique_954891395"&gt;in the specification&lt;/a&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;there are some limits on how small the delay between CSN going low and the data being sent can be, depending on the power down mode used.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;- The problem is SPIM is in another system which I cannot code a delay between CS and clock.&lt;/p&gt;
&lt;p&gt;Also, what is the length and type of the SPI signal wires?&amp;nbsp;&lt;br /&gt;Do you have two devkits connected, or have you made custom hardware with signals on the PCB?&lt;/p&gt;
&lt;p&gt;- It is two dev kits jump wires each other about 10cm.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPIS data shifting</title><link>https://devzone.nordicsemi.com/thread/134543?ContentTypeID=1</link><pubDate>Mon, 04 Jun 2018 11:59:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1f2d4814-07fc-4057-9b1d-d1fe1198146b</guid><dc:creator>Turbo J</dc:creator><description>&lt;p&gt;Did you read chapter 32.6.2 &amp;quot;Serial Peripheral Interface Slave (SPIS) timing specifications&amp;quot;?&lt;/p&gt;
&lt;p&gt;The SPIS needs a delay of 1000ns from the CS low transistion to the first CLK pulse - in CONSTLAT mode.&lt;/p&gt;
&lt;p&gt;In low power mode this is even longer, since the HFINT oscillator must start up first.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPIS data shifting</title><link>https://devzone.nordicsemi.com/thread/134528?ContentTypeID=1</link><pubDate>Mon, 04 Jun 2018 11:22:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:236e1d87-acd2-448b-b2c5-32075b1f0fc9</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Have you measured the delay between CSN going low and the first bit being clocked out on the bus?&lt;/p&gt;
&lt;p&gt;Is the CPU on the slave side in sleep mode before the SPI interface is activated?&lt;/p&gt;
&lt;p&gt;As you can see &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/spis.html?cp=2_1_0_31_5_1#unique_954891395"&gt;in the specification&lt;/a&gt; there are some limits on how small the delay between CSN going low and the data being sent can be, depending on the power down mode used.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Also, what is the length and type of the SPI signal wires?&amp;nbsp;&lt;br /&gt;Do you have two devkits connected, or have you made custom hardware with signals on the PCB?&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPIS data shifting</title><link>https://devzone.nordicsemi.com/thread/134444?ContentTypeID=1</link><pubDate>Mon, 04 Jun 2018 01:16:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1e3eb8c6-2937-4e0e-b1d1-3da77984a2dd</guid><dc:creator>arikyang</dc:creator><description>&lt;p&gt;2MHz&lt;/p&gt;
&lt;p&gt;Yes, both sides are setting 0 mode.&lt;/p&gt;
&lt;p&gt;I think SPIS peripheral is not response CS low quickly, sometimes MISO is still keeping HIGH when CS low and the clock has shaken.&lt;/p&gt;
&lt;p&gt;The frequency&amp;nbsp;roll down to 600KHz is more stable as my workaround.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPIS data shifting</title><link>https://devzone.nordicsemi.com/thread/134368?ContentTypeID=1</link><pubDate>Fri, 01 Jun 2018 12:38:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:50460226-5659-4df1-849d-2733f84ed982</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;What clock frequency is the SPI running at?&lt;/p&gt;
&lt;p&gt;Have you made sure to select the correct SPI mode (clock polarity and phase) both on the master and slave side?&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>