<?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>LPC MicrocontrollersのトピックRe: DMA for Flexcomm SPI with 20-24-bit peripherals?</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/DMA-for-Flexcomm-SPI-with-20-24-bit-peripherals/m-p/1040551#M40451</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello &lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/davenadler"&gt;davenadler&lt;/A&gt;‌,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The reference manual mention the following regarding larger frames:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt; Larger sizes can be handled by splitting data up into groups of 16 bits or less. For example, 24 bits can be supported as two groups of 16 bits and 8 bits or two groups of 12 bits, among others. Frames of any size, including greater than 32 bits, can be supported in the same way.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Sending two groups of 12 bits with SSEL de-asserted between 24-bit increments, for instance, would require changing the value of the EOF bit on alternate 12-bit frames.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you only want a single interruption between transfers you could try using the DMA interrupt instead of the SPI one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me know if this helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Alexis Andalon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 01 Apr 2020 22:47:53 GMT</pubDate>
    <dc:creator>Alexis_A</dc:creator>
    <dc:date>2020-04-01T22:47:53Z</dc:date>
    <item>
      <title>DMA for Flexcomm SPI with 20-24-bit peripherals?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/DMA-for-Flexcomm-SPI-with-20-24-bit-peripherals/m-p/1040550#M40450</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We have what is a pretty common requirement for modern applications especially IOT.&lt;BR /&gt;Specifically, we need to, &lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;without code intervention - DMA only&lt;/STRONG&gt;&lt;/SPAN&gt;:&lt;BR /&gt;- read results from several SPI sensors&lt;BR /&gt;- interrupt (and possibly wake up sleeping) CPU &lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;after all the results are available in RAM&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;- the peripherals are 20-bit and 24-bit sensors (common for ADC and sensors like accelerometer, pressure, etc)&lt;BR /&gt;For each peripheral CS is asserted once, then 24 bits clocked in over SPI, and only after all data read CS de-asserted.&lt;BR /&gt;I was able to do this all with DMA+SPI on Kinetis K64F (DMA to sequence multiple CS toggling and multiple SPI xfers).&lt;BR /&gt;Successful products now shipping doing this on K64F ;-)&lt;BR /&gt;Now we're considering LPC55xxxx for next projects.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, the question: Using DMA and flexcomm SPI, how does one accomplish this on LPC55xxx?&lt;BR /&gt;Flexcomm SPI documentation says:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; '&lt;EM&gt;&lt;SPAN style="left: 271.341px; top: 372.464px; font-size: 16.0867px; font-family: sans-serif; transform: scaleX(1.00307);"&gt;Data frames of 4 to 16 bits supported dire&lt;/SPAN&gt;&lt;SPAN style="left: 568.364px; top: 372.464px; font-size: 16.0867px; font-family: sans-serif; transform: scaleX(1.00357);"&gt;ctly. Larger frames supported by software&lt;/SPAN&gt;&lt;/EM&gt;'&lt;BR /&gt;We need to read multiple 24-bit SPI devices &lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;before any interrupt&lt;/STRONG&gt;&lt;/SPAN&gt;. No multiple interrupts! &lt;BR /&gt;Only interrupt when all data read into RAM!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance for any pointers!&lt;BR /&gt;Best Regards, Dave&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Mar 2020 16:41:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/DMA-for-Flexcomm-SPI-with-20-24-bit-peripherals/m-p/1040550#M40450</guid>
      <dc:creator>davenadler</dc:creator>
      <dc:date>2020-03-31T16:41:33Z</dc:date>
    </item>
    <item>
      <title>Re: DMA for Flexcomm SPI with 20-24-bit peripherals?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/DMA-for-Flexcomm-SPI-with-20-24-bit-peripherals/m-p/1040551#M40451</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello &lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/davenadler"&gt;davenadler&lt;/A&gt;‌,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The reference manual mention the following regarding larger frames:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt; Larger sizes can be handled by splitting data up into groups of 16 bits or less. For example, 24 bits can be supported as two groups of 16 bits and 8 bits or two groups of 12 bits, among others. Frames of any size, including greater than 32 bits, can be supported in the same way.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Sending two groups of 12 bits with SSEL de-asserted between 24-bit increments, for instance, would require changing the value of the EOF bit on alternate 12-bit frames.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you only want a single interruption between transfers you could try using the DMA interrupt instead of the SPI one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me know if this helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Alexis Andalon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Apr 2020 22:47:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/DMA-for-Flexcomm-SPI-with-20-24-bit-peripherals/m-p/1040551#M40451</guid>
      <dc:creator>Alexis_A</dc:creator>
      <dc:date>2020-04-01T22:47:53Z</dc:date>
    </item>
    <item>
      <title>Re: DMA for Flexcomm SPI with 20-24-bit peripherals?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/DMA-for-Flexcomm-SPI-with-20-24-bit-peripherals/m-p/1040552#M40452</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Alexis, but you have not answered my question:&lt;BR /&gt;&lt;STRONG&gt;Using DMA and flexcomm SPI, how does one accomplish this on LPC55xxx?&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;How does one use DMA to sequence CS control and SPI operations to perform&lt;BR /&gt;for example a read from a 24-bit SPI device, with an interrupt only &lt;BR /&gt;when the data is read into RAM and ready to process?&lt;BR /&gt;Again, note CS must be asserted before clocking data, and de-asserted only after all 24-bits clocked in.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;BR /&gt;Best Regards, Dave&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Apr 2020 15:37:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/DMA-for-Flexcomm-SPI-with-20-24-bit-peripherals/m-p/1040552#M40452</guid>
      <dc:creator>davenadler</dc:creator>
      <dc:date>2020-04-02T15:37:22Z</dc:date>
    </item>
    <item>
      <title>Re: DMA for Flexcomm SPI with 20-24-bit peripherals?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/DMA-for-Flexcomm-SPI-with-20-24-bit-peripherals/m-p/1040553#M40453</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello &lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/davenadler"&gt;davenadler&lt;/A&gt;‌,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The EOF bit is used to manage the transmissions greater than 16 bits, so you will need to set this bit and set the FRAME_DELAY to 0, this way you could receive the full ADC frame as two transfers, or if you want as 3 8-bit transfers.&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/104063i88D2C0A472408314/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;Also, if you need the SSEL is not asserted between transfers this bit could help you to do it.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_2.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/104098i29A9CFBED0095650/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_2.png" alt="pastedImage_2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;In the SDK (link for download &lt;A href="https://mcuxpresso.nxp.com/en/welcome"&gt;here&lt;/A&gt;), there's an example called spi_dma_b2b_transfer that you can use as reference.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Alexis Andalon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Apr 2020 15:07:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/DMA-for-Flexcomm-SPI-with-20-24-bit-peripherals/m-p/1040553#M40453</guid>
      <dc:creator>Alexis_A</dc:creator>
      <dc:date>2020-04-03T15:07:58Z</dc:date>
    </item>
    <item>
      <title>Re: DMA for Flexcomm SPI with 20-24-bit peripherals?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/DMA-for-Flexcomm-SPI-with-20-24-bit-peripherals/m-p/1040554#M40454</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Alexis for pointing out the deferred CS de-assert.&lt;/P&gt;&lt;P&gt;However, you still have not answered my question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Again, &lt;BR /&gt;&lt;STRONG&gt;Using DMA and flexcomm SPI, how does one read (2) 24-bit SPI sensors without CPU intervention on LPC55xxx?&lt;BR /&gt;&lt;/STRONG&gt;No interrupt until the data has been read into memory and is ready to process.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;BR /&gt;Best Regards, Dave&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Apr 2020 22:12:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/DMA-for-Flexcomm-SPI-with-20-24-bit-peripherals/m-p/1040554#M40454</guid>
      <dc:creator>davenadler</dc:creator>
      <dc:date>2020-04-06T22:12:12Z</dc:date>
    </item>
  </channel>
</rss>

