<?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>Kinetis Microcontrollers中的主题 Re: How do I end a SPI Transfer when a particular byte is received?</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-do-I-end-a-SPI-Transfer-when-a-particular-byte-is-received/m-p/490716#M30299</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for your help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From what I can tell, just setting the halt bit will not cause the chip select line to be deasserted. The datasheet says:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;The PUSHR[CONT] / DSICR0[DCONT] bits must be deasserted before asserting&lt;/P&gt;&lt;P&gt;MCR[HALT] bit in master mode. This will make sure that the PCSn signals are&lt;/P&gt;&lt;P&gt;deasserted. Asserting MCR[HALT] bit during continuous transfer will cause the&lt;/P&gt;&lt;P&gt;PCSn signals to remain asserted and hence Slave Device cannot transition from&lt;/P&gt;&lt;P&gt;Running to Stopped state.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Would I be able to clear PUSHR[CONT] bit and then set the MCR[HALT] bit? Or would that still shift out an extra frame. I may have to try this to see if it will work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 13 Apr 2016 17:06:03 GMT</pubDate>
    <dc:creator>atm</dc:creator>
    <dc:date>2016-04-13T17:06:03Z</dc:date>
    <item>
      <title>How do I end a SPI Transfer when a particular byte is received?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-do-I-end-a-SPI-Transfer-when-a-particular-byte-is-received/m-p/490712#M30295</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;I am using the processor expert SPI_Master_LDD, but it is slightly modified to integrate with some more advanced driver code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using this driver code to communicate with a part I have not communicated with before and I am having an issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The protocol for the device I am communicating with requires me to send a packet of data and then receive until I receive a non-zero response. I have no problem constructing a send and then receive, but I cannot figure out how to--when I detect a non-zero character--end the SPI message immediately (deassert chip select) without shifting out any extra frames.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My driver, up to this point, has always known the fixed amount of bytes it would need to receive and would clear the SPI_PUSHR_CS_MASK in the SPI_PUSHR register to clock in the last byte of received data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the help in advance!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Apr 2016 14:36:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-do-I-end-a-SPI-Transfer-when-a-particular-byte-is-received/m-p/490712#M30295</guid>
      <dc:creator>atm</dc:creator>
      <dc:date>2016-04-08T14:36:05Z</dc:date>
    </item>
    <item>
      <title>Re: How do I end a SPI Transfer when a particular byte is received?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-do-I-end-a-SPI-Transfer-when-a-particular-byte-is-received/m-p/490713#M30296</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;Customer application is a special SPI application case. The Processor Expert SPIMaster_LDD just designed for general SPI application, which losing the flexibility.&lt;/P&gt;&lt;P&gt;Customer could refer to use &lt;A href="http://kex.freescale.com/en/welcome"&gt;KSDK software&lt;/A&gt;, which provide more SPI module related driver and HAL driver.&lt;/P&gt;&lt;P&gt;Customer can use those HAL driver to generate a suitable application driver.&lt;/P&gt;&lt;P&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, 11 Apr 2016 03:27:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-do-I-end-a-SPI-Transfer-when-a-particular-byte-is-received/m-p/490713#M30296</guid>
      <dc:creator>Hui_Ma</dc:creator>
      <dc:date>2016-04-11T03:27:32Z</dc:date>
    </item>
    <item>
      <title>Re: How do I end a SPI Transfer when a particular byte is received?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-do-I-end-a-SPI-Transfer-when-a-particular-byte-is-received/m-p/490714#M30297</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for your reply, Hui.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The SPI driver I am using uses &lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; font-size: 14px;"&gt;SPIMaster_LDD as a start, but I am not using code generation with processor expert in my project. So I have no trouble making any modification to the SPIMaster driver that I may need.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; font-size: 14px;"&gt;I am not sure I understand how the KSDK would solve the problem? I am not sure it is possible to address the issue I am having without software control of the chip select rather than allowing the SPI module to control the start of that digital output.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Apr 2016 18:27:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-do-I-end-a-SPI-Transfer-when-a-particular-byte-is-received/m-p/490714#M30297</guid>
      <dc:creator>atm</dc:creator>
      <dc:date>2016-04-11T18:27:54Z</dc:date>
    </item>
    <item>
      <title>Re: How do I end a SPI Transfer when a particular byte is received?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-do-I-end-a-SPI-Transfer-when-a-particular-byte-is-received/m-p/490715#M30298</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 your application need to check the SPI input data value, which need to add related code with SPI communication handler.&lt;/P&gt;&lt;P&gt;The KSDK driver code could provide some flexible usage, such as DSPI_StopTransfer() function to stop the SPI transfer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/*!&lt;/P&gt;&lt;P&gt; * @brief Stops (halts) DSPI transfers and sets HALT bit in MCR.&lt;/P&gt;&lt;P&gt; *&lt;/P&gt;&lt;P&gt; * This function stops data transfers in either master or slave mode.&lt;/P&gt;&lt;P&gt; *&lt;/P&gt;&lt;P&gt; * @param base DSPI peripheral address.&lt;/P&gt;&lt;P&gt; */&lt;/P&gt;&lt;P&gt;static inline void DSPI_StopTransfer(SPI_Type *base)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; base-&amp;gt;MCR |= SPI_MCR_HALT_MASK;&lt;/P&gt;&lt;P&gt;}&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, 12 Apr 2016 01:41:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-do-I-end-a-SPI-Transfer-when-a-particular-byte-is-received/m-p/490715#M30298</guid>
      <dc:creator>Hui_Ma</dc:creator>
      <dc:date>2016-04-12T01:41:43Z</dc:date>
    </item>
    <item>
      <title>Re: How do I end a SPI Transfer when a particular byte is received?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-do-I-end-a-SPI-Transfer-when-a-particular-byte-is-received/m-p/490716#M30299</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for your help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From what I can tell, just setting the halt bit will not cause the chip select line to be deasserted. The datasheet says:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;The PUSHR[CONT] / DSICR0[DCONT] bits must be deasserted before asserting&lt;/P&gt;&lt;P&gt;MCR[HALT] bit in master mode. This will make sure that the PCSn signals are&lt;/P&gt;&lt;P&gt;deasserted. Asserting MCR[HALT] bit during continuous transfer will cause the&lt;/P&gt;&lt;P&gt;PCSn signals to remain asserted and hence Slave Device cannot transition from&lt;/P&gt;&lt;P&gt;Running to Stopped state.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Would I be able to clear PUSHR[CONT] bit and then set the MCR[HALT] bit? Or would that still shift out an extra frame. I may have to try this to see if it will work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Apr 2016 17:06:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-do-I-end-a-SPI-Transfer-when-a-particular-byte-is-received/m-p/490716#M30299</guid>
      <dc:creator>atm</dc:creator>
      <dc:date>2016-04-13T17:06:03Z</dc:date>
    </item>
    <item>
      <title>Re: How do I end a SPI Transfer when a particular byte is received?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-do-I-end-a-SPI-Transfer-when-a-particular-byte-is-received/m-p/490717#M30300</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;If customer had set this [CONT] bit at SPIx_PUSHR register before, customer can clear this [CONT] bit and then set MCR[HALT] to stop the SPI transmission.&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, 14 Apr 2016 06:43:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-do-I-end-a-SPI-Transfer-when-a-particular-byte-is-received/m-p/490717#M30300</guid>
      <dc:creator>Hui_Ma</dc:creator>
      <dc:date>2016-04-14T06:43:56Z</dc:date>
    </item>
  </channel>
</rss>

