<?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 SPIMaster_Ldd    Slave select  Issue in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/SPIMaster-Ldd-Slave-select-Issue/m-p/809991#M49229</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In a project based on KEAZ128 , the PE&amp;nbsp; component&amp;nbsp; "SPIMaster_Ldd"&amp;nbsp; was used .&amp;nbsp;&lt;/P&gt;&lt;P&gt;The&amp;nbsp; slave select signals were configured as GPIO . But the CS output is wrong&amp;nbsp; as shown in the following picture:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SPI CLOCK=500KHz&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="keaz128_spi0_SPIMaster_LDD.JPG"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/73351i759A94B6D3CDFC2E/image-size/large?v=v2&amp;amp;px=999" role="button" title="keaz128_spi0_SPIMaster_LDD.JPG" alt="keaz128_spi0_SPIMaster_LDD.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The IDE:&amp;nbsp;&lt;/P&gt;&lt;P&gt;- CodeWarrior for MCU&lt;BR /&gt; Version: 10.7&lt;BR /&gt; Build Id:160721&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;The spi write code :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#define SPI0_SLAVE_CS_CTRL (UI_PTE-&amp;gt;PDOR)&lt;/P&gt;&lt;P&gt;#define SPI0_SLAVE_CS_ALL 0x00000038&lt;BR /&gt;#define SPI0_SLAVE_CS_MASK 0x00000008&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void spi0_write(uint8_t spi_slave_id,uint8_t data)&lt;BR /&gt;{ &lt;BR /&gt;&amp;nbsp; &amp;nbsp; SPI0_SLAVE_CS_CTRL |= SPI0_SLAVE_CS_ALL; // all cs bit set to 1&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; SPI0_SLAVE_CS_CTRL &amp;amp;= ~(SPI0_SLAVE_CS_MASK &amp;lt;&amp;lt; spi_slave_id); //active the slave&lt;BR /&gt; &lt;BR /&gt;&amp;nbsp; &amp;nbsp; (void)SM1_SendBlock(SM1_DeviceData, &amp;amp;data, sizeof(data));&lt;BR /&gt;&amp;nbsp; &amp;nbsp; while(! SM1_GetBlockSentStatus(SM1_DeviceData)){}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; SPI0_SLAVE_CS_CTRL |= SPI0_SLAVE_CS_ALL; // all cs bit set to 1 &lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why the CS single&amp;nbsp; &amp;nbsp;goes HIGH before the clock?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;**************************************************************************************************************&lt;/P&gt;&lt;P&gt;I tried different setting:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;SPI CLOCK=250KHz&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="keaz128_spi0_SPIMaster_LDD_250KHz.JPG"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/73360i665FEC4F8740FB1F/image-size/large?v=v2&amp;amp;px=999" role="button" title="keaz128_spi0_SPIMaster_LDD_250KHz.JPG" alt="keaz128_spi0_SPIMaster_LDD_250KHz.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;SPI CLOCK=&lt;/SPAN&gt;&lt;SPAN&gt;1M&lt;/SPAN&gt;&lt;SPAN&gt;Hz&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="keaz128_spi0_SPIMaster_LDD_1MHz.JPG"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/73362iD87940D65BA283B2/image-size/large?v=v2&amp;amp;px=999" role="button" title="keaz128_spi0_SPIMaster_LDD_1MHz.JPG" alt="keaz128_spi0_SPIMaster_LDD_1MHz.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SO,&amp;nbsp; the function "&lt;SPAN&gt;SM1_GetBlockSentStatus"&amp;nbsp; DO NOT work!&amp;nbsp; &amp;nbsp; A bug?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Need dig into the&amp;nbsp;SPIMaster_Ldd code to check how the function to work.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 02 Aug 2018 08:18:22 GMT</pubDate>
    <dc:creator>kigerzhang</dc:creator>
    <dc:date>2018-08-02T08:18:22Z</dc:date>
    <item>
      <title>SPIMaster_Ldd    Slave select  Issue</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/SPIMaster-Ldd-Slave-select-Issue/m-p/809991#M49229</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In a project based on KEAZ128 , the PE&amp;nbsp; component&amp;nbsp; "SPIMaster_Ldd"&amp;nbsp; was used .&amp;nbsp;&lt;/P&gt;&lt;P&gt;The&amp;nbsp; slave select signals were configured as GPIO . But the CS output is wrong&amp;nbsp; as shown in the following picture:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SPI CLOCK=500KHz&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="keaz128_spi0_SPIMaster_LDD.JPG"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/73351i759A94B6D3CDFC2E/image-size/large?v=v2&amp;amp;px=999" role="button" title="keaz128_spi0_SPIMaster_LDD.JPG" alt="keaz128_spi0_SPIMaster_LDD.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The IDE:&amp;nbsp;&lt;/P&gt;&lt;P&gt;- CodeWarrior for MCU&lt;BR /&gt; Version: 10.7&lt;BR /&gt; Build Id:160721&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;The spi write code :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#define SPI0_SLAVE_CS_CTRL (UI_PTE-&amp;gt;PDOR)&lt;/P&gt;&lt;P&gt;#define SPI0_SLAVE_CS_ALL 0x00000038&lt;BR /&gt;#define SPI0_SLAVE_CS_MASK 0x00000008&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void spi0_write(uint8_t spi_slave_id,uint8_t data)&lt;BR /&gt;{ &lt;BR /&gt;&amp;nbsp; &amp;nbsp; SPI0_SLAVE_CS_CTRL |= SPI0_SLAVE_CS_ALL; // all cs bit set to 1&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; SPI0_SLAVE_CS_CTRL &amp;amp;= ~(SPI0_SLAVE_CS_MASK &amp;lt;&amp;lt; spi_slave_id); //active the slave&lt;BR /&gt; &lt;BR /&gt;&amp;nbsp; &amp;nbsp; (void)SM1_SendBlock(SM1_DeviceData, &amp;amp;data, sizeof(data));&lt;BR /&gt;&amp;nbsp; &amp;nbsp; while(! SM1_GetBlockSentStatus(SM1_DeviceData)){}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; SPI0_SLAVE_CS_CTRL |= SPI0_SLAVE_CS_ALL; // all cs bit set to 1 &lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why the CS single&amp;nbsp; &amp;nbsp;goes HIGH before the clock?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;**************************************************************************************************************&lt;/P&gt;&lt;P&gt;I tried different setting:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;SPI CLOCK=250KHz&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="keaz128_spi0_SPIMaster_LDD_250KHz.JPG"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/73360i665FEC4F8740FB1F/image-size/large?v=v2&amp;amp;px=999" role="button" title="keaz128_spi0_SPIMaster_LDD_250KHz.JPG" alt="keaz128_spi0_SPIMaster_LDD_250KHz.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;SPI CLOCK=&lt;/SPAN&gt;&lt;SPAN&gt;1M&lt;/SPAN&gt;&lt;SPAN&gt;Hz&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="keaz128_spi0_SPIMaster_LDD_1MHz.JPG"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/73362iD87940D65BA283B2/image-size/large?v=v2&amp;amp;px=999" role="button" title="keaz128_spi0_SPIMaster_LDD_1MHz.JPG" alt="keaz128_spi0_SPIMaster_LDD_1MHz.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SO,&amp;nbsp; the function "&lt;SPAN&gt;SM1_GetBlockSentStatus"&amp;nbsp; DO NOT work!&amp;nbsp; &amp;nbsp; A bug?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Need dig into the&amp;nbsp;SPIMaster_Ldd code to check how the function to work.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Aug 2018 08:18:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/SPIMaster-Ldd-Slave-select-Issue/m-p/809991#M49229</guid>
      <dc:creator>kigerzhang</dc:creator>
      <dc:date>2018-08-02T08:18:22Z</dc:date>
    </item>
    <item>
      <title>Re: SPIMaster_Ldd    Slave select  Issue</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/SPIMaster-Ldd-Slave-select-Issue/m-p/809992#M49230</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;kiger Zhang,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry for my late reply!&lt;/P&gt;&lt;P&gt;Please refer the answer in &lt;A _jive_internal="true" href="https://community.nxp.com/thread/391318"&gt;Trouble using SPI GetBlockSentStatus()&lt;/A&gt;:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; font-size: 15px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;"&gt;It actually set the SerFlag when you push all the bytes in the TxFIFO and it doesn´t wait for the data to be shifted&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Robin&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Aug 2018 09:21:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/SPIMaster-Ldd-Slave-select-Issue/m-p/809992#M49230</guid>
      <dc:creator>Robin_Shen</dc:creator>
      <dc:date>2018-08-06T09:21:49Z</dc:date>
    </item>
    <item>
      <title>Re: SPIMaster_Ldd    Slave select  Issue</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/SPIMaster-Ldd-Slave-select-Issue/m-p/809993#M49231</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Robin,&lt;/P&gt;&lt;P&gt;Thanks for your reply.&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I check the datasheet and the SPI PDD code ,it seems that the&amp;nbsp; SPI module in KEAZ128 device&amp;nbsp; does NOT have a "EOQ" bit.&amp;nbsp; &amp;nbsp;So the solution for K64 does not work for Keaz128.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any more suggestion?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Aug 2018 15:04:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/SPIMaster-Ldd-Slave-select-Issue/m-p/809993#M49231</guid>
      <dc:creator>kigerzhang</dc:creator>
      <dc:date>2018-08-06T15:04:55Z</dc:date>
    </item>
    <item>
      <title>Re: SPIMaster_Ldd    Slave select  Issue</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/SPIMaster-Ldd-Slave-select-Issue/m-p/809994#M49232</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes. The SPI module of KEAZ128 does NOT have a "EOQ" bit.&lt;BR /&gt;Due to lack of EOQ flag, you may need to refer the Solution described in &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-100784"&gt;L-Series SPI GPIO CS/SS&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Robin&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Aug 2018 07:28:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/SPIMaster-Ldd-Slave-select-Issue/m-p/809994#M49232</guid>
      <dc:creator>Robin_Shen</dc:creator>
      <dc:date>2018-08-08T07:28:55Z</dc:date>
    </item>
    <item>
      <title>Re: SPIMaster_Ldd    Slave select  Issue</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/SPIMaster-Ldd-Slave-select-Issue/m-p/809995#M49233</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Robin,&lt;/P&gt;&lt;P&gt;Thank you so much for your support.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I checked the document&amp;nbsp; (&amp;nbsp; &lt;A _jive_internal="true" data-containerid="2019" data-containertype="14" data-content-finding="Community" data-objectid="100784" data-objecttype="102" href="https://community.nxp.com/docs/DOC-100784" style="color: #3d9ce7; background-color: #ffffff; border: 0px; padding: 1px 0px 1px calc(12px + 0.35ex);"&gt;L-Series SPI GPIO CS/SS&lt;/A&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;.)&lt;/SPAN&gt;&amp;nbsp;that you pointed to .&amp;nbsp;&lt;/P&gt;&lt;P&gt;The key point in that document is to check the&amp;nbsp;&amp;nbsp;SPTEF&amp;nbsp; flag .&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I&amp;nbsp; digged into the function "&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;SM1_GetBlockSentStatus"&amp;nbsp; of&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;SPIMaster_Ldd ,it does&amp;nbsp; the same thing.&amp;nbsp;&lt;/P&gt;&lt;P&gt;***************************************&lt;/P&gt;&lt;P&gt;&lt;EM&gt;In file SPI_PDD.h&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;#define SPI_PDD_TX_BUFFER_EMPTYG SPI_S_SPTEF_MASK&lt;/STRONG&gt; /**&amp;lt; Transmit buffer or FIFO empty flag. */&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;In file SM1.C&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;uint8_t StatReg = SPI_PDD_ReadStatusReg(SPI0_BASE_PTR);&lt;/STRONG&gt; /* Read status register */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if ((&lt;STRONG&gt;StatReg&lt;/STRONG&gt; &amp;amp; &lt;STRONG&gt;SPI_PDD_TX_BUFFER_EMPTYG&lt;/STRONG&gt;) != 0U) { /* Is HW Tx buffer empty? */&lt;BR /&gt; if (DeviceDataPrv-&amp;gt;OutSentDataNum &amp;lt; DeviceDataPrv-&amp;gt;OutDataNumReq) { /* Is number of sent characters less than the number of requested incoming characters? */&lt;BR /&gt; SPI_PDD_WriteData8Bit(SPI0_BASE_PTR, (*((uint8_t *)DeviceDataPrv-&amp;gt;OutDataPtr++))); /* Put a character with command to the transmit register and increment pointer to the transmitt buffer */&lt;BR /&gt; DeviceDataPrv-&amp;gt;OutSentDataNum++; /* Increment the counter of sent characters. */&lt;BR /&gt; if (DeviceDataPrv-&amp;gt;OutSentDataNum == DeviceDataPrv-&amp;gt;OutDataNumReq) {&lt;BR /&gt; DeviceDataPrv-&amp;gt;OutDataNumReq = 0x00U; /* Clear the counter of characters to be send by SendBlock() */&lt;BR /&gt; &lt;STRONG&gt;DeviceDataPrv-&amp;gt;SerFlag |= BLOCK_SENT;&lt;/STRONG&gt; /* Set data block sent flag */&lt;BR /&gt; SM1_OnBlockSent(DeviceDataPrv-&amp;gt;UserData);&lt;BR /&gt; }&lt;BR /&gt; } else {&lt;BR /&gt; SPI_PDD_DisableInterruptMask(SPI0_BASE_PTR, SPI_PDD_TX_BUFFER_EMPTY); /* Disable TX interrupt */&lt;BR /&gt; }&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;********************************************&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;In fact the root cause is : the data in the TX buffer is moved to shift register so fast , but the data in the shift register should be sent out to the pin based on the&amp;nbsp; SCK .&amp;nbsp;&lt;/STRONG&gt; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;In page 534 of KEA128RM , the STPEF&amp;nbsp; description:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;" ...&lt;/P&gt;&lt;P&gt;SPTEF is automatically set when all data from the transmit buffer transfers into the transmit shift register. For an idle&amp;nbsp;&amp;nbsp;SPI, data written to D is transferred to the shifter almost immediately&lt;STRONG&gt; so that SPTEF is set within two bus&amp;nbsp;cycles&lt;/STRONG&gt;, allowing a second set of data to be queued into the transmit buffer. After completion of the transfer&lt;BR /&gt;of the data in the shift register, the queued data from the transmit buffer automatically moves to the shifter,&lt;BR /&gt;and SPTEF is set to indicate that room exists for new data in the transmit buffer. ..."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So ,what I want to know is : &lt;STRONG&gt;whether is there a flat to indicate that the&amp;nbsp;&lt;/STRONG&gt;&lt;SPAN&gt;&lt;STRONG&gt;shift register&amp;nbsp;is sent out done&lt;/STRONG&gt;, at that time the CS pin can be toggled.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Aug 2018 09:01:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/SPIMaster-Ldd-Slave-select-Issue/m-p/809995#M49233</guid>
      <dc:creator>kigerzhang</dc:creator>
      <dc:date>2018-08-09T09:01:22Z</dc:date>
    </item>
    <item>
      <title>Re: SPIMaster_Ldd    Slave select  Issue</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/SPIMaster-Ldd-Slave-select-Issue/m-p/809996#M49234</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The key point in that document is to check the SPRF flag.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="The Solution.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/63003i55C6CE1B09B3295D/image-size/large?v=v2&amp;amp;px=999" role="button" title="The Solution.png" alt="The Solution.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="SPI_send.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/63049i307A7DAA0198EBDE/image-size/large?v=v2&amp;amp;px=999" role="button" title="SPI_send.png" alt="SPI_send.png" /&gt;&lt;/span&gt;&lt;BR /&gt;Only this flat is able to indicate the shift register is received in(sent out) done.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="SPI0_S[SPRF].png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/63099i86D4AF27FC1FBECD/image-size/large?v=v2&amp;amp;px=999" role="button" title="SPI0_S[SPRF].png" alt="SPI0_S[SPRF].png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Robin&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Aug 2018 02:53:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/SPIMaster-Ldd-Slave-select-Issue/m-p/809996#M49234</guid>
      <dc:creator>Robin_Shen</dc:creator>
      <dc:date>2018-08-10T02:53:09Z</dc:date>
    </item>
    <item>
      <title>Re: SPIMaster_Ldd    Slave select  Issue</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/SPIMaster-Ldd-Slave-select-Issue/m-p/809997#M49235</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Robin,&lt;/P&gt;&lt;P&gt;Got it !&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Aug 2018 04:21:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/SPIMaster-Ldd-Slave-select-Issue/m-p/809997#M49235</guid>
      <dc:creator>kigerzhang</dc:creator>
      <dc:date>2018-08-10T04:21:43Z</dc:date>
    </item>
  </channel>
</rss>

