<?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: LPC54102 Hardware Triggering DMA</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54102-Hardware-Triggering-DMA/m-p/1824558#M55606</link>
    <description>&lt;P&gt;This is a 7 year old post you are responding to. The project I was working on has long been mothballed and I don't have LPCxpresso installed. I have switched CPU manufactures. Even though NXP forwarded this to me, I had to create a new account to respond this, they didn't recognize my credentials.&lt;/P&gt;&lt;P&gt;I found the datasheet was more accurate than the code. I have about 5 include files that I modified for bug fixes, I let NXP know about the bugs but have no idea if anything was ever fixed.&amp;nbsp; I also don't recall having many examples to work from, but found the datasheet to be fairly accurate.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I will tell you how I created and initialized the descriptors. For the above reasons,&amp;nbsp; I'd suggest taking it with a grain of salt.&amp;nbsp;&lt;/P&gt;&lt;P&gt;// DMAREQ_SPI0_TX CH 9&lt;BR /&gt;// DMAREQ_SPI0_RX CH 8&lt;BR /&gt;static DMA_CHDESC_T DMASPITXDescriptor[2] __attribute__ ((aligned(16)));&lt;BR /&gt;static DMA_CHDESC_T DMASPIRXDescriptor[2] __attribute__ ((aligned(16)));&lt;/P&gt;&lt;P&gt;// note that&amp;nbsp;SPI0ADCTXDATA,&amp;nbsp;ADCRXA, and ADCRXB are source/destination in memory for where the DMA transfer is directed to&lt;/P&gt;&lt;P&gt;int DMA_init(void)&lt;BR /&gt;{&lt;BR /&gt;DMASPITXDescriptor[0].source = (uint32_t) &amp;amp;SPI0ADCTXDATA[SPI0ADCTXDATALEN-1];&lt;BR /&gt;DMASPITXDescriptor[0].dest = (uint32_t) &amp;amp;LPC_SPI0-&amp;gt;TXDATCTL;&lt;BR /&gt;DMASPITXDescriptor[0].next = (uint32_t) &amp;amp;DMASPITXDescriptor[1];&lt;BR /&gt;DMASPITXDescriptor[0].xfercfg = 0; // this should be ignored for SRAM descriptor table&lt;/P&gt;&lt;P&gt;DMASPITXDescriptor[1].source = (uint32_t) &amp;amp;SPI0ADCTXDATA[SPI0ADCTXDATALEN-1];&lt;BR /&gt;DMASPITXDescriptor[1].dest = (uint32_t) &amp;amp;LPC_SPI0-&amp;gt;TXDATCTL;&lt;BR /&gt;DMASPITXDescriptor[1].next = (uint32_t) &amp;amp;DMASPITXDescriptor[1];&lt;BR /&gt;DMASPITXDescriptor[1].xfercfg = DMA_XFERCFG_CFGVALID |&lt;BR /&gt;&amp;nbsp; &amp;nbsp;DMA_XFERCFG_RELOAD | DMA_XFERCFG_WIDTH_32 | DMA_XFERCFG_SRCINC_1 |&lt;BR /&gt;&amp;nbsp; &amp;nbsp;DMA_XFERCFG_DSTINC_0 | DMA_XFERCFG_XFERCOUNT(SPI0ADCTXDATALEN);&lt;/P&gt;&lt;P&gt;DMASPIRXDescriptor[0].source = (uint32_t) &amp;amp;LPC_SPI0-&amp;gt;RXDAT;&lt;BR /&gt;DMASPIRXDescriptor[0].dest = (uint32_t) &amp;amp;ADCRXA[sizeof(ADCRXA) - 1];&lt;BR /&gt;DMASPIRXDescriptor[0].next = (uint32_t) &amp;amp;DMASPIRXDescriptor[1];&lt;BR /&gt;DMASPIRXDescriptor[0].xfercfg = DMA_XFERCFG_CFGVALID | DMA_XFERCFG_SETINTA |&lt;BR /&gt;&amp;nbsp; &amp;nbsp;DMA_XFERCFG_CLRTRIG | DMA_XFERCFG_RELOAD | DMA_XFERCFG_WIDTH_8 | DMA_XFERCFG_SRCINC_0 |&lt;BR /&gt;&amp;nbsp; &amp;nbsp;DMA_XFERCFG_DSTINC_1 | DMA_XFERCFG_XFERCOUNT(sizeof(ADCRXA));&lt;/P&gt;&lt;P&gt;DMASPIRXDescriptor[1].source = (uint32_t) &amp;amp;LPC_SPI0-&amp;gt;RXDAT;&lt;BR /&gt;DMASPIRXDescriptor[1].dest = (uint32_t) &amp;amp;ADCRXB[sizeof(ADCRXB) - 1];&lt;BR /&gt;DMASPIRXDescriptor[1].next = (uint32_t) &amp;amp;DMASPIRXDescriptor[0];&lt;BR /&gt;DMASPIRXDescriptor[1].xfercfg = DMA_XFERCFG_CFGVALID | DMA_XFERCFG_SETINTB |&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;DMA_XFERCFG_CLRTRIG | DMA_XFERCFG_RELOAD | DMA_XFERCFG_WIDTH_8 | DMA_XFERCFG_SRCINC_0 |&lt;BR /&gt;&amp;nbsp; &amp;nbsp;DMA_XFERCFG_DSTINC_1 | DMA_XFERCFG_XFERCOUNT(sizeof(ADCRXB));&lt;/P&gt;&lt;P&gt;if (!Chip_DMA_SetupTranChannel(LPC_DMA, DMAREQ_SPI0_TX, &amp;amp;DMASPITXDescriptor[0])) return -1;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Chip_DMA_SetupChannelTransfer(LPC_DMA, DMAREQ_SPI0_TX, DMASPITXDescriptor[1].xfercfg);&lt;BR /&gt;Chip_DMA_EnableChannel(LPC_DMA, DMAREQ_SPI0_TX);&lt;BR /&gt;Chip_DMA_EnableIntChannel(LPC_DMA, DMAREQ_SPI0_TX);&lt;BR /&gt;Chip_DMA_SetupChannelConfig(LPC_DMA, DMAREQ_SPI0_TX,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DMA_CFG_HWTRIGEN | DMA_CFG_TRIGPOL_LOW | DMA_CFG_TRIGTYPE_EDGE |&lt;BR /&gt;DMA_CFG_PERIPHREQEN | DMA_CFG_CHPRIORITY(1));&lt;/P&gt;&lt;P&gt;if (!Chip_DMA_SetupTranChannel(LPC_DMA, DMAREQ_SPI0_RX, &amp;amp;DMASPIRXDescriptor[0])) return -1;&lt;/P&gt;&lt;P&gt;Chip_DMA_SetupChannelTransfer(LPC_DMA, DMAREQ_SPI0_RX, DMASPIRXDescriptor[1].xfercfg);&lt;BR /&gt;Chip_DMA_EnableChannel(LPC_DMA, DMAREQ_SPI0_RX);&lt;BR /&gt;Chip_DMA_EnableIntChannel(LPC_DMA, DMAREQ_SPI0_RX);&lt;BR /&gt;Chip_DMA_SetupChannelConfig(LPC_DMA, DMAREQ_SPI0_RX,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DMA_CFG_HWTRIGEN | DMA_CFG_TRIGPOL_LOW | DMA_CFG_TRIGTYPE_EDGE |&lt;BR /&gt;DMA_CFG_PERIPHREQEN&amp;nbsp; | DMA_CFG_CHPRIORITY(0));&lt;/P&gt;&lt;P&gt;NVIC_EnableIRQ(DMA_IRQn);&lt;BR /&gt;NVIC_EnableIRQ(PIN_INT0_IRQn);&lt;BR /&gt;return 0;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;you will need an interrupt routine which is called when the transfer is complete.&amp;nbsp;&lt;/P&gt;&lt;P&gt;void DMA_IRQHandler(void)&lt;/P&gt;&lt;P&gt;The first DMA initializes and loops on the second descriptor. The second DMA ping-pongs between descriptors.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Not much but good luck&lt;/P&gt;&lt;P&gt;Bob&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 10 Mar 2024 00:21:53 GMT</pubDate>
    <dc:creator>ralkire</dc:creator>
    <dc:date>2024-03-10T00:21:53Z</dc:date>
    <item>
      <title>LPC54102 Hardware Triggering DMA</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54102-Hardware-Triggering-DMA/m-p/693038#M27933</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have an application where I was using SPI to communicate with an external multichannel 24bit ADC and used DMA to move&amp;nbsp;the samples into SRAM. I am using LPCopen &amp;nbsp;3.03 with GCC on a LPC54102 (custom board) M4F only. This has almost worked ok with some gotchas. I have a few questions and a LPCopen bug report.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The ADC asserts data ready (DR) when data conversion is complete. DR is used &amp;nbsp;to trigger DMA to initiate an SPI transfer. Both data and transfer control can be sent with DMA to the SPI transmit through the&amp;nbsp;TXDATCTL register. DR will also&amp;nbsp;trigger the SPI RX channel to move data when available into SRAM&amp;nbsp;using a pair of ping-pong buffers. At the end of the transfer, I want an interrupt that will ultimately trigger a thread to process the data.&lt;/P&gt;&lt;P&gt;I ended up using byte transfer rather than word because of endian problems between SPI (big endian) and the little endian ARM. &amp;nbsp;I couldn't find a good way for the DMA to deal with this on it's own. This requires some backend processing so If you know of a way, please let me know.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I needed a&amp;nbsp;hardware trigger of the DMA which is documented in the datasheet but I couldn't find any&amp;nbsp;working&amp;nbsp;examples.&lt;/P&gt;&lt;P&gt;The documentation states that NVIC has to be enabled for GPIO to trigger&amp;nbsp;the DMA. So it is straightforward to set that up as a pinint.&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;Chip_INMUX_PinIntSel(PININTSELECT0, PIO1_1_PORT, PIO1_1_PIN);&lt;BR /&gt; Chip_PININT_ClearIntStatus(LPC_PININT, PININTCH(PININTSELECT0));&lt;BR /&gt; Chip_PININT_SetPinModeEdge(LPC_PININT, PININTCH(PININTSELECT0));&lt;BR /&gt; Chip_PININT_EnableIntLow(LPC_PININT, PININTCH(PININTSELECT0));&lt;BR /&gt; NVIC_EnableIRQ(PIN_INT0_IRQn);&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;The interrupt service routine doesn't really have to do much&amp;nbsp;and adds unnecessary overhead. It could be used to clear the interrupt although I thought that was what DMA_XFERCFG_CLRTRIG was for but maybe both need to be cleared. I tried to not use it but DMA hardware trigger wont work without it. I need to test if the DMA trigger from the GPIO incurs a delay that might be seen with priortized interrupts because it is using the interrupt hardware.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The DMA setup itself is:.&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;Chip_DMA_SetupChannelTransfer(LPC_DMA, DMAREQ_SPI0_TX, DMASPITXDescriptor[1].xfercfg);&lt;BR /&gt; Chip_DMA_EnableChannel(LPC_DMA, DMAREQ_SPI0_TX);&lt;BR /&gt;Chip_DMA_SetupChannelConfig(LPC_DMA, DMAREQ_SPI0_TX,&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;DMA_CFG_HWTRIGEN | DMA_CFG_TRIGPOL_LOW | DMA_CFG_TRIGTYPE_EDGE |&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;DMA_CFG_PERIPHREQEN | DMA_CFG_CHPRIORITY(1));&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Map the pinint0 to DMA SPI TX/RX&amp;nbsp;channels use the include file inmux_5410x.h with the following:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;Chip_INMUX_SetDMATrigger(DMAREQ_SPI0_TX, DMATRIG_PININT0);&lt;BR /&gt; Chip_INMUX_SetDMATrigger(DMAREQ_SPI0_RX, DMATRIG_PININT0);&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;This didn't work.&lt;/P&gt;&lt;P&gt;There is a&amp;nbsp;bug in LPCopen include file &amp;nbsp;inmux_5410x.h file lines 72-95. The enumeration&amp;nbsp;DMA_TRIGSRC_T does not match the datasheet UM10850 pg 103&amp;nbsp;DMA_ITRIG_INMUX register definition. The problem is that the datasheet does not have&amp;nbsp;entries for CT32B1 Match 1 or CT32B3 Match 1 while the include file does. Since&amp;nbsp;pinint0 follows the timer entries, the enumeration&amp;nbsp;is off by two. With that&amp;nbsp;enumeration&amp;nbsp;fixed, hardware&amp;nbsp;trigger worked as expected.&lt;/P&gt;&lt;P&gt;Please take this as a bug report and it would be great if it got fixed?&lt;/P&gt;&lt;P&gt;Thanks&amp;nbsp;&lt;/P&gt;&lt;P&gt;Bob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 May 2017 09:16:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54102-Hardware-Triggering-DMA/m-p/693038#M27933</guid>
      <dc:creator>robertalkire</dc:creator>
      <dc:date>2017-05-25T09:16:33Z</dc:date>
    </item>
    <item>
      <title>Re: LPC54102 Hardware Triggering DMA</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54102-Hardware-Triggering-DMA/m-p/693039#M27934</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A _jive_internal="true" class="" data-content-finding="Community" data-userid="295886" data-username="robertalkire" href="https://community.nxp.com/people/robertalkire"&gt;Robert Alkire&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;Thanks for your reporting, and I will transfer the bug to the LPCopen team.&lt;BR /&gt;Have a great day,&lt;BR /&gt;TIC&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&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>Fri, 26 May 2017 02:48:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54102-Hardware-Triggering-DMA/m-p/693039#M27934</guid>
      <dc:creator>jeremyzhou</dc:creator>
      <dc:date>2017-05-26T02:48:30Z</dc:date>
    </item>
    <item>
      <title>Re: LPC54102 Hardware Triggering DMA</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54102-Hardware-Triggering-DMA/m-p/1824478#M55603</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/169402"&gt;@robertalkire&lt;/a&gt;&amp;nbsp;!&lt;/P&gt;&lt;P&gt;Hope all is well.&lt;/P&gt;&lt;P&gt;I am currently working on some application that is almost identical to what you have described here (i.e. having my LPC54102 interfacing with a 24-bit ADC, in my case it's MCP3561) and am trying to experiment with DMA setup with SPI, all using LPCopen v3.&lt;/P&gt;&lt;P&gt;Would you be willing to share your code for this matter for my reference as I am new to DMA configs so I like to have an idea how everything is tied together?&lt;/P&gt;&lt;P&gt;Any insights would be greatly appreciated and thank you in advance for your help!&lt;/P&gt;&lt;P&gt;-Kenneth&lt;/P&gt;</description>
      <pubDate>Fri, 08 Mar 2024 23:08:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54102-Hardware-Triggering-DMA/m-p/1824478#M55603</guid>
      <dc:creator>kennethkong852</dc:creator>
      <dc:date>2024-03-08T23:08:51Z</dc:date>
    </item>
    <item>
      <title>Re: LPC54102 Hardware Triggering DMA</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54102-Hardware-Triggering-DMA/m-p/1824558#M55606</link>
      <description>&lt;P&gt;This is a 7 year old post you are responding to. The project I was working on has long been mothballed and I don't have LPCxpresso installed. I have switched CPU manufactures. Even though NXP forwarded this to me, I had to create a new account to respond this, they didn't recognize my credentials.&lt;/P&gt;&lt;P&gt;I found the datasheet was more accurate than the code. I have about 5 include files that I modified for bug fixes, I let NXP know about the bugs but have no idea if anything was ever fixed.&amp;nbsp; I also don't recall having many examples to work from, but found the datasheet to be fairly accurate.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I will tell you how I created and initialized the descriptors. For the above reasons,&amp;nbsp; I'd suggest taking it with a grain of salt.&amp;nbsp;&lt;/P&gt;&lt;P&gt;// DMAREQ_SPI0_TX CH 9&lt;BR /&gt;// DMAREQ_SPI0_RX CH 8&lt;BR /&gt;static DMA_CHDESC_T DMASPITXDescriptor[2] __attribute__ ((aligned(16)));&lt;BR /&gt;static DMA_CHDESC_T DMASPIRXDescriptor[2] __attribute__ ((aligned(16)));&lt;/P&gt;&lt;P&gt;// note that&amp;nbsp;SPI0ADCTXDATA,&amp;nbsp;ADCRXA, and ADCRXB are source/destination in memory for where the DMA transfer is directed to&lt;/P&gt;&lt;P&gt;int DMA_init(void)&lt;BR /&gt;{&lt;BR /&gt;DMASPITXDescriptor[0].source = (uint32_t) &amp;amp;SPI0ADCTXDATA[SPI0ADCTXDATALEN-1];&lt;BR /&gt;DMASPITXDescriptor[0].dest = (uint32_t) &amp;amp;LPC_SPI0-&amp;gt;TXDATCTL;&lt;BR /&gt;DMASPITXDescriptor[0].next = (uint32_t) &amp;amp;DMASPITXDescriptor[1];&lt;BR /&gt;DMASPITXDescriptor[0].xfercfg = 0; // this should be ignored for SRAM descriptor table&lt;/P&gt;&lt;P&gt;DMASPITXDescriptor[1].source = (uint32_t) &amp;amp;SPI0ADCTXDATA[SPI0ADCTXDATALEN-1];&lt;BR /&gt;DMASPITXDescriptor[1].dest = (uint32_t) &amp;amp;LPC_SPI0-&amp;gt;TXDATCTL;&lt;BR /&gt;DMASPITXDescriptor[1].next = (uint32_t) &amp;amp;DMASPITXDescriptor[1];&lt;BR /&gt;DMASPITXDescriptor[1].xfercfg = DMA_XFERCFG_CFGVALID |&lt;BR /&gt;&amp;nbsp; &amp;nbsp;DMA_XFERCFG_RELOAD | DMA_XFERCFG_WIDTH_32 | DMA_XFERCFG_SRCINC_1 |&lt;BR /&gt;&amp;nbsp; &amp;nbsp;DMA_XFERCFG_DSTINC_0 | DMA_XFERCFG_XFERCOUNT(SPI0ADCTXDATALEN);&lt;/P&gt;&lt;P&gt;DMASPIRXDescriptor[0].source = (uint32_t) &amp;amp;LPC_SPI0-&amp;gt;RXDAT;&lt;BR /&gt;DMASPIRXDescriptor[0].dest = (uint32_t) &amp;amp;ADCRXA[sizeof(ADCRXA) - 1];&lt;BR /&gt;DMASPIRXDescriptor[0].next = (uint32_t) &amp;amp;DMASPIRXDescriptor[1];&lt;BR /&gt;DMASPIRXDescriptor[0].xfercfg = DMA_XFERCFG_CFGVALID | DMA_XFERCFG_SETINTA |&lt;BR /&gt;&amp;nbsp; &amp;nbsp;DMA_XFERCFG_CLRTRIG | DMA_XFERCFG_RELOAD | DMA_XFERCFG_WIDTH_8 | DMA_XFERCFG_SRCINC_0 |&lt;BR /&gt;&amp;nbsp; &amp;nbsp;DMA_XFERCFG_DSTINC_1 | DMA_XFERCFG_XFERCOUNT(sizeof(ADCRXA));&lt;/P&gt;&lt;P&gt;DMASPIRXDescriptor[1].source = (uint32_t) &amp;amp;LPC_SPI0-&amp;gt;RXDAT;&lt;BR /&gt;DMASPIRXDescriptor[1].dest = (uint32_t) &amp;amp;ADCRXB[sizeof(ADCRXB) - 1];&lt;BR /&gt;DMASPIRXDescriptor[1].next = (uint32_t) &amp;amp;DMASPIRXDescriptor[0];&lt;BR /&gt;DMASPIRXDescriptor[1].xfercfg = DMA_XFERCFG_CFGVALID | DMA_XFERCFG_SETINTB |&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;DMA_XFERCFG_CLRTRIG | DMA_XFERCFG_RELOAD | DMA_XFERCFG_WIDTH_8 | DMA_XFERCFG_SRCINC_0 |&lt;BR /&gt;&amp;nbsp; &amp;nbsp;DMA_XFERCFG_DSTINC_1 | DMA_XFERCFG_XFERCOUNT(sizeof(ADCRXB));&lt;/P&gt;&lt;P&gt;if (!Chip_DMA_SetupTranChannel(LPC_DMA, DMAREQ_SPI0_TX, &amp;amp;DMASPITXDescriptor[0])) return -1;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Chip_DMA_SetupChannelTransfer(LPC_DMA, DMAREQ_SPI0_TX, DMASPITXDescriptor[1].xfercfg);&lt;BR /&gt;Chip_DMA_EnableChannel(LPC_DMA, DMAREQ_SPI0_TX);&lt;BR /&gt;Chip_DMA_EnableIntChannel(LPC_DMA, DMAREQ_SPI0_TX);&lt;BR /&gt;Chip_DMA_SetupChannelConfig(LPC_DMA, DMAREQ_SPI0_TX,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DMA_CFG_HWTRIGEN | DMA_CFG_TRIGPOL_LOW | DMA_CFG_TRIGTYPE_EDGE |&lt;BR /&gt;DMA_CFG_PERIPHREQEN | DMA_CFG_CHPRIORITY(1));&lt;/P&gt;&lt;P&gt;if (!Chip_DMA_SetupTranChannel(LPC_DMA, DMAREQ_SPI0_RX, &amp;amp;DMASPIRXDescriptor[0])) return -1;&lt;/P&gt;&lt;P&gt;Chip_DMA_SetupChannelTransfer(LPC_DMA, DMAREQ_SPI0_RX, DMASPIRXDescriptor[1].xfercfg);&lt;BR /&gt;Chip_DMA_EnableChannel(LPC_DMA, DMAREQ_SPI0_RX);&lt;BR /&gt;Chip_DMA_EnableIntChannel(LPC_DMA, DMAREQ_SPI0_RX);&lt;BR /&gt;Chip_DMA_SetupChannelConfig(LPC_DMA, DMAREQ_SPI0_RX,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DMA_CFG_HWTRIGEN | DMA_CFG_TRIGPOL_LOW | DMA_CFG_TRIGTYPE_EDGE |&lt;BR /&gt;DMA_CFG_PERIPHREQEN&amp;nbsp; | DMA_CFG_CHPRIORITY(0));&lt;/P&gt;&lt;P&gt;NVIC_EnableIRQ(DMA_IRQn);&lt;BR /&gt;NVIC_EnableIRQ(PIN_INT0_IRQn);&lt;BR /&gt;return 0;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;you will need an interrupt routine which is called when the transfer is complete.&amp;nbsp;&lt;/P&gt;&lt;P&gt;void DMA_IRQHandler(void)&lt;/P&gt;&lt;P&gt;The first DMA initializes and loops on the second descriptor. The second DMA ping-pongs between descriptors.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Not much but good luck&lt;/P&gt;&lt;P&gt;Bob&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 10 Mar 2024 00:21:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54102-Hardware-Triggering-DMA/m-p/1824558#M55606</guid>
      <dc:creator>ralkire</dc:creator>
      <dc:date>2024-03-10T00:21:53Z</dc:date>
    </item>
    <item>
      <title>Re: LPC54102 Hardware Triggering DMA</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54102-Hardware-Triggering-DMA/m-p/1825656#M55620</link>
      <description>Much appreciated for your effort in responding to this aged post! Anything is helpful in getting started.&lt;BR /&gt;Cheers,&lt;BR /&gt;Ken</description>
      <pubDate>Tue, 12 Mar 2024 02:49:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54102-Hardware-Triggering-DMA/m-p/1825656#M55620</guid>
      <dc:creator>kennethkong852</dc:creator>
      <dc:date>2024-03-12T02:49:12Z</dc:date>
    </item>
  </channel>
</rss>

