<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: KW36 - SPI - troubles with TX FIFO &amp; bit shifting  in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KW36-SPI-troubles-with-TX-FIFO-bit-shifting/m-p/1021655#M56275</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mario,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry I should have started by some screens.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is my problem rephrased:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't get the CS influence when I'm chaining 3 transfers of a given size (1 in this case). With the same code on the slave side (cf. the file provided with the first post), I get two different results, whether or not I raised the CS between the transfer.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;With &lt;/STRONG&gt;CS lowered and raised between transfer:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/91834i60B640A45A03BF22/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;Without&lt;/STRONG&gt; CS lowered and raised between transfer :&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_2.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/91921i50A9125A9AF5D899/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_2.png" alt="pastedImage_2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PTC17 is raised for timing purpose, It helps me to see when I'm in the interruption after the transfer (Channel 4 on the screens).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you can see when the transfer is finished, the interruption is triggered with and without the CS. In one case (without CS) I got 0xAA then 0xBB the 0xCC and in the other, a "delay" is created.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope it will help you understand my issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Loïc&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 13 Nov 2019 08:08:54 GMT</pubDate>
    <dc:creator>loic_guillaume_</dc:creator>
    <dc:date>2019-11-13T08:08:54Z</dc:date>
    <item>
      <title>KW36 - SPI - troubles with TX FIFO &amp; bit shifting</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KW36-SPI-troubles-with-TX-FIFO-bit-shifting/m-p/1021651#M56271</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Some context here : I'm using a MKW36 on a custom shield plugged on a nucleo L053R8. The goal is to replicate the S2-LP behaviour as 2.4Ghz sniffer.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm having issues to understand something that is happening while I'm using SPI.&amp;nbsp;Please find attached&amp;nbsp;my code (forked from nxp example).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;after using&amp;nbsp;DSPI_SlaveTransferNonBlocking(SPI1, &amp;amp;g_s_handle, &amp;amp;slaveXfer), the registers state is correct :&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/93444iE562EE12A0159AF5/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SR &amp;amp; TX0 are as expected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On the master side, i'm sending a byte (CS low). I want the slave to send 0xAA but it sends 0x00. And if repeat the operation with another transfer right after (sending 0xBB for example). 0xAA is sent. The CS didn't return to the higher state.&lt;/P&gt;&lt;P&gt;I cannot understand the "delay".&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also if the CS go HIGH then&amp;nbsp;LOW between the transfer, there is no "delay" but the first byte sent is still 0x00.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would greatly appreciate if you have some indications for me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Loic&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Nov 2019 10:38:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KW36-SPI-troubles-with-TX-FIFO-bit-shifting/m-p/1021651#M56271</guid>
      <dc:creator>loic_guillaume_</dc:creator>
      <dc:date>2019-11-08T10:38:37Z</dc:date>
    </item>
    <item>
      <title>Re: KW36 - SPI - troubles with TX FIFO &amp; bit shifting</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KW36-SPI-troubles-with-TX-FIFO-bit-shifting/m-p/1021652#M56272</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Loic,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry for my late reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is the example that you are running on the KW36?&lt;/P&gt;&lt;P&gt;Are you seeing this dummy data with a logic analyzer?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, this behavior that you are seeing is a none issue. When the SPI module sends data, the FIFO keeps the last data&amp;nbsp;in the buffer. The workaround, the device sends a dummy byte for erasing or cleaning the buffer, but if you look at the logic analyzer, you shouldn't see this dummy data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;EM&gt;The CS didn't return to the higher state.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;The CS is controlled by the Master device, are you setting the CS as 0 in the Master side?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mario&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Nov 2019 01:30:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KW36-SPI-troubles-with-TX-FIFO-bit-shifting/m-p/1021652#M56272</guid>
      <dc:creator>mario_castaneda</dc:creator>
      <dc:date>2019-11-12T01:30:46Z</dc:date>
    </item>
    <item>
      <title>Re: KW36 - SPI - troubles with TX FIFO &amp; bit shifting</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KW36-SPI-troubles-with-TX-FIFO-bit-shifting/m-p/1021653#M56273</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Mario,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;What is the example that you are running on the KW36?&lt;/SPAN&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;I'm using "driver_examples_dspi_interrupt_b2b_transfer_slave" from the example pool of the kw36&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Are you seeing this dummy data with a logic analyzer?&lt;/SPAN&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes I am. I use an Oscilloscope to watch the 4 SPI lines (CLK, MOSI, MSIO, CS) and with a special feature it can display MOSI and MISO values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;EM style="border: 0px; font-weight: inherit;"&gt;The CS didn't return to the higher state.&lt;/EM&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;The CS is controlled by the Master device, are you setting the CS as 0 in the Master side?&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Yes. It is on purpose. I want to chain 2 transfers into the same "CS Low" if I can say.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Beg my pardon, but when you say &lt;EM&gt;"&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;the device sends a dummy byte for erasing or cleaning the buffer". &lt;/SPAN&gt;&lt;/EM&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Why the next transfer doesn't&amp;nbsp;erase the buffer ? I don't understand the need of a dummy byte here.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Loïc.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Nov 2019 08:40:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KW36-SPI-troubles-with-TX-FIFO-bit-shifting/m-p/1021653#M56273</guid>
      <dc:creator>loic_guillaume_</dc:creator>
      <dc:date>2019-11-12T08:40:40Z</dc:date>
    </item>
    <item>
      <title>Re: KW36 - SPI - troubles with TX FIFO &amp; bit shifting</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KW36-SPI-troubles-with-TX-FIFO-bit-shifting/m-p/1021654#M56274</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;&lt;SPAN style="color: #646464; background-color: #ffffff;"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;A _jive_internal="true" class="" data-content-finding="Community" data-userid="351105" data-username="loic.guillaume_ext@michelin.com" href="https://community.nxp.com/people/loic.guillaume_ext@michelin.com" rel="noopener noreferrer" style="color: #3d9ce7; background-color: #ffffff; border: 0px; font-weight: 600; text-decoration: none; font-size: 11.9994px;" target="_blank"&gt;Loïc GUILLAUME&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please see the image attached. I am sending a byte at the same time that the Master is sending the first data.&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="pastedImage_2.png"&gt;&lt;IMG alt="pastedImage_2.png" src="https://community.nxp.com/t5/image/serverpage/image-id/89615i401189589468C342/image-size/large?v=v2&amp;amp;px=999" title="pastedImage_2.png" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tested by my side, working on the&amp;nbsp;driver_examples_dspi_interrupt_b2b_transfer_slave from the SDK.&lt;/P&gt;&lt;P&gt;I am sending just one byte as you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="background-color: #ffffff; color: #51626f; "&gt;Yes. It is on purpose. I want to chain 2 transfers into the same "CS Low" if I can say.&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;You are trying, in this case, to send 0xAA and 0xBB, aren't you?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am following your implementation and using the SPI included in the SDK.&lt;/P&gt;&lt;P&gt;I commented on the Stop Transfer and Flush Fifo, the&amp;nbsp;DSPI_SlaveTransferNonBlocking is implementing these 2 functions.&lt;/P&gt;&lt;PRE class="" style="color: #000000; background: #f5f2f0; margin: 0.5em 0px; padding: 1em 1em 1em 3.8em;"&gt;    uint8_t a&lt;SPAN class="" style="color: #999999;"&gt;[&lt;/SPAN&gt;&lt;SPAN class="" style="color: #990000;"&gt;2&lt;/SPAN&gt;&lt;SPAN class="" style="color: #999999;"&gt;]&lt;/SPAN&gt; &lt;SPAN class="" style="color: #a67f59; background: rgba(255, 255, 255, 0.5);"&gt;=&lt;/SPAN&gt; &lt;SPAN class="" style="color: #999999;"&gt;{&lt;/SPAN&gt;&lt;SPAN class="" style="color: #990000;"&gt;0xAA&lt;/SPAN&gt;&lt;SPAN class="" style="color: #999999;"&gt;,&lt;/SPAN&gt;&lt;SPAN class="" style="color: #990000;"&gt;0xBB&lt;/SPAN&gt;&lt;SPAN class="" style="color: #999999;"&gt;}&lt;/SPAN&gt;&lt;SPAN class="" style="color: #999999;"&gt;;&lt;/SPAN&gt;
    uint8_t b &lt;SPAN class="" style="color: #a67f59; background: rgba(255, 255, 255, 0.5);"&gt;=&lt;/SPAN&gt; &lt;SPAN class="" style="color: #990000;"&gt;0x01&lt;/SPAN&gt;&lt;SPAN class="" style="color: #999999;"&gt;;&lt;/SPAN&gt;

    &lt;SPAN class="" style="color: slategray;"&gt;//DSPI_StopTransfer(SPI1);&lt;/SPAN&gt;
    &lt;SPAN class="" style="color: slategray;"&gt;//DSPI_FlushFifo(SPI1, true, true);&lt;/SPAN&gt;

    &lt;SPAN class="" style="color: #0077aa;"&gt;while&lt;/SPAN&gt; &lt;SPAN class="" style="color: #999999;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="" style="color: #990000;"&gt;1&lt;/SPAN&gt;&lt;SPAN class="" style="color: #999999;"&gt;)&lt;/SPAN&gt;
    &lt;SPAN class="" style="color: #999999;"&gt;{&lt;/SPAN&gt;
        &lt;SPAN class="" style="color: #d74444;"&gt;PRINTF&lt;/SPAN&gt;&lt;SPAN class="" style="color: #999999;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="" style="color: #669900;"&gt;"\r\n Slave example is running...\r\n"&lt;/SPAN&gt;&lt;SPAN class="" style="color: #999999;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #999999;"&gt;;&lt;/SPAN&gt;

        &lt;SPAN class="" style="color: slategray;"&gt;/* Reset the receive buffer */&lt;/SPAN&gt;
        &lt;SPAN class="" style="color: #0077aa;"&gt;for&lt;/SPAN&gt; &lt;SPAN class="" style="color: #999999;"&gt;(&lt;/SPAN&gt;i &lt;SPAN class="" style="color: #a67f59; background: rgba(255, 255, 255, 0.5);"&gt;=&lt;/SPAN&gt; &lt;SPAN class="" style="color: #990000;"&gt;0&lt;/SPAN&gt;&lt;SPAN class="" style="color: #999999;"&gt;;&lt;/SPAN&gt; i &lt;SPAN class="" style="color: #a67f59; background: rgba(255, 255, 255, 0.5);"&gt;&amp;lt;&lt;/SPAN&gt; TRANSFER_SIZE&lt;SPAN class="" style="color: #999999;"&gt;;&lt;/SPAN&gt; i&lt;SPAN class="" style="color: #a67f59; background: rgba(255, 255, 255, 0.5);"&gt;++&lt;/SPAN&gt;&lt;SPAN class="" style="color: #999999;"&gt;)&lt;/SPAN&gt;
        &lt;SPAN class="" style="color: #999999;"&gt;{&lt;/SPAN&gt;
            slaveRxData&lt;SPAN class="" style="color: #999999;"&gt;[&lt;/SPAN&gt;i&lt;SPAN class="" style="color: #999999;"&gt;]&lt;/SPAN&gt; &lt;SPAN class="" style="color: #a67f59; background: rgba(255, 255, 255, 0.5);"&gt;=&lt;/SPAN&gt; &lt;SPAN class="" style="color: #990000;"&gt;0U&lt;/SPAN&gt;&lt;SPAN class="" style="color: #999999;"&gt;;&lt;/SPAN&gt;
        &lt;SPAN class="" style="color: #999999;"&gt;}&lt;/SPAN&gt;

        &lt;SPAN class="" style="color: slategray;"&gt;/* Set slave transfer ready to receive data */&lt;/SPAN&gt;
        isTransferCompleted &lt;SPAN class="" style="color: #a67f59; background: rgba(255, 255, 255, 0.5);"&gt;=&lt;/SPAN&gt; false&lt;SPAN class="" style="color: #999999;"&gt;;&lt;/SPAN&gt;
        slaveXfer&lt;SPAN class="" style="color: #999999;"&gt;.&lt;/SPAN&gt;txData &lt;SPAN class="" style="color: #a67f59; background: rgba(255, 255, 255, 0.5);"&gt;=&lt;/SPAN&gt; a&lt;SPAN class="" style="color: #999999;"&gt;;&lt;/SPAN&gt;&lt;SPAN class="" style="color: slategray;"&gt;//NULL;&lt;/SPAN&gt;
        slaveXfer&lt;SPAN class="" style="color: #999999;"&gt;.&lt;/SPAN&gt;rxData &lt;SPAN class="" style="color: #a67f59; background: rgba(255, 255, 255, 0.5);"&gt;=&lt;/SPAN&gt; NULL&lt;SPAN class="" style="color: #999999;"&gt;;&lt;/SPAN&gt;&lt;SPAN class="" style="color: slategray;"&gt;//slaveRxData;&lt;/SPAN&gt;
        slaveXfer&lt;SPAN class="" style="color: #999999;"&gt;.&lt;/SPAN&gt;dataSize &lt;SPAN class="" style="color: #a67f59; background: rgba(255, 255, 255, 0.5);"&gt;=&lt;/SPAN&gt; TRANSFER_SIZE&lt;SPAN class="" style="color: #999999;"&gt;;&lt;/SPAN&gt;
        slaveXfer&lt;SPAN class="" style="color: #999999;"&gt;.&lt;/SPAN&gt;configFlags &lt;SPAN class="" style="color: #a67f59; background: rgba(255, 255, 255, 0.5);"&gt;=&lt;/SPAN&gt; kDSPI_SlaveCtar0&lt;SPAN class="" style="color: #999999;"&gt;;&lt;/SPAN&gt;

        &lt;SPAN class="" style="color: slategray;"&gt;/* Slave start receive */&lt;/SPAN&gt;
        &lt;SPAN class="" style="color: #d74444;"&gt;DSPI_SlaveTransferNonBlocking&lt;/SPAN&gt;&lt;SPAN class="" style="color: #999999;"&gt;(&lt;/SPAN&gt;EXAMPLE_DSPI_SLAVE_BASEADDR&lt;SPAN class="" style="color: #999999;"&gt;,&lt;/SPAN&gt; &lt;SPAN class="" style="color: #a67f59; background: rgba(255, 255, 255, 0.5);"&gt;&amp;amp;&lt;/SPAN&gt;g_s_handle&lt;SPAN class="" style="color: #999999;"&gt;,&lt;/SPAN&gt; &lt;SPAN class="" style="color: #a67f59; background: rgba(255, 255, 255, 0.5);"&gt;&amp;amp;&lt;/SPAN&gt;slaveXfer&lt;SPAN class="" style="color: #999999;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #999999;"&gt;;&lt;/SPAN&gt;

        &lt;SPAN class="" style="color: #0077aa;"&gt;while&lt;/SPAN&gt; &lt;SPAN class="" style="color: #999999;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="" style="color: #a67f59; background: rgba(255, 255, 255, 0.5);"&gt;!&lt;/SPAN&gt;isTransferCompleted&lt;SPAN class="" style="color: #999999;"&gt;)&lt;/SPAN&gt;
        &lt;SPAN class="" style="color: #999999;"&gt;{&lt;/SPAN&gt;
        &lt;SPAN class="" style="color: #999999;"&gt;}&lt;/SPAN&gt;

        &lt;SPAN class="" style="color: slategray;"&gt;/* Set slave transfer ready to send back data */&lt;/SPAN&gt;
        isTransferCompleted &lt;SPAN class="" style="color: #a67f59; background: rgba(255, 255, 255, 0.5);"&gt;=&lt;/SPAN&gt; false&lt;SPAN class="" style="color: #999999;"&gt;;&lt;/SPAN&gt;
        slaveXfer&lt;SPAN class="" style="color: #999999;"&gt;.&lt;/SPAN&gt;txData &lt;SPAN class="" style="color: #a67f59; background: rgba(255, 255, 255, 0.5);"&gt;=&lt;/SPAN&gt; &lt;SPAN class="" style="color: #a67f59; background: rgba(255, 255, 255, 0.5);"&gt;&amp;amp;&lt;/SPAN&gt;b&lt;SPAN class="" style="color: #999999;"&gt;;&lt;/SPAN&gt;&lt;SPAN class="" style="color: slategray;"&gt;//slaveRxData;&lt;/SPAN&gt;
        slaveXfer&lt;SPAN class="" style="color: #999999;"&gt;.&lt;/SPAN&gt;rxData &lt;SPAN class="" style="color: #a67f59; background: rgba(255, 255, 255, 0.5);"&gt;=&lt;/SPAN&gt; NULL&lt;SPAN class="" style="color: #999999;"&gt;;&lt;/SPAN&gt;
        slaveXfer&lt;SPAN class="" style="color: #999999;"&gt;.&lt;/SPAN&gt;dataSize &lt;SPAN class="" style="color: #a67f59; background: rgba(255, 255, 255, 0.5);"&gt;=&lt;/SPAN&gt; TRANSFER_SIZE&lt;SPAN class="" style="color: #999999;"&gt;;&lt;/SPAN&gt;
        slaveXfer&lt;SPAN class="" style="color: #999999;"&gt;.&lt;/SPAN&gt;configFlags &lt;SPAN class="" style="color: #a67f59; background: rgba(255, 255, 255, 0.5);"&gt;=&lt;/SPAN&gt; kDSPI_SlaveCtar0&lt;SPAN class="" style="color: #999999;"&gt;;&lt;/SPAN&gt;

        &lt;SPAN class="" style="color: slategray;"&gt;/* Slave start send */&lt;/SPAN&gt;
        &lt;SPAN class="" style="color: #d74444;"&gt;DSPI_SlaveTransferNonBlocking&lt;/SPAN&gt;&lt;SPAN class="" style="color: #999999;"&gt;(&lt;/SPAN&gt;EXAMPLE_DSPI_SLAVE_BASEADDR&lt;SPAN class="" style="color: #999999;"&gt;,&lt;/SPAN&gt; &lt;SPAN class="" style="color: #a67f59; background: rgba(255, 255, 255, 0.5);"&gt;&amp;amp;&lt;/SPAN&gt;g_s_handle&lt;SPAN class="" style="color: #999999;"&gt;,&lt;/SPAN&gt; &lt;SPAN class="" style="color: #a67f59; background: rgba(255, 255, 255, 0.5);"&gt;&amp;amp;&lt;/SPAN&gt;slaveXfer&lt;SPAN class="" style="color: #999999;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #999999;"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="" style="border-right: 1px solid #999999; padding-top: 1em;"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P style="top: 630px;"&gt;&lt;/P&gt;&lt;P style="top: 630px;"&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;IMG alt="pastedImage_1.png" src="https://community.nxp.com/t5/image/serverpage/image-id/90778i53FB15453D3A4EF9/image-size/large?v=v2&amp;amp;px=999" title="pastedImage_1.png" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="top: 630px;"&gt;&lt;/P&gt;&lt;P&gt;Why the next transfer doesn't&amp;nbsp;erase the buffer?&lt;/P&gt;&lt;P&gt;Sorry for this misunderstanding, this implementation is already done in the code. The driver is erasing the buffer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I checked the main file that you provided.&lt;/P&gt;&lt;P&gt;Is it possible that you could provide some screen of the issue?&lt;/P&gt;&lt;P&gt;What is the reason that you are toggling the PTC17?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mario&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Nov 2020 14:35:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KW36-SPI-troubles-with-TX-FIFO-bit-shifting/m-p/1021654#M56274</guid>
      <dc:creator>mario_castaneda</dc:creator>
      <dc:date>2020-11-02T14:35:28Z</dc:date>
    </item>
    <item>
      <title>Re: KW36 - SPI - troubles with TX FIFO &amp; bit shifting</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KW36-SPI-troubles-with-TX-FIFO-bit-shifting/m-p/1021655#M56275</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mario,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry I should have started by some screens.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is my problem rephrased:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't get the CS influence when I'm chaining 3 transfers of a given size (1 in this case). With the same code on the slave side (cf. the file provided with the first post), I get two different results, whether or not I raised the CS between the transfer.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;With &lt;/STRONG&gt;CS lowered and raised between transfer:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/91834i60B640A45A03BF22/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;Without&lt;/STRONG&gt; CS lowered and raised between transfer :&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_2.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/91921i50A9125A9AF5D899/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_2.png" alt="pastedImage_2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PTC17 is raised for timing purpose, It helps me to see when I'm in the interruption after the transfer (Channel 4 on the screens).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you can see when the transfer is finished, the interruption is triggered with and without the CS. In one case (without CS) I got 0xAA then 0xBB the 0xCC and in the other, a "delay" is created.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope it will help you understand my issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Loïc&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Nov 2019 08:08:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KW36-SPI-troubles-with-TX-FIFO-bit-shifting/m-p/1021655#M56275</guid>
      <dc:creator>loic_guillaume_</dc:creator>
      <dc:date>2019-11-13T08:08:54Z</dc:date>
    </item>
    <item>
      <title>Re: KW36 - SPI - troubles with TX FIFO &amp; bit shifting</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KW36-SPI-troubles-with-TX-FIFO-bit-shifting/m-p/1021656#M56276</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Loic,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please see the image below, the CS is going up after the end of the transmission. I am using 2 KW36 boards.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_2.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/92322iD722DBEA501E2FE0/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_2.png" alt="pastedImage_2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="background-color: #ffffff; color: #51626f; "&gt;As you can see when the transfer is finished, the interruption is triggered with and without the CS. In one case (without CS) I got 0xAA then 0xBB the 0xCC and in the other, a "delay" is created.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This time delay is creating by your master application. I am not sure why the CS is taking a lot of time to returns to the high value. Please see the next image.&lt;/P&gt;&lt;P&gt;The timing marker pair is showing the time form the last falling edge of the CLK to the rising of the CS. The time is 2us, after that, the KW36 takes 11us to toggle the PIN(following the same process that you did.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_5.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/92368iF68AAD7AEDFBB862/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_5.png" alt="pastedImage_5.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The KW36 is waiting for the CS rising edge, but as the Master application is taking some time, the slave enters in another process. If you look at each to toggle pin, the "delay" is increasing, this is because the CS takes more time to change the status&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mario&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Nov 2019 22:05:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KW36-SPI-troubles-with-TX-FIFO-bit-shifting/m-p/1021656#M56276</guid>
      <dc:creator>mario_castaneda</dc:creator>
      <dc:date>2019-11-13T22:05:31Z</dc:date>
    </item>
  </channel>
</rss>

