<?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: SPI interface error of MKL34Z64VLL4 in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/SPI-interface-error-of-MKL34Z64VLL4/m-p/640253#M38765</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I had tested with FRDM-KL43Z board with SPI1 and FIFO mode enabled.&lt;/P&gt;&lt;P&gt;The KL34 SPI supports up to 8-byte-deep FIFO, so customer could call SPI_WriteData() to transmit data up to 8 times.&lt;/P&gt;&lt;P&gt;While, after customer call SPI_WriteData()&amp;nbsp; function, it need to polling the SPIx_S[SPTEF] bit to make sure the SPI transmit Buffer(FIFO) empty.&lt;/P&gt;&lt;P&gt;When the SPI FIFO enabled, I could call below code to send 8 bytes out:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SPI_WriteData(SPI1, 0x18);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SPI_WriteData(SPI1, 0x28);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SPI_WriteData(SPI1, 0x38);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SPI_WriteData(SPI1, 0x48);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SPI_WriteData(SPI1, 0x58);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SPI_WriteData(SPI1, 0x68);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SPI_WriteData(SPI1, 0x78);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SPI_WriteData(SPI1, 0x88);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; while(!(SPI1-&amp;gt;S &amp;amp;&amp;nbsp; SPI_S_SPTEF_MASK))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&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/17153i0B3E21E8123DF790/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;I attached my test code for your reference.&lt;/P&gt;&lt;P&gt;When the SPI FIFO enabled, there doesn't need add delay() function between SPI_WriteData() function.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Wish it helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a great day,&lt;BR /&gt;Ma Hui&lt;BR /&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, 20 Mar 2017 06:24:09 GMT</pubDate>
    <dc:creator>Hui_Ma</dc:creator>
    <dc:date>2017-03-20T06:24:09Z</dc:date>
    <item>
      <title>SPI interface error of MKL34Z64VLL4</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/SPI-interface-error-of-MKL34Z64VLL4/m-p/640250#M38762</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tested spi interface with maxim device from&amp;nbsp;MKL34Z64.&lt;/P&gt;&lt;P&gt;But I can't understand this issue.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="179002_179002.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/122946i8240C8C659B22332/image-size/large?v=v2&amp;amp;px=999" role="button" title="179002_179002.png" alt="179002_179002.png" /&gt;&lt;/span&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/15850i70CA4AE66DA54BDA/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;Why that is only six clock of SCK?&lt;/P&gt;&lt;P&gt;Also, I send each 3&amp;nbsp;bytes, but only the same value is output continuously.&lt;/P&gt;&lt;P&gt;I use driver of fsl_spi.c (SPI_WriteData)&lt;/P&gt;&lt;P&gt;I attached project file.&lt;/P&gt;&lt;P&gt;Would you please let me know why occurred like this situation?&lt;/P&gt;&lt;P&gt;I must need to solve this problem.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-337634"&gt;WIZIT_Flowmeter.zip&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Mar 2017 06:10:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/SPI-interface-error-of-MKL34Z64VLL4/m-p/640250#M38762</guid>
      <dc:creator>jtpark</dc:creator>
      <dc:date>2017-03-10T06:10:50Z</dc:date>
    </item>
    <item>
      <title>Re: SPI interface error of MKL34Z64VLL4</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/SPI-interface-error-of-MKL34Z64VLL4/m-p/640251#M38763</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I checked your code, below code should be incorrect:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SPI_WriteData(SPI1, (char)0x38);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;SPI_WriteData(SPI1, (char)0x13);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;SPI_WriteData(SPI1, (char)0x11);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There should wait previous SPI_WriteData() finished before call the next&amp;nbsp; SPI_WriteData().&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please refer KSDK provided SPI example code, there call the SPI_WriteData() function in interrupt service routine:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void SPI_MASTER_IRQHandler(void)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;if (SPI_GetStatusFlags(EXAMPLE_SPI_MASTER) &amp;amp; kSPI_TxBufferEmptyFlag)&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #ff6600;"&gt;SPI_WriteData(EXAMPLE_SPI_MASTER, (uint16_t)(srcBuff[BUFFER_SIZE - masterIndex]));&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; masterIndex--;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (masterIndex == 0U)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; masterFinished = true;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SPI_DisableInterrupts(EXAMPLE_SPI_MASTER, kSPI_TxEmptyInterruptEnable);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The SPI interrupt example could be found in below found:&lt;/P&gt;&lt;P&gt;..\SDK_2.0_FRDM-KL43Z\boards\frdmkl43z\driver_examples\spi\interrupt&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Wish it helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a great day,&lt;BR /&gt;Ma Hui&lt;BR /&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>Tue, 14 Mar 2017 07:07:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/SPI-interface-error-of-MKL34Z64VLL4/m-p/640251#M38763</guid>
      <dc:creator>Hui_Ma</dc:creator>
      <dc:date>2017-03-14T07:07:48Z</dc:date>
    </item>
    <item>
      <title>Re: SPI interface error of MKL34Z64VLL4</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/SPI-interface-error-of-MKL34Z64VLL4/m-p/640252#M38764</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;Dear Hui_Ma,&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;Thank you for your support.&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;But I don't want to use an interrupt.&lt;BR /&gt;If i use a delay function, Is it ok?&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;SPI_WriteData(SPI1, (char)0x38);delay(10);&lt;BR /&gt;SPI_WriteData(SPI1, (char)0x13);&lt;SPAN&gt;delay(10);&lt;/SPAN&gt;&lt;BR /&gt;SPI_WriteData(SPI1, (char)0x11);&lt;SPAN&gt;delay(10);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;And I still don't understand spi waveform.(spi clk)&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;Thanks.&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;Best Regards,&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;JT Park&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Mar 2017 09:59:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/SPI-interface-error-of-MKL34Z64VLL4/m-p/640252#M38764</guid>
      <dc:creator>jtpark</dc:creator>
      <dc:date>2017-03-15T09:59:18Z</dc:date>
    </item>
    <item>
      <title>Re: SPI interface error of MKL34Z64VLL4</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/SPI-interface-error-of-MKL34Z64VLL4/m-p/640253#M38765</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I had tested with FRDM-KL43Z board with SPI1 and FIFO mode enabled.&lt;/P&gt;&lt;P&gt;The KL34 SPI supports up to 8-byte-deep FIFO, so customer could call SPI_WriteData() to transmit data up to 8 times.&lt;/P&gt;&lt;P&gt;While, after customer call SPI_WriteData()&amp;nbsp; function, it need to polling the SPIx_S[SPTEF] bit to make sure the SPI transmit Buffer(FIFO) empty.&lt;/P&gt;&lt;P&gt;When the SPI FIFO enabled, I could call below code to send 8 bytes out:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SPI_WriteData(SPI1, 0x18);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SPI_WriteData(SPI1, 0x28);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SPI_WriteData(SPI1, 0x38);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SPI_WriteData(SPI1, 0x48);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SPI_WriteData(SPI1, 0x58);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SPI_WriteData(SPI1, 0x68);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SPI_WriteData(SPI1, 0x78);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SPI_WriteData(SPI1, 0x88);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; while(!(SPI1-&amp;gt;S &amp;amp;&amp;nbsp; SPI_S_SPTEF_MASK))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&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/17153i0B3E21E8123DF790/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;I attached my test code for your reference.&lt;/P&gt;&lt;P&gt;When the SPI FIFO enabled, there doesn't need add delay() function between SPI_WriteData() function.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Wish it helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a great day,&lt;BR /&gt;Ma Hui&lt;BR /&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, 20 Mar 2017 06:24:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/SPI-interface-error-of-MKL34Z64VLL4/m-p/640253#M38765</guid>
      <dc:creator>Hui_Ma</dc:creator>
      <dc:date>2017-03-20T06:24:09Z</dc:date>
    </item>
    <item>
      <title>Re: SPI interface error of MKL34Z64VLL4</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/SPI-interface-error-of-MKL34Z64VLL4/m-p/640254#M38766</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Hui_Ma,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your reply.&lt;/P&gt;&lt;P&gt;I solved it.(I used SPI_WriteBlocking fuction.)&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;&lt;BR /&gt; srcBuff[0] = 0x38;&lt;BR /&gt; srcBuff[1] = 0x13;&lt;BR /&gt; srcBuff[2] = 0x11;&lt;BR /&gt; &lt;BR /&gt; SPI_WriteBlocking( SPI1, srcBuff, 3 );&lt;BR /&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I tested read function of SPI interface but it didn't work.&lt;/P&gt;&lt;P&gt;I used SPI_ReadData function of fsl_spi.c.&lt;/P&gt;&lt;P&gt;Would you please provide to me example code of read function?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Mar 2017 07:01:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/SPI-interface-error-of-MKL34Z64VLL4/m-p/640254#M38766</guid>
      <dc:creator>jtpark</dc:creator>
      <dc:date>2017-03-20T07:01:27Z</dc:date>
    </item>
    <item>
      <title>Re: SPI interface error of MKL34Z64VLL4</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/SPI-interface-error-of-MKL34Z64VLL4/m-p/640255#M38767</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the SPI communication is TX/RX synchronize, when you need read SPI data, the SPI master need to transmit the dummy data at first. After that,then call SPI_ReadData() function to read received data.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Wish it helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a great day,&lt;BR /&gt;Ma Hui&lt;BR /&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>Thu, 23 Mar 2017 06:06:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/SPI-interface-error-of-MKL34Z64VLL4/m-p/640255#M38767</guid>
      <dc:creator>Hui_Ma</dc:creator>
      <dc:date>2017-03-23T06:06:19Z</dc:date>
    </item>
  </channel>
</rss>

