<?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 receives FF each time (MISO in high impedance)</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/105340/spi-receives-ff-each-time-miso-in-high-impedance</link><description>Hi Nordic team, 
 I&amp;#39;m using an accelerometer ( FXLS8964AF from NXP) and the evaluation board nrf9160dk as master but I can&amp;#39;t communicate them. 
 My code: 
 #include &amp;lt;zephyr/kernel.h&amp;gt; #include &amp;lt;zephyr/device.h&amp;gt; #include &amp;lt;zephyr/devicetree.h&amp;gt; #include </description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 14 Nov 2023 01:25:58 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/105340/spi-receives-ff-each-time-miso-in-high-impedance" /><item><title>RE: SPI receives FF each time (MISO in high impedance)</title><link>https://devzone.nordicsemi.com/thread/455431?ContentTypeID=1</link><pubDate>Tue, 14 Nov 2023 01:25:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1526bbcb-aa17-43a6-a3a7-ec9b7e687e61</guid><dc:creator>Tania V</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;a class="internal-link view-user-profile" href="https://devzone.nordicsemi.com/members/naeem-maroof"&gt;Naeem Maroof&lt;/a&gt;,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I solved by changing the overlay file (keeping spi2).&lt;/p&gt;
&lt;p&gt;-&amp;gt; CLK, MOSI, MISO&lt;/p&gt;
&lt;p&gt;From&lt;/p&gt;
&lt;p&gt;GPIO0 13, 11 and 12&lt;/p&gt;
&lt;p&gt;To&lt;/p&gt;
&lt;p&gt;GPIO0 19, 21 and 22&lt;/p&gt;
&lt;div&gt;&lt;/div&gt;
&lt;p&gt;Thank you for your support.&lt;/p&gt;
&lt;p&gt;Bes regards,&lt;/p&gt;
&lt;p&gt;Tania&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI receives FF each time (MISO in high impedance)</title><link>https://devzone.nordicsemi.com/thread/455074?ContentTypeID=1</link><pubDate>Fri, 10 Nov 2023 09:09:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1bfb2806-e15f-44a4-bc17-00f885b98249</guid><dc:creator>Naeem Maroof</dc:creator><description>&lt;p&gt;Hello&lt;/p&gt;
&lt;p&gt;Yes, the INTF_SEL should be high (VDD) for using the SPI interface as per their data-sheet&lt;/p&gt;
&lt;p&gt;How does your hardware setup look like&lt;/p&gt;
&lt;p&gt;It does not seem to be case at SoC side, but rather at the peripheral side&lt;/p&gt;
&lt;p&gt;Can you make sure connections are correct and solid.&lt;/p&gt;
&lt;p&gt;Sharing hardware snap would be great.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI receives FF each time (MISO in high impedance)</title><link>https://devzone.nordicsemi.com/thread/454974?ContentTypeID=1</link><pubDate>Thu, 09 Nov 2023 15:44:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f02f25d7-219a-42cd-952d-bfe5ec6d097d</guid><dc:creator>Tania V</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;a class="internal-link view-user-profile" href="https://devzone.nordicsemi.com/members/hmolesworth"&gt;hmolesworth&lt;/a&gt;,&lt;/p&gt;
&lt;p&gt;Sorry for the&amp;nbsp;&lt;span&gt;misunderstanding. I was referring&amp;nbsp;to the pin&amp;nbsp;INTF_SEL (I still have the same issue with MISO).&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;If I find the solution I will write here.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Tania&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI receives FF each time (MISO in high impedance)</title><link>https://devzone.nordicsemi.com/thread/454813?ContentTypeID=1</link><pubDate>Thu, 09 Nov 2023 01:37:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d18b213d-ec37-4c76-8db2-0b42bc331aeb</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;Yes, wonderful .. but for&amp;nbsp;future readers (surely someone reads these posts ..) what did you change? Was it &lt;span&gt;pin 9 INTF_SEL?&amp;nbsp;&lt;/span&gt;:-)&lt;/p&gt;
&lt;p&gt;Regards - Hugh&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI receives FF each time (MISO in high impedance)</title><link>https://devzone.nordicsemi.com/thread/454810?ContentTypeID=1</link><pubDate>Thu, 09 Nov 2023 01:23:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2d68766c-f6e3-477e-b1b5-debe7893e13a</guid><dc:creator>Tania V</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;a class="internal-link view-user-profile" href="https://devzone.nordicsemi.com/members/hmolesworth"&gt;hmolesworth&lt;/a&gt;,&lt;/p&gt;
&lt;p&gt;I did it.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Oscilloscope captures:&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/pastedimage1699492946297v2.png" alt=" " /&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/pastedimage1699492946273v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Tania&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI receives FF each time (MISO in high impedance)</title><link>https://devzone.nordicsemi.com/thread/454518?ContentTypeID=1</link><pubDate>Tue, 07 Nov 2023 15:16:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2c0bb69a-43da-4c72-8f61-cbb7e98975b7</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;Data on MOSI looks correct except there are 4 bytes not 3 (which doesn&amp;#39;t matter). Is pin 9 INTF_SEL correct? It must be high (VDD) for SPI.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;spi_config needs input from Nordic, assuming it&amp;#39;s similar to their example code. It looks ok.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI receives FF each time (MISO in high impedance)</title><link>https://devzone.nordicsemi.com/thread/454330?ContentTypeID=1</link><pubDate>Tue, 07 Nov 2023 01:15:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5ad2ace7-f4c6-486f-9368-24c8da6b6c73</guid><dc:creator>Tania V</dc:creator><description>&lt;p&gt;Hi &lt;a class="internal-link view-user-profile" href="https://devzone.nordicsemi.com/members/hmolesworth"&gt;hmolesworth&lt;/a&gt;,&lt;/p&gt;
&lt;p&gt;I had this result.&lt;/p&gt;
&lt;div class=""&gt;&amp;nbsp;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1699319703945v3.jpeg" alt=" " /&gt;&lt;/div&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Tania&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI receives FF each time (MISO in high impedance)</title><link>https://devzone.nordicsemi.com/thread/454043?ContentTypeID=1</link><pubDate>Fri, 03 Nov 2023 20:52:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1b241dd5-f279-4096-b76a-827f1e9697d4</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;I don&amp;#39;t have those definitions to hand, but you want both bitfields to be 0 so just comment&amp;nbsp;SPI_MODE_CPOL and SPI_MODE_CPHA out or delete them as follows:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static const struct spi_config _gSpiCfg = {
   .operation = SPI_WORD_SET(8) |
   SPI_TRANSFER_MSB |
   SPI_OP_MODE_MASTER,
   .frequency = 1000000,
   .slave = 0,
   .cs = &amp;amp;spim_cs,
};&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI receives FF each time (MISO in high impedance)</title><link>https://devzone.nordicsemi.com/thread/454031?ContentTypeID=1</link><pubDate>Fri, 03 Nov 2023 17:59:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c9f11c85-83df-457f-8483-9166254a2182</guid><dc:creator>Tania V</dc:creator><description>&lt;p&gt;Hi &lt;span&gt;hmolesworth&lt;/span&gt;,&lt;/p&gt;
&lt;p&gt;I will try it.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Do you know how I can change POL and CPHA of the clk?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;From the actual configuration to&amp;nbsp;&lt;/span&gt;&lt;span&gt;CPOL=0 and CPHA=0.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;It shows in the config struct but can I change it?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;static const struct spi_config _gSpiCfg = {&lt;br /&gt;.operation = SPI_WORD_SET(8) |&lt;br /&gt;SPI_TRANSFER_MSB |&lt;br /&gt;SPI_MODE_CPOL |&lt;br /&gt;SPI_MODE_CPHA |&lt;br /&gt;SPI_OP_MODE_MASTER,&lt;br /&gt;.frequency = 1000000,&lt;br /&gt;.slave = 0,&lt;br /&gt;.cs = &amp;amp;spim_cs,&lt;br /&gt;};&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Thank you for your support.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI receives FF each time (MISO in high impedance)</title><link>https://devzone.nordicsemi.com/thread/453861?ContentTypeID=1</link><pubDate>Thu, 02 Nov 2023 23:14:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:55ad9f68-aade-4da0-b655-2bef0e5bef75</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;This accelerometer is slightly unusual in that to read a single byte requires a 24-bit (3 byte) transaction as the 2nd byte is basically ignored and allows internal timing stuff, so increase the Rx buffer size from 2 bytes to 3 bytes and the &amp;quot;&lt;em&gt;I am ..&lt;/em&gt;&amp;quot; response will be in the 3rd byte.&lt;/p&gt;
&lt;p&gt;&amp;quot;&lt;em&gt;SPI read operations with 4-wire mode A register read operation is initiated by transmitting a 1 for the R/W bit. Then, the 7- bit register read address, A[6:0] is encoded in the first byte. Following this first byte, a second byte of 0s or 1s (don&amp;#39;t care condition) transfers. After this transfer completes, the next 8 SCLK cycles (pulses 17 through 24) output the selected register content&lt;/em&gt;&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;// Tx can stay unchanged, Rx has to be 3 bytes minimum
uint8_t rxBuf[2];
// to
uint8_t rxBuf[3];&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>