<?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 on sample code</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/103198/spi-clock-issue-on-sample-code</link><description>Hello 
 i am using SPI sample code in sample code 1 MHZ clock using and check this pin on DSO and getting this type of clock which is mention in pic 1 but i want contineous clock. can you guide me why getting this type of clock . Yellow line for clock</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 29 Aug 2023 22:05:12 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/103198/spi-clock-issue-on-sample-code" /><item><title>RE: SPI Clock issue on sample code</title><link>https://devzone.nordicsemi.com/thread/443621?ContentTypeID=1</link><pubDate>Tue, 29 Aug 2023 22:05:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b3295ade-57c0-4e0e-81d9-a112354551f2</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;Easy fix&lt;/p&gt;
&lt;p&gt;Let&amp;#39;s assume from your post that as you see 56 clock edges that you are sending 7 bytes (7x8=56). For continuous clocking - let&amp;#39;s assume 88 clocks - you require continuous clock transmission, which happens when the receive length is set to a higher value than the transmit length, so the receive length should be 11 bytes (8x11=88) plus the length of the expected data starting at clock edge 87.&lt;/p&gt;
&lt;p&gt;Summary: set transmit length to 7, receive length to 11 (plus length of expected data) and all will be well.&lt;/p&gt;
&lt;p&gt;The data required will be in the receive buffer with an offset of 11 bytes (from your notes); let&amp;#39;s assume this is a photodiode array with 128 elements:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;uint8_t mTxBuffer[7] = {1,2,..}
uint8_t mRxBuffer[11+128} = {0};

// 128 bytes of Photodiode data is in mRxBuffer[11] to mRxBuffer[138]&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Use the ORC register to control the transmit byte values after the first 7 bytes; typically use 0x00 or 0xFF&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI Clock issue on sample code</title><link>https://devzone.nordicsemi.com/thread/443602?ContentTypeID=1</link><pubDate>Tue, 29 Aug 2023 16:30:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:df608c0a-df32-4aa2-a6d0-ad5e68f5afd9</guid><dc:creator>Naeem Maroof</dc:creator><description>&lt;p&gt;Hello,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thank you for your patience.&lt;/p&gt;
&lt;p&gt;It depends on what you are transferring in each spi-transfer.&lt;/p&gt;
&lt;p&gt;For example, I have a 4MHz spi frequency, and when transferring 3 Bytes of data in a continuous loop, this is what I get:&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1693326330907v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;But when I increase the data to be sent in each transfer, the number of clock cycles in each transfer increases accordingly for successful completion of the transfer. This is what I get in such a case:&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1693326501996v3.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Naeem&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI Clock issue on sample code</title><link>https://devzone.nordicsemi.com/thread/443432?ContentTypeID=1</link><pubDate>Mon, 28 Aug 2023 15:44:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f58f66fd-892f-4662-bc81-6f5d32823f19</guid><dc:creator>Naeem Maroof</dc:creator><description>&lt;p&gt;Hello&lt;/p&gt;
&lt;p&gt;Thank you for contacting DevZone at NordicSemi.&lt;/p&gt;
&lt;p&gt;I have been assigned this ticket; however, I was not able to work on it.&lt;/p&gt;
&lt;p&gt;I will look at it tomorrow and will come back to you accordingly.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Naeem&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>