<?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 - Transmission complete flag? in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/SPI-Transmission-complete-flag/m-p/981682#M55488</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&amp;nbsp;manual CS line control you need to use the Rx flag and not the Tx flag. Since the output is buffered the Tx flag shows when there is room for the next tx data byte to be written, which is before the byte in the output shift register has been completely shifted out. The Rx flag indicates when a complete data byte is available which is after all bits have been clocked in.&lt;BR /&gt;The rx flag must be cleared (by reading the data register) before&amp;nbsp;the transmission starts for this to work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After you have configured the SPI interface do the following:&lt;BR /&gt;(void)SPI0_S;&lt;BR /&gt;(void)SPI0_D;&lt;/P&gt;&lt;P&gt;once to ensure that the status is correct for the start of the operation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;P&gt;(uTasker project developer for Kinetis and i.MX RT)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See the open source version on GITHUB for SPI Flash and SD card operation on KL03 SPI with manual control as reference.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 09 Jan 2020 00:41:35 GMT</pubDate>
    <dc:creator>mjbcswitzerland</dc:creator>
    <dc:date>2020-01-09T00:41:35Z</dc:date>
    <item>
      <title>SPI - Transmission complete flag?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/SPI-Transmission-complete-flag/m-p/981681#M55487</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to manually set a pin low before a SPI master transmit begins, and the set it back high afterwards.&lt;/P&gt;&lt;P&gt;The&amp;nbsp;micro&amp;nbsp;is a KL03.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At the moment, im doing the following...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;GPIO_PortClear(GPIOA, 1&amp;lt;&amp;lt;(PIN2));&lt;/P&gt;&lt;P&gt;SPI0-&amp;gt;D = data &amp;amp; 0xFFU;&lt;BR /&gt;while ((SPI0-&amp;gt;S &amp;amp; SPI_S_SPTEF_MASK) == 0) {}&lt;BR /&gt;&lt;SPAN&gt;GPIO_PortSet(GPIOA, 1&amp;lt;&amp;lt;(PIN2));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;... but im finding the SPTEF is being set high before the transmission has actually been completed.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;How can I reliably wait for the last bit to be sent, before setting that PA2 pin back to high?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks in advance.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Jan 2020 07:20:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/SPI-Transmission-complete-flag/m-p/981681#M55487</guid>
      <dc:creator>mwp_nxp</dc:creator>
      <dc:date>2020-01-08T07:20:05Z</dc:date>
    </item>
    <item>
      <title>Re: SPI - Transmission complete flag?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/SPI-Transmission-complete-flag/m-p/981682#M55488</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&amp;nbsp;manual CS line control you need to use the Rx flag and not the Tx flag. Since the output is buffered the Tx flag shows when there is room for the next tx data byte to be written, which is before the byte in the output shift register has been completely shifted out. The Rx flag indicates when a complete data byte is available which is after all bits have been clocked in.&lt;BR /&gt;The rx flag must be cleared (by reading the data register) before&amp;nbsp;the transmission starts for this to work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After you have configured the SPI interface do the following:&lt;BR /&gt;(void)SPI0_S;&lt;BR /&gt;(void)SPI0_D;&lt;/P&gt;&lt;P&gt;once to ensure that the status is correct for the start of the operation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;P&gt;(uTasker project developer for Kinetis and i.MX RT)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See the open source version on GITHUB for SPI Flash and SD card operation on KL03 SPI with manual control as reference.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jan 2020 00:41:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/SPI-Transmission-complete-flag/m-p/981682#M55488</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2020-01-09T00:41:35Z</dc:date>
    </item>
    <item>
      <title>Re: SPI - Transmission complete flag?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/SPI-Transmission-complete-flag/m-p/1166890#M58480</link>
      <description>&lt;P&gt;Please excuse the bump, but how about providing a link to that GITHUB example?&amp;nbsp; Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 13 Oct 2020 16:42:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/SPI-Transmission-complete-flag/m-p/1166890#M58480</guid>
      <dc:creator>bhenning</dc:creator>
      <dc:date>2020-10-13T16:42:11Z</dc:date>
    </item>
  </channel>
</rss>

