<?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 CTIMER DMA requests/triggers, pacing the transfers in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/CTIMER-DMA-requests-triggers-pacing-the-transfers/m-p/1088948#M41752</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I got a DMA0 channel to successfully trigger from a CTIMER0 trigger source. The setup is as follows (using a custom board, not EVAL):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. CTIMER0 with match1, with a capture input as source (10 MHz clock). Also successfully outputs to an External match output as a 5 MHz square wave by matching for 1 and resetting after.&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;ctimer_config_t config;&lt;BR /&gt; CTIMER_GetDefaultConfig(&amp;amp;config);&lt;BR /&gt; config.mode = kCTIMER_IncreaseOnRiseEdge;&lt;BR /&gt; config.input = kCTIMER_Capture_0;&lt;BR /&gt; config.prescale = 1;&lt;BR /&gt; CTIMER_Init(CTIMER0, &amp;amp;config);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ctimer_match_config_t matchConfig;&lt;BR /&gt; matchConfig.enableCounterReset = true;&lt;BR /&gt; matchConfig.enableCounterStop = false;&lt;BR /&gt; matchConfig.matchValue = 1;&lt;BR /&gt; matchConfig.outControl = kCTIMER_Output_Toggle;&lt;BR /&gt; matchConfig.outPinInitState = true;&lt;BR /&gt; matchConfig.enableInterrupt = false;&lt;BR /&gt; CTIMER_SetupMatch(CTIMER0, kCTIMER_Match_1, &amp;amp;matchConfig);&lt;BR /&gt; CTIMER_StartTimer(CTIMER0);&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. INPUTMUX configured to connect CTIMER0's Match1 trigger to DMA0's channel 0.&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;INPUTMUX_AttachSignal(INPUTMUX, 0, kINPUTMUX_Ctimer0M1ToDma0);&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. Setup DMA0's channel 0 with the following config:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;dma_channel_trigger_t channelTrigger;&lt;BR /&gt; channelTrigger.type = kDMA_HighLevelTrigger; //or kDMA_RisingEdgeTrigger&lt;BR /&gt; channelTrigger.burst = &lt;SPAN style="background-color: #f6f6f6;"&gt;kDMA_LevelBurstTransfer&lt;/SPAN&gt;; //or &lt;SPAN style="background-color: #f6f6f6;"&gt;kDMA_EdgeBurstTransfer1&lt;/SPAN&gt;&lt;BR /&gt; channelTrigger.wrap = kDMA_NoWrap;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;dma_channel_config_t transferConfig;&lt;BR /&gt; DMA_Init(DMA0);&lt;BR /&gt; DMA_CreateHandle(&amp;amp;g_DMA_Handle, DMA0, 0);&lt;BR /&gt; DMA_EnableChannel(DMA0, 0);&lt;BR /&gt; DMA_SetCallback(&amp;amp;g_DMA_Handle, DMA_Callback, NULL);&lt;/P&gt;&lt;P&gt;DMA_PrepareChannelTransfer(&amp;amp;transferConfig, s_srcBuffer, (uint32_t*)&amp;amp;GPIO-&amp;gt;MPIN[0],&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;DMA_CHANNEL_XFER(false, false, true, false, kDMA_Transfer32BitWidth,&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;kDMA_AddressInterleave1xWidth, kDMA_AddressInterleave0xWidth, 4000),&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;kDMA_MemoryToMemory, &amp;amp;channelTrigger, NULL);&lt;/P&gt;&lt;P&gt;DMA_SubmitChannelTransfer(&amp;amp;g_DMA_Handle, &amp;amp;transferConfig);&lt;BR /&gt; DMA_StartTransfer(&amp;amp;g_DMA_Handle);&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;The&amp;nbsp;DMA is supposed to&amp;nbsp;push&amp;nbsp;parallel data from memory to the GPIO's MPIN port, with the register updated&amp;nbsp;once every CTIMER/match1 trigger. But the config that worked seems to go through all the transfers (1000) without pausing between triggers.&amp;nbsp;&lt;/STRONG&gt;Increasing the matchValue or slowing the input clock seems to have no effect (the output square wave is behaving as expected).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Some observations/questions:&lt;/P&gt;&lt;P&gt;Q.&amp;nbsp;&lt;STRONG&gt;kDMA_RisingEdgeTrigger&lt;/STRONG&gt; doesn't seem to work at all&amp;nbsp;for this&amp;nbsp;type of hardware trigger (CTIMER's). The DMA transfer never starts. Also tried:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;CTIMER0-&amp;gt;IR = 0xFF;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;to clear any active DMA request (UM mentions it clears both interrupts and DMA requests) to create a new rising edge but nothing. Any reason why?&amp;nbsp;&lt;SPAN&gt;&lt;STRONG&gt;kDMA_LowLevelTrigger&lt;/STRONG&gt; too doesn't working so I am assuming the DMA trigger is never going low? &lt;STRONG&gt;Is there some bit to be set to make the DMA controller clear the request after every trigger?&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Q.&amp;nbsp;Setting&amp;nbsp;&lt;STRONG&gt;PERIPHREQEN&lt;/STRONG&gt; (with kDMA_MemoryToPeripheral) too stops it from triggering. This might not be relevant as we aren't interfacing with any peripheral and is simply a MemoryToMemory transfer. But UM mentions:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;"Once triggered, transfer on a channel will be paced by DMA requests if the&lt;BR /&gt;PERIPHREQEN bit in the related CFG register is set. Otherwise, the transfer will proceed&lt;BR /&gt;at full speed."&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;while the DMA transfer config mentions the pacing can be controlled by the hardware triggers&amp;nbsp;using trigger burst settings. Are the trigger burst settings referring to DMA triggers or DMA requests as mentioned under peripherals?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Q.&amp;nbsp;CTIMER's section in the UM mentions&amp;nbsp;&lt;STRONG&gt;DMA requests&lt;/STRONG&gt; while the INPUTMUX for DMA mentions them to be &lt;STRONG&gt;DMA triggers,&amp;nbsp;&lt;/STRONG&gt;not requests. The wording is really confusing at times. This makes it slightly clear:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;Up to two match registers can be used to generate DMA requests. These are&lt;BR /&gt;connected to DMA trigger inputs on this device.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;But it is still confusing as something like the SPI interface mentions that they generate DMA requests AND are connected to DMA controllers requests "port".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Q. For any general application requiring memory-to-memory DMA transfer, what other method do I have to pace the transfers to an internal counter? Are requests the only way to pace DMA transfers? Is there any advantage to using SCTimers rather CTIMERS for this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EDIT:&lt;/P&gt;&lt;P&gt;It seems to pace the requests properly when I use:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;channelTrigger.type = kDMA_HighLevelTrigger;&lt;BR /&gt; channelTrigger.burst = &lt;STRONG&gt;kDMA_SingleTransfer&lt;/STRONG&gt;;&lt;BR /&gt; channelTrigger.wrap = kDMA_NoWrap;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;So &lt;STRONG&gt;kDMA_LevelBurstTransfer was the problem&lt;/STRONG&gt; before.&amp;nbsp; The clocking seems to be perfect now,&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;but it still doesn't work with EdgeTrigger. Now to make a gapless/callback-free ping-pong transfer for this...&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 25 Jun 2020 03:23:33 GMT</pubDate>
    <dc:creator>hemanth1</dc:creator>
    <dc:date>2020-06-25T03:23:33Z</dc:date>
    <item>
      <title>CTIMER DMA requests/triggers, pacing the transfers</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/CTIMER-DMA-requests-triggers-pacing-the-transfers/m-p/1088948#M41752</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I got a DMA0 channel to successfully trigger from a CTIMER0 trigger source. The setup is as follows (using a custom board, not EVAL):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. CTIMER0 with match1, with a capture input as source (10 MHz clock). Also successfully outputs to an External match output as a 5 MHz square wave by matching for 1 and resetting after.&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;ctimer_config_t config;&lt;BR /&gt; CTIMER_GetDefaultConfig(&amp;amp;config);&lt;BR /&gt; config.mode = kCTIMER_IncreaseOnRiseEdge;&lt;BR /&gt; config.input = kCTIMER_Capture_0;&lt;BR /&gt; config.prescale = 1;&lt;BR /&gt; CTIMER_Init(CTIMER0, &amp;amp;config);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ctimer_match_config_t matchConfig;&lt;BR /&gt; matchConfig.enableCounterReset = true;&lt;BR /&gt; matchConfig.enableCounterStop = false;&lt;BR /&gt; matchConfig.matchValue = 1;&lt;BR /&gt; matchConfig.outControl = kCTIMER_Output_Toggle;&lt;BR /&gt; matchConfig.outPinInitState = true;&lt;BR /&gt; matchConfig.enableInterrupt = false;&lt;BR /&gt; CTIMER_SetupMatch(CTIMER0, kCTIMER_Match_1, &amp;amp;matchConfig);&lt;BR /&gt; CTIMER_StartTimer(CTIMER0);&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. INPUTMUX configured to connect CTIMER0's Match1 trigger to DMA0's channel 0.&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;INPUTMUX_AttachSignal(INPUTMUX, 0, kINPUTMUX_Ctimer0M1ToDma0);&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. Setup DMA0's channel 0 with the following config:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;dma_channel_trigger_t channelTrigger;&lt;BR /&gt; channelTrigger.type = kDMA_HighLevelTrigger; //or kDMA_RisingEdgeTrigger&lt;BR /&gt; channelTrigger.burst = &lt;SPAN style="background-color: #f6f6f6;"&gt;kDMA_LevelBurstTransfer&lt;/SPAN&gt;; //or &lt;SPAN style="background-color: #f6f6f6;"&gt;kDMA_EdgeBurstTransfer1&lt;/SPAN&gt;&lt;BR /&gt; channelTrigger.wrap = kDMA_NoWrap;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;dma_channel_config_t transferConfig;&lt;BR /&gt; DMA_Init(DMA0);&lt;BR /&gt; DMA_CreateHandle(&amp;amp;g_DMA_Handle, DMA0, 0);&lt;BR /&gt; DMA_EnableChannel(DMA0, 0);&lt;BR /&gt; DMA_SetCallback(&amp;amp;g_DMA_Handle, DMA_Callback, NULL);&lt;/P&gt;&lt;P&gt;DMA_PrepareChannelTransfer(&amp;amp;transferConfig, s_srcBuffer, (uint32_t*)&amp;amp;GPIO-&amp;gt;MPIN[0],&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;DMA_CHANNEL_XFER(false, false, true, false, kDMA_Transfer32BitWidth,&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;kDMA_AddressInterleave1xWidth, kDMA_AddressInterleave0xWidth, 4000),&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;kDMA_MemoryToMemory, &amp;amp;channelTrigger, NULL);&lt;/P&gt;&lt;P&gt;DMA_SubmitChannelTransfer(&amp;amp;g_DMA_Handle, &amp;amp;transferConfig);&lt;BR /&gt; DMA_StartTransfer(&amp;amp;g_DMA_Handle);&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;The&amp;nbsp;DMA is supposed to&amp;nbsp;push&amp;nbsp;parallel data from memory to the GPIO's MPIN port, with the register updated&amp;nbsp;once every CTIMER/match1 trigger. But the config that worked seems to go through all the transfers (1000) without pausing between triggers.&amp;nbsp;&lt;/STRONG&gt;Increasing the matchValue or slowing the input clock seems to have no effect (the output square wave is behaving as expected).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Some observations/questions:&lt;/P&gt;&lt;P&gt;Q.&amp;nbsp;&lt;STRONG&gt;kDMA_RisingEdgeTrigger&lt;/STRONG&gt; doesn't seem to work at all&amp;nbsp;for this&amp;nbsp;type of hardware trigger (CTIMER's). The DMA transfer never starts. Also tried:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;CTIMER0-&amp;gt;IR = 0xFF;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;to clear any active DMA request (UM mentions it clears both interrupts and DMA requests) to create a new rising edge but nothing. Any reason why?&amp;nbsp;&lt;SPAN&gt;&lt;STRONG&gt;kDMA_LowLevelTrigger&lt;/STRONG&gt; too doesn't working so I am assuming the DMA trigger is never going low? &lt;STRONG&gt;Is there some bit to be set to make the DMA controller clear the request after every trigger?&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Q.&amp;nbsp;Setting&amp;nbsp;&lt;STRONG&gt;PERIPHREQEN&lt;/STRONG&gt; (with kDMA_MemoryToPeripheral) too stops it from triggering. This might not be relevant as we aren't interfacing with any peripheral and is simply a MemoryToMemory transfer. But UM mentions:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;"Once triggered, transfer on a channel will be paced by DMA requests if the&lt;BR /&gt;PERIPHREQEN bit in the related CFG register is set. Otherwise, the transfer will proceed&lt;BR /&gt;at full speed."&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;while the DMA transfer config mentions the pacing can be controlled by the hardware triggers&amp;nbsp;using trigger burst settings. Are the trigger burst settings referring to DMA triggers or DMA requests as mentioned under peripherals?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Q.&amp;nbsp;CTIMER's section in the UM mentions&amp;nbsp;&lt;STRONG&gt;DMA requests&lt;/STRONG&gt; while the INPUTMUX for DMA mentions them to be &lt;STRONG&gt;DMA triggers,&amp;nbsp;&lt;/STRONG&gt;not requests. The wording is really confusing at times. This makes it slightly clear:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;Up to two match registers can be used to generate DMA requests. These are&lt;BR /&gt;connected to DMA trigger inputs on this device.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;But it is still confusing as something like the SPI interface mentions that they generate DMA requests AND are connected to DMA controllers requests "port".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Q. For any general application requiring memory-to-memory DMA transfer, what other method do I have to pace the transfers to an internal counter? Are requests the only way to pace DMA transfers? Is there any advantage to using SCTimers rather CTIMERS for this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EDIT:&lt;/P&gt;&lt;P&gt;It seems to pace the requests properly when I use:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;channelTrigger.type = kDMA_HighLevelTrigger;&lt;BR /&gt; channelTrigger.burst = &lt;STRONG&gt;kDMA_SingleTransfer&lt;/STRONG&gt;;&lt;BR /&gt; channelTrigger.wrap = kDMA_NoWrap;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;So &lt;STRONG&gt;kDMA_LevelBurstTransfer was the problem&lt;/STRONG&gt; before.&amp;nbsp; The clocking seems to be perfect now,&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;but it still doesn't work with EdgeTrigger. Now to make a gapless/callback-free ping-pong transfer for this...&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Jun 2020 03:23:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/CTIMER-DMA-requests-triggers-pacing-the-transfers/m-p/1088948#M41752</guid>
      <dc:creator>hemanth1</dc:creator>
      <dc:date>2020-06-25T03:23:33Z</dc:date>
    </item>
    <item>
      <title>Re: CTIMER DMA requests/triggers, pacing the transfers</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/CTIMER-DMA-requests-triggers-pacing-the-transfers/m-p/1088949#M41753</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Hemanth&lt;STRONG&gt; :smileyhappy:,&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;kDMA_RisingEdgeTrigger doesn't seem to work at all&amp;nbsp;for this&amp;nbsp;type of hardware trigger (CTIMER's). The DMA transfer never starts. Also tried:&lt;/P&gt;&lt;P&gt;CTIMER0-&amp;gt;IR = 0xFF;&lt;/P&gt;&lt;P&gt;to clear any active DMA request (UM mentions it clears both interrupts and DMA requests) to create a new rising edge but nothing. Any reason why?&amp;nbsp;kDMA_LowLevelTrigger too doesn't working so I am assuming the DMA trigger is never going low? Is there some bit to be set to make the DMA controller clear the request after every trigger?&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I have tried to replicate your issue&lt;STRONG&gt;&lt;EM&gt;. &lt;/EM&gt;&lt;/STRONG&gt;However the&amp;nbsp; high or low level triggers worked with my CTIMER and DMA&amp;nbsp; configurations. A single CTMER match triggered a DMA transfer&amp;nbsp; at full speed.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I attached my code just&amp;nbsp; as a reference, I can not guarantee it will also work&amp;nbsp; for you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;Setting&amp;nbsp;PERIPHREQEN (with kDMA_MemoryToPeripheral) too stops it from triggering. This might not be relevant as we aren't interfacing with any peripheral and is simply a MemoryToMemory transfer. But UM mentions:&lt;/P&gt;&lt;P&gt;"Once triggered, transfer on a channel will be paced by DMA requests if the&lt;/P&gt;&lt;P&gt;PERIPHREQEN bit in the related CFG register is set. Otherwise, the transfer will proceed&lt;/P&gt;&lt;P&gt;at full speed."&lt;/P&gt;&lt;P&gt;while the DMA transfer config mentions the pacing can be controlled by the hardware triggers&amp;nbsp;using trigger burst settings. Are the trigger burst settings referring to DMA triggers or DMA requests as mentioned under peripherals?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Since the CTIMER match is connected to the DMA channel interrupt input, After doing tests, I confirm your comments. After setting PERIPHREQEN, the DMA channel will wait a signal on its request input, if don´t arrives the trasnfer will not start.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The&amp;nbsp;TRIGBURST bit on the CFG register of DMA channels, refers to the DMA hardware triggers configured on level trigger mode.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;CTIMER's section in the UM mentions&amp;nbsp;DMA requests while the INPUTMUX for DMA mentions them to be DMA triggers,&amp;nbsp;not requests. The wording is really confusing at times. This makes it slightly clear:&lt;/P&gt;&lt;P&gt;Up to two match registers can be used to generate DMA requests. These are&lt;/P&gt;&lt;P&gt;connected to DMA trigger inputs on this device.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But it is still confusing as something like the SPI interface mentions that they generate DMA requests AND are connected to DMA controllers requests "port".&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Taking into account that each DMA channel have interrupt and request inputs.&lt;/P&gt;&lt;P&gt;&amp;nbsp;No matter if the CTIMER/SCtimer match request are mentioned as a DMA requests , they&amp;nbsp; are connected to the&amp;nbsp; DMA channels interrupt input using INPUTMUX registers.&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;For any general application requiring memory-to-memory DMA transfer, what other method do I have to pace the transfers to an internal counter?&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;As you may already considered, you&amp;nbsp; could enable the interrupt for a TIMER and Configure the DMA with SW trigger.&amp;nbsp; Then in the Timer&amp;nbsp; ISR trigger a DMA transfer. However using the timer directly trigger by hardware seems more efficient.&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;Are requests the only way to pace DMA transfers? Is there any advantage to using SCTimers rather CTIMERS for this?&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Well, since they can help you to trigger DMA transfers, we would have to check which characteristics of both can be worthy for your application.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From the DMA point of view I am thinking on that the CTIMER has more trigger options ( 9 ) than the SCTIMER&amp;nbsp; (2 ) as seen in the register DMA0_ITRIG_INMUX register.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If&amp;nbsp;&amp;nbsp; this helps, you could let me know.&lt;/P&gt;&lt;P&gt;Also,&amp;nbsp; I apologize for the delay on my response.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Diego.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 05 Jul 2020 05:58:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/CTIMER-DMA-requests-triggers-pacing-the-transfers/m-p/1088949#M41753</guid>
      <dc:creator>diego_charles</dc:creator>
      <dc:date>2020-07-05T05:58:31Z</dc:date>
    </item>
    <item>
      <title>Re: CTIMER DMA requests/triggers, pacing the transfers</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/CTIMER-DMA-requests-triggers-pacing-the-transfers/m-p/1088950#M41754</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is it possible to output a PWM wave-form via DMA to a CTIMER-&amp;gt;MR[] register? Where the DMA transfer is triggered by a CTIMER Match channel?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I Have the same problem Hemanth M is having. Where the complete transfer is done full speed even though I use&amp;nbsp;kDMA_SingleTransfer as burst type.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;ctimer_match_config_t matchConfigDMA;&lt;BR /&gt; matchConfigDMA.enableCounterReset = false;&lt;BR /&gt; matchConfigDMA.enableCounterStop = false;&lt;BR /&gt; matchConfigDMA.matchValue = 0;&lt;BR /&gt; matchConfigDMA.outControl = kCTIMER_Output_Toggle;&lt;BR /&gt; matchConfigDMA.outPinInitState = false;&lt;BR /&gt; matchConfigDMA.enableInterrupt = false;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// init first timer&lt;BR /&gt; ctimer_config_t config;&lt;BR /&gt; CTIMER_GetDefaultConfig(&amp;amp;config);&lt;BR /&gt; timerClock = CTIMERA_CLK_FREQ / (config.prescale + 1);&lt;BR /&gt; CTIMER_Init(CTIMER2, &amp;amp;config);&lt;BR /&gt; CTIMER_SetupPwm(CTIMER2, kCTIMER_Match_0, sineLookupTable[counta], PWM_FREQUENCY, timerClock, false);&lt;BR /&gt; CTIMER_SetupMatch(CTIMER2, kCTIMER_Match_1, &amp;amp;matchConfigDMA);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//** Attach CTimer Match request to DMA0**//&lt;BR /&gt; INPUTMUX_Init(INPUTMUX);&lt;BR /&gt; INPUTMUX_AttachSignal(INPUTMUX, 0, kINPUTMUX_Ctimer2M1ToDma0);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DMA_Init(DMA0);&lt;BR /&gt; DMA_CreateHandle(&amp;amp;g_DMA_Handle, DMA0, 0);&lt;BR /&gt; DMA_EnableChannel(DMA0, 0);&lt;BR /&gt; DMA_SetCallback(&amp;amp;g_DMA_Handle, DMA_Callback, NULL);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; dma_channel_trigger_t channelTrigger;&lt;BR /&gt; channelTrigger.burst = kDMA_SingleTransfer ;&lt;/P&gt;&lt;P&gt;/** select channel trigger **/&lt;BR /&gt; channelTrigger.type = kDMA_HighLevelTrigger ; /// a word transfer each CMTIMER match trigger&lt;/P&gt;&lt;P&gt;//** A complete transfer when a sigle trigger configuration */&lt;BR /&gt; //channelTrigger.type = kDMA_NoTrigger ;&lt;BR /&gt; //channelTrigger.type = kDMA_LowLevelTrigger;&lt;BR /&gt; //channelTrigger.type = kDMA_FallingEdgeTrigger;&lt;BR /&gt; //channelTrigger.type = kDMA_RisingEdgeTrigger;&lt;/P&gt;&lt;P&gt;channelTrigger.wrap = kDMA_NoWrap;&amp;nbsp;&lt;STRONG&gt;// Here I would like to enable SrcWrapping as well, when I do this however it starts incrementing the dst address... I'm assuming SrcWrapping makes the dma transfer contiguous.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;dma_channel_config_t transferConfig;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; DMA_PrepareChannelTransfer(&amp;amp;transferConfig, dmaOutputTableA, &amp;amp;CTIMER2-&amp;gt;MR[0],&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DMA_CHANNEL_XFER(false, false, true, false, 2, kDMA_AddressInterleave1xWidth, kDMA_AddressInterleave0xWidth, (SINESTEPS*2)),&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; kDMA_MemoryToMemory, &amp;amp;channelTrigger, NULL);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DMA_SubmitChannelTransfer(&amp;amp;g_DMA_Handle, &amp;amp;transferConfig);&lt;/P&gt;&lt;P&gt;DMA_StartTransfer(&amp;amp;g_DMA_Handle);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// create the DMA buffers&lt;BR /&gt; for (int idx = 0; idx &amp;lt; SINESTEPS; ++idx)&lt;BR /&gt; {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; dmaOutputTableA[idx] = (CTIMER2-&amp;gt;MR[kCTIMER_Match_3] * (uint32_t)sineLookupTable[idx]) / 100U;&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;CTIMER_StartTimer(CTIMER2);&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Jul 2020 16:22:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/CTIMER-DMA-requests-triggers-pacing-the-transfers/m-p/1088950#M41754</guid>
      <dc:creator>nick_ijzendoorn</dc:creator>
      <dc:date>2020-07-27T16:22:54Z</dc:date>
    </item>
    <item>
      <title>Re: CTIMER DMA requests/triggers, pacing the transfers</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/CTIMER-DMA-requests-triggers-pacing-the-transfers/m-p/1088951#M41755</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin: 0in; margin-left: .375in; font-size: 11.0pt;"&gt;Hi Nick,&lt;/P&gt;&lt;P style="margin: 0in; margin-left: .375in; font-size: 11.0pt;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="margin: 0in; margin-left: .375in; font-size: 11.0pt;"&gt;To&amp;nbsp; debug the issue ,&amp;nbsp; I could recommend you to :&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN style="font-size: 11.0pt;"&gt;Enable Ctimer Match interrupts&amp;nbsp; and place a breakpoint into the &lt;/SPAN&gt;&lt;EM style="font-size: 11.0pt; "&gt;CTimer Match Interrupt handler. &lt;/EM&gt;&lt;SPAN style="font-size: 11.0pt;"&gt;That way you can check the value that is being writtten on the destination register&amp;nbsp; on each&amp;nbsp; CTIMER match. &lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN style="font-size: 11.0pt;"&gt;Try to not configure&amp;nbsp; CTimer2 Match 0 for PWM&amp;nbsp; (avoid calling CTIMER_SetupPwm ), and verify that Ctimer Match 1 could generate&amp;nbsp; single word DMA transfer&amp;nbsp; on each match (using&amp;nbsp;&lt;/SPAN&gt;&lt;EM style="font-size: 11.0pt; "&gt;kDMA_HighLevelTrigger&lt;/EM&gt;&lt;SPAN style="font-size: 11.0pt;"&gt; and &lt;/SPAN&gt;&lt;EM style="font-size: 11.0pt; "&gt;kDMA_SingleTransfer&amp;nbsp;&lt;/EM&gt;&lt;SPAN style="font-size: 11.0pt;"&gt; ) . &lt;BR /&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN style="font-size: 11.0pt;"&gt;Check your CTimer2 Match1 configuration . For example, you could try to change&amp;nbsp;&lt;/SPAN&gt;&lt;EM style="font-size: 11.0pt; "&gt; .matchValue&lt;/EM&gt;&lt;SPAN style="font-size: 11.0pt;"&gt; from&amp;nbsp; 0&amp;nbsp; to&amp;nbsp; CTIMER_CLK_FREQ/2&amp;nbsp; and &amp;nbsp;.&lt;/SPAN&gt;&lt;EM style="font-size: 11.0pt; "&gt;enableCounterRese&lt;/EM&gt;&lt;SPAN style="font-size: 11.0pt;"&gt;t from&amp;nbsp; FALSE to TRUE. &lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/BLOCKQUOTE&gt;&lt;P style="margin: 0in; margin-left: .375in; font-size: 11.0pt;"&gt;As far I understand your application, it seems feasible from my point of view. However,&amp;nbsp; I do not have a similar example to share.&lt;/P&gt;&lt;P style="margin: 0in; margin-left: .375in; font-size: 11.0pt;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="margin: 0in; margin-left: .375in; font-size: 11.0pt;"&gt;Regards,&lt;/P&gt;&lt;P style="margin: 0in; margin-left: .375in; font-size: 11.0pt;"&gt;Diego&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 02 Aug 2020 22:27:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/CTIMER-DMA-requests-triggers-pacing-the-transfers/m-p/1088951#M41755</guid>
      <dc:creator>ie709758</dc:creator>
      <dc:date>2020-08-02T22:27:20Z</dc:date>
    </item>
    <item>
      <title>Re: CTIMER DMA requests/triggers, pacing the transfers</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/CTIMER-DMA-requests-triggers-pacing-the-transfers/m-p/1088952#M41756</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your reply, I made the wrong assumption the problem was that I tried to do 16bit word transfers instead of 32bit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For people who are interrested I included my main file which is now working.&lt;/P&gt;&lt;P&gt;The CTIMERs must be clocked at 150Mhz for the frequency calculation to go correctly.&lt;/P&gt;&lt;P&gt;For testing I connected a low pass RC filter to the PWM output pins.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Enabling the macro's USE_16BIT and/or USE_SRC_WRAPPING will break it though.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Aug 2020 11:55:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/CTIMER-DMA-requests-triggers-pacing-the-transfers/m-p/1088952#M41756</guid>
      <dc:creator>nick_ijzendoorn</dc:creator>
      <dc:date>2020-08-24T11:55:39Z</dc:date>
    </item>
    <item>
      <title>Re: CTIMER DMA requests/triggers, pacing the transfers</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/CTIMER-DMA-requests-triggers-pacing-the-transfers/m-p/2114575#M58362</link>
      <description>&lt;P&gt;Hello, I'm experiencing a similar problem. I've deeply read the Diego answer, but I need to deep in.&amp;nbsp;&lt;/P&gt;&lt;P&gt;As far I've understood every DMA channel has Requests and Triggers. Requests come from high speed peripherals, Triggers from 'events generator' peripherals. In the hypothesis of a Hardware Trigger, the sequence is the following (after the channel is initialized):&lt;/P&gt;&lt;P&gt;1 - The trigger enable the channel;&lt;/P&gt;&lt;P&gt;2 - Any change in the request enable a transfer (that can be configured as burst or single).&lt;/P&gt;&lt;P&gt;If all this is true, is the request flow, coming from the request wire, that define the pace of the transfer.&lt;/P&gt;&lt;P&gt;Is that all right?&lt;/P&gt;&lt;P&gt;So it's not possible, for instance, to transfer data from memory to a peripheral using a timer to set the pace of the transfer, but is the request itself that will set the pace based on the needs.&lt;/P&gt;&lt;P&gt;I've tried to configure the DMA to transfer one byte at the time from memory to a peripheral, using a ctimer match (Burst enabled, size 1 byte or burst disabled, single shot). If I enable and than disable the trigger from the running timer, on disable (?) I have just one transfer, and then everything stop.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Enabling the peripheral request and with single transfer having the channel peripheral with the DMA Request enabled, I got a Trigger set for the channel (in the channel status flag), one transfer on the trigger enable change, and then not anymore.&lt;/P&gt;&lt;P&gt;I'm trying to perform a move from memory to a gpio port at a selected speed, synchronized with the falling front of he clock, but I've not found any way to do it using the DMA.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There is something I'm missing?&lt;/P&gt;&lt;P&gt;Many thanks for any contribution&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jun 2025 15:24:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/CTIMER-DMA-requests-triggers-pacing-the-transfers/m-p/2114575#M58362</guid>
      <dc:creator>xs_graziano</dc:creator>
      <dc:date>2025-06-11T15:24:15Z</dc:date>
    </item>
  </channel>
</rss>

