<?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: How to implement a DMA-based SPI driver interface in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-implement-a-DMA-based-SPI-driver-interface/m-p/472351#M28591</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;I copy the part from the reference manual of K65.&lt;/P&gt;&lt;P&gt;Obviously, when the SPI is set up in master mode and you use the DMA to transfer 8 bits or 16 bits data to the 32 bits SPIx_PUSHR, the High 16 bits of SPIx_PUSHR keep the last value instead of zero.&lt;/P&gt;&lt;P&gt;after you initialize the SPI and DMA module, write&amp;nbsp; a 32 bits data&amp;nbsp; to the SPIx_PUSHR by software, which include the command in the high 16 bits, when the transfer is over, it will trigger DMA to transfer data from&amp;nbsp;&amp;nbsp; buffer to the SPIx_PUSHR register, the DMA can write 8 bits or 16 bits data to SPIx_PUSHR register, the High 16 bits of SPIx_PUSHR will remain the last value.&lt;/P&gt;&lt;P&gt;Hope it can help you.&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;XiangJun Rong&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;57.1.11 Writing SPI Transmit FIFO&lt;/P&gt;&lt;P&gt;The SPI supports 8-bit or 16-bit writes to the PUSH TX FIFO, allowing a single write to&lt;/P&gt;&lt;P&gt;the command word followed by multiple writes to the transmit word. The TX FIFO will&lt;/P&gt;&lt;P&gt;save the last command word written, and convert a 8-bit/16-bit write to the transmit word&lt;/P&gt;&lt;P&gt;into a 32-bit write that pushes both the command word and transmit word into the TX&lt;/P&gt;&lt;P&gt;FIFO (PUSH TX FIFO Register In Master Mode)&lt;/P&gt;&lt;P&gt;A 32-bit write to the SPI_PUSH register will push all 32-bits to the TX FIFO. An 8-bit or&lt;/P&gt;&lt;P&gt;16-bit write to the 16-bit transmit data field will push the data together with the last&lt;/P&gt;&lt;P&gt;written command word. An 8-bit or 16-bit write to the command word does not push data&lt;/P&gt;&lt;P&gt;onto the FIFO, but that command word is pushed to the TX FIFO on all subsequent 8-bit&lt;/P&gt;&lt;P&gt;or 16-bit writes to the transmit data field. This allows a single 16-bit write to the&lt;/P&gt;&lt;P&gt;command word to be used for all subsequent 8-bit or 16-bit writes to the transmit data&lt;/P&gt;&lt;P&gt;word. Writing a different 16-bit command word will cause all subsequent 8-bit or 16-bit&lt;/P&gt;&lt;P&gt;writes to the transmit data word to be pushed to the TX FIFO with the new command&lt;/P&gt;&lt;P&gt;word.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 14 Mar 2016 03:44:43 GMT</pubDate>
    <dc:creator>xiangjun_rong</dc:creator>
    <dc:date>2016-03-14T03:44:43Z</dc:date>
    <item>
      <title>How to implement a DMA-based SPI driver interface</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-implement-a-DMA-based-SPI-driver-interface/m-p/472350#M28590</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would like to implement a driver interface function that allows a user to pass in a buffer of SPI bytes to be sent and have that data sent over SPI using DMA.&amp;nbsp; However, the combined command and data implementation of the SPI TX FIFO registers makes this difficult.&amp;nbsp; It looks like I would have to separately allocate four times as much memory (32 bit words instead of 8-bit bytes passed in by the user) to use for DMA, then manually copy the user's data into the memory along with the command words.&amp;nbsp; Is there a better way to do this that does not involve a separate allocation and copy?&amp;nbsp; I do not see an application note or anything similar explaining this.&amp;nbsp; Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Mar 2016 17:05:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-implement-a-DMA-based-SPI-driver-interface/m-p/472350#M28590</guid>
      <dc:creator>elecsmith</dc:creator>
      <dc:date>2016-03-11T17:05:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to implement a DMA-based SPI driver interface</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-implement-a-DMA-based-SPI-driver-interface/m-p/472351#M28591</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;I copy the part from the reference manual of K65.&lt;/P&gt;&lt;P&gt;Obviously, when the SPI is set up in master mode and you use the DMA to transfer 8 bits or 16 bits data to the 32 bits SPIx_PUSHR, the High 16 bits of SPIx_PUSHR keep the last value instead of zero.&lt;/P&gt;&lt;P&gt;after you initialize the SPI and DMA module, write&amp;nbsp; a 32 bits data&amp;nbsp; to the SPIx_PUSHR by software, which include the command in the high 16 bits, when the transfer is over, it will trigger DMA to transfer data from&amp;nbsp;&amp;nbsp; buffer to the SPIx_PUSHR register, the DMA can write 8 bits or 16 bits data to SPIx_PUSHR register, the High 16 bits of SPIx_PUSHR will remain the last value.&lt;/P&gt;&lt;P&gt;Hope it can help you.&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;XiangJun Rong&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;57.1.11 Writing SPI Transmit FIFO&lt;/P&gt;&lt;P&gt;The SPI supports 8-bit or 16-bit writes to the PUSH TX FIFO, allowing a single write to&lt;/P&gt;&lt;P&gt;the command word followed by multiple writes to the transmit word. The TX FIFO will&lt;/P&gt;&lt;P&gt;save the last command word written, and convert a 8-bit/16-bit write to the transmit word&lt;/P&gt;&lt;P&gt;into a 32-bit write that pushes both the command word and transmit word into the TX&lt;/P&gt;&lt;P&gt;FIFO (PUSH TX FIFO Register In Master Mode)&lt;/P&gt;&lt;P&gt;A 32-bit write to the SPI_PUSH register will push all 32-bits to the TX FIFO. An 8-bit or&lt;/P&gt;&lt;P&gt;16-bit write to the 16-bit transmit data field will push the data together with the last&lt;/P&gt;&lt;P&gt;written command word. An 8-bit or 16-bit write to the command word does not push data&lt;/P&gt;&lt;P&gt;onto the FIFO, but that command word is pushed to the TX FIFO on all subsequent 8-bit&lt;/P&gt;&lt;P&gt;or 16-bit writes to the transmit data field. This allows a single 16-bit write to the&lt;/P&gt;&lt;P&gt;command word to be used for all subsequent 8-bit or 16-bit writes to the transmit data&lt;/P&gt;&lt;P&gt;word. Writing a different 16-bit command word will cause all subsequent 8-bit or 16-bit&lt;/P&gt;&lt;P&gt;writes to the transmit data word to be pushed to the TX FIFO with the new command&lt;/P&gt;&lt;P&gt;word.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Mar 2016 03:44:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-implement-a-DMA-based-SPI-driver-interface/m-p/472351#M28591</guid>
      <dc:creator>xiangjun_rong</dc:creator>
      <dc:date>2016-03-14T03:44:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to implement a DMA-based SPI driver interface</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-implement-a-DMA-based-SPI-driver-interface/m-p/472352#M28592</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you!&amp;nbsp; My datasheet (K10) does not describe this as clearly, and I did not understand this feature.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Mar 2016 15:53:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-implement-a-DMA-based-SPI-driver-interface/m-p/472352#M28592</guid>
      <dc:creator>elecsmith</dc:creator>
      <dc:date>2016-03-14T15:53:07Z</dc:date>
    </item>
  </channel>
</rss>

