<?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: Problems with DMA in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problems-with-DMA/m-p/261935#M8163</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kenneth,&lt;/P&gt;&lt;P&gt;How about try the following code.&lt;/P&gt;&lt;P&gt;// Configure the DMA MUX and DMA controller module.&lt;/P&gt;&lt;P&gt;void dma_init(void)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp; SIM-&amp;gt;SCGC6 |= SIM_SCGC6_DMAMUX_MASK;&amp;nbsp; // Config DMA MUX &lt;/P&gt;&lt;P&gt;&amp;nbsp; SIM-&amp;gt;SCGC7 |= SIM_SCGC7_DMA_MASK;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // DMA controller&lt;/P&gt;&lt;P&gt;&amp;nbsp; DMA_ERQ &amp;amp;= ~(1&amp;lt;&amp;lt;0);&lt;/P&gt;&lt;P&gt;&amp;nbsp; DMAMUX0_CHCFG0 = DMAMUX_CHCFG_SOURCE_FTM0_CH0;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* transfer, making only a single minor loop necessary to complete a major loop */&lt;/P&gt;&lt;P&gt;&amp;nbsp; DMA_TCD0_SADDR = (uint32)(&amp;amp;FTM0_C0V); /* Set the Source Address */&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* Source offset disabled */&lt;/P&gt;&lt;P&gt;&amp;nbsp; DMA_TCD0_SOFF = 0x00;&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* Source and Destination Modulo off, source and destination size 1 = 16 bits */&lt;/P&gt;&lt;P&gt;&amp;nbsp; DMA_TCD0_ATTR = DMA_ATTR_SSIZE(1) | DMA_ATTR_DSIZE(1);&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* Transfer 2 bytes per transaction */&lt;/P&gt;&lt;P&gt;&amp;nbsp; DMA_TCD0_NBYTES_MLNO = 0x02;&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* No adjust needed */&lt;/P&gt;&lt;P&gt;&amp;nbsp; DMA_TCD0_SLAST = 0x00;&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* Destination address */&lt;/P&gt;&lt;P&gt;&amp;nbsp; DMA_TCD0_DADDR = (uint32)(&amp;amp;Data_Desti[0]);&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* Destination offset&amp;nbsp; */&lt;/P&gt;&lt;P&gt;&amp;nbsp; DMA_TCD0_DOFF = 0x02;&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* No link channel to channel, 1 transaction */&lt;/P&gt;&lt;P&gt;&amp;nbsp; DMA_TCD0_CITER_ELINKNO = DMA_CITER_ELINKNO_CITER(8);&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* No adjustment to destination address */&lt;/P&gt;&lt;P&gt;&amp;nbsp; DMA_TCD0_DLASTSGA = 0x00;&lt;/P&gt;&lt;P&gt;&amp;nbsp; DMA_TCD0_BITER_ELINKNO = DMA_BITER_ELINKNO_BITER(8); &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; DMA_TCD0_CSR |= (DMA_CSR_INTMAJOR_MASK|DMA_CSR_DREQ_MASK);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; DMAMUX0_CHCFG0 |=DMAMUX_CHCFG_ENBL_MASK;&lt;/P&gt;&lt;P&gt;&amp;nbsp; DMA_ERQ |=(1&amp;lt;&amp;lt;0);&lt;/P&gt;&lt;P&gt;&amp;nbsp; fnEnterInterrupt(irq_DMA0_ID, PRIORITY_DMA0, dma0_isr);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;If you still have question, please contact with without hesitate.&lt;/P&gt;&lt;P&gt;Good luck.&lt;/P&gt;&lt;P&gt;Ping.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 13 Nov 2013 08:23:35 GMT</pubDate>
    <dc:creator>jeremyzhou</dc:creator>
    <dc:date>2013-11-13T08:23:35Z</dc:date>
    <item>
      <title>Problems with DMA</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problems-with-DMA/m-p/261925#M8153</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi... Another post by me, because some of the other threads wasn't answered &lt;IMG alt="Smiley Wink" class="emoticon emoticon-smileywink" id="smileywink" src="https://community.nxp.com/i/smilies/16x16_smiley-wink.png" title="Smiley Wink" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to make DMA work using flextimer on a K60. I just made a basic example as I needed to understand the fundamental in setting up DMA.&lt;/P&gt;&lt;P&gt;The problem is that nothing works. I have checked the registers and they are correctly set up. Do I miss something or what do I do wrong here?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="c++" __jive_macro_name="code" class="_jivemacro_uid_13837283893284681 jive_text_macro jive_macro_code" jivemacro_uid="_13837283893284681"&gt;
&lt;P&gt;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;uint16 Data_Desti[8];&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //destination data space&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Initialisation of timer and interrupts&lt;/P&gt;&lt;P&gt;void ftm_init(void)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp; POWER_UP(6, SIM_SCGC6_FTM0); // Enable timer&lt;/P&gt;&lt;P&gt;&amp;nbsp; PORTC_PCR1 = PC_1_FTM0_CH0; // Multiplexer (MUX) for flextimer (FTM) initialized to port FTM0 and channel 0&amp;nbsp; (route the desired signal to the pin)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; FTM0_MODE = (FTM_MODE_WPDIS | FTM_MODE_FTMEN); // Disable write protection&lt;/P&gt;&lt;P&gt;&amp;nbsp; FTM0_CONF = FTM_CONF_BDMMODE_3; // FTM_DEBUG_BEHAVIOUR: Allow timer to continue operating when debugging&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; FTM0_CNTIN = 0x0000; // Counter initial value&lt;/P&gt;&lt;P&gt;&amp;nbsp; FTM0_MOD = 0xFFFF; // Modulo to max&lt;/P&gt;&lt;P&gt;&amp;nbsp; FTM0_C0SC = ( FTM_CSC_ELSA | FTM_CSC_DMA);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; FTM0_SC = (FTM_SC_CLKS_SYS | FTM_SC_PS_128 | FTM_SC_TOIE); // Sets the source to system clock and define the prescalar. Timer overflow interrupt enabled (1)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; fnEnterInterrupt(irq_FTM0_ID, PRIORITY_HW_TIMER, ftm0_isr); //Configure and enter the ftm0 handling interrupt routine in the vector table &lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Configure the DMA MUX and DMA controller module.&lt;/P&gt;&lt;P&gt;void dma_init(void)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp; // Config DMA MUX &lt;/P&gt;&lt;P&gt;&amp;nbsp; POWER_UP(6, SIM_SCGC6_DMAMUX0);&lt;/P&gt;&lt;P&gt;&amp;nbsp; // Config DMA controller&lt;/P&gt;&lt;P&gt;&amp;nbsp; POWER_UP(7, SIM_SCGC7_DMA);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; DMAMUX0_CHCFG0 = (DMAMUX_CHCFG_ENBL | DMAMUX_CHCFG_SOURCE_FTM0_CH0);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; //DMA_CR = (DMA_CR_EMLM| DMA_CR_EDBG);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; DMA_TCD0_SADDR = (uint32)(&amp;amp;FTM0_C0V); &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; DMA_TCD0_DADDR = (uint32)(&amp;amp;Data_Desti[0]); // Destination address&lt;/P&gt;&lt;P&gt;&amp;nbsp; DMA_TCD0_DOFF = 2; // Destination address incremented by two bytes (16 bit)&lt;/P&gt;&lt;P&gt;&amp;nbsp; DMA_TCD0_DLASTSGA = -32; // Restores the destination address to the initial value (2*16bit)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; DMA_TCD0_BITER_ELINKNO = 0x01; // Channel Linking Disabled&lt;/P&gt;&lt;P&gt;&amp;nbsp; DMA_TCD0_CITER_ELINKNO = 0x01; // Channel Linking Disabled&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; DMA_TCD0_NBYTES_MLNO = 8; // Transfer 8 bytes per transaction&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; DMA_TCD0_ATTR = (DMA_TCD_ATTR_DSIZE_8 /*| DMA_TCD_ATTR_SSIZE_8*/); // Source and Destination modulu&lt;/P&gt;&lt;P&gt;&amp;nbsp; DMA_TCD0_CSR = (DMA_TCD_CSR_DREQ | DMA_TCD_CSR_INTMAJOR); //The end-of-major loop interrupt is enabled&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; DMA_ERQ = DMA_ERQ_ERQ0;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; fnEnterInterrupt(irq_DMA0_ID, PRIORITY_DMA0, dma0_isr); &lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Interrupt service routine&lt;/P&gt;&lt;P&gt;static __interrupt void ftm0_isr(void)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp; if(FTM0_SC &amp;amp; FTM_SC_TOF)&lt;/P&gt;&lt;P&gt;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp; FTM0_SC &amp;amp;= ~FTM_SC_TOF;&lt;/P&gt;&lt;P&gt;&amp;nbsp; OVFcnt++;&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;static __interrupt void dma0_isr(void)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp; //DMA_CINT = DMA_INT_INT0;&lt;/P&gt;&lt;P&gt;&amp;nbsp; DMAMUX0_CHCFG0= 0;&lt;/P&gt;&lt;P&gt;&amp;nbsp; DMA_INT = 0x01;&lt;/P&gt;&lt;P&gt;&amp;nbsp; DMA_CDNE = 0x01;&lt;/P&gt;&lt;P&gt;&amp;nbsp; for(i=0;i&amp;lt;8;i++)&lt;/P&gt;&lt;P&gt;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp; fnDebugDec(i, sizeof(i));&lt;/P&gt;&lt;P&gt;&amp;nbsp; fnDebugMsg(") cnt=");&lt;/P&gt;&lt;P&gt;&amp;nbsp; fnDebugDec(Data_Desti[i], sizeof(Data_Desti));&lt;/P&gt;&lt;P&gt;&amp;nbsp; fnDebugMsg("\r\n");&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Nov 2020 13:03:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problems-with-DMA/m-p/261925#M8153</guid>
      <dc:creator>kenrenjen</dc:creator>
      <dc:date>2020-11-02T13:03:46Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with DMA</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problems-with-DMA/m-p/261926#M8154</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kenneth,&lt;/P&gt;&lt;P&gt;I have some questions to make sure:&lt;/P&gt;&lt;P&gt;1. whether your FTM capture fuction is ok(without DMA)?&lt;/P&gt;&lt;P&gt;2. Could you tell me you K60 chip full number?&lt;/P&gt;&lt;P&gt;3.Maybe you can upload your project, for the convenience to our test.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards!&lt;/P&gt;&lt;P&gt;Jing&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Nov 2013 06:16:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problems-with-DMA/m-p/261926#M8154</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2013-11-07T06:16:21Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with DMA</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problems-with-DMA/m-p/261927#M8155</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jing&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the answer on the questions:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1: The FTM timer works without DMA. I want to eleminate number of interrupts by using DMA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2: The K60 I use is&amp;nbsp; K60FN1M0 (Using TWR-K60F120M module)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. I have attached the project. I am using uTasker. The task and initialization of DMA and FTM is in the file ir_start.c&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for taking your time :smileyhappy:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Kenneth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Nov 2013 07:21:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problems-with-DMA/m-p/261927#M8155</guid>
      <dc:creator>kenrenjen</dc:creator>
      <dc:date>2013-11-07T07:21:01Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with DMA</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problems-with-DMA/m-p/261928#M8156</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Keneth,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would start by checking that the input capture mode works without the DMA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After that configure the DMA as desired. A few comments in regards your configuration:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;DMA_TCD0_NBYTES_MLNO = 8;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This configuration sets that you will transfer 8 bytes each trigger. But I believe that you need to transfer only 16bits this measn 2 bytes, correct?&lt;/P&gt;&lt;P&gt;Therefore I think instead of 8 it should be 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;DMA_TCD0_DLASTSGA = -32&lt;/SPAN&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This value is given in bytes, this means that you are returning 32 bytes the pointer from the destination. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3) The BITER and CITER represent the number of iterations per major loop. Therefore this value should be equal to the number of elements of your destination buffer. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4) The DSIZE and SSIZE should be set for a 16bit destiny and source size. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope that helps,&lt;/P&gt;&lt;P&gt;Alejandro&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Nov 2013 18:06:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problems-with-DMA/m-p/261928#M8156</guid>
      <dc:creator>alejandrolozan1</dc:creator>
      <dc:date>2013-11-07T18:06:25Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with DMA</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problems-with-DMA/m-p/261929#M8157</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Alejandro&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for the reply. The FTM works fine with interrupts so that should be correct.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am a little bit confused about point 1 and 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My destination is an array of 8 elements each 16bits so as i understood &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;DMA_TCD0_NBYTES_MLNO &lt;/SPAN&gt;is that it should contain the buffer size because the DMA_TCD0_DOFF is already set to 2 bytes? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Should DMA_TCD0_DLASTSGA then be -16 instead of -32 because&amp;nbsp; it needs to restore 2bytes * 8elements? Or do I misunderstood it?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;My code is now changed but still not working:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;uint16 Data_Desti[8];&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;void dma_init(void)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp; POWER_UP(6, SIM_SCGC6_DMAMUX0);&lt;/P&gt;&lt;P&gt;&amp;nbsp; POWER_UP(7, SIM_SCGC7_DMA);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; DMAMUX0_CHCFG0 = (DMAMUX_CHCFG_ENBL | DMAMUX_CHCFG_SOURCE_FTM0_CH0);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; DMA_TCD0_SADDR = (uint16)(&amp;amp;FTM0_C0V); &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; DMA_TCD0_DADDR = (uint16)(&amp;amp;Data_Desti[0]); // Destination address&lt;/P&gt;&lt;P&gt;&amp;nbsp; DMA_TCD0_DOFF = 2; // Destination address incremented by two bytes (16 bit)&lt;/P&gt;&lt;P&gt;&amp;nbsp; DMA_TCD0_DLASTSGA = -16; // Restores the destination address to the initial value (2*8bit)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; DMA_TCD0_BITER_ELINKNO = 8; // Channel Linking Disabled&lt;/P&gt;&lt;P&gt;&amp;nbsp; DMA_TCD0_CITER_ELINKNO = 8; // Channel Linking Disabled&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; DMA_TCD0_NBYTES_MLNO = 2; // Transfer 2 bytes per transaction&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; DMA_TCD0_ATTR = (DMA_TCD_ATTR_DSIZE_16 | DMA_TCD_ATTR_SSIZE_16); // Source and Destination modulu&lt;/P&gt;&lt;P&gt;&amp;nbsp; DMA_TCD0_CSR = (DMA_TCD_CSR_DREQ | DMA_TCD_CSR_INTMAJOR); //The end-of-major loop interrupt is enabled&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; DMA_ERQ = DMA_ERQ_ERQ0;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; fnEnterInterrupt(irq_DMA0_ID, PRIORITY_DMA0, dma0_isr); &lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Nov 2013 07:28:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problems-with-DMA/m-p/261929#M8157</guid>
      <dc:creator>kenrenjen</dc:creator>
      <dc:date>2013-11-08T07:28:59Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with DMA</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problems-with-DMA/m-p/261930#M8158</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I still need help for this please...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Kenneth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Nov 2013 12:16:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problems-with-DMA/m-p/261930#M8158</guid>
      <dc:creator>kenrenjen</dc:creator>
      <dc:date>2013-11-11T12:16:22Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with DMA</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problems-with-DMA/m-p/261931#M8159</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kenneth,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What kind of behavior you are looking?&lt;/P&gt;&lt;P&gt;Have you tried to use different destination and source buffers? just to see what is going on.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please give me more details about the behavior.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Alejandro&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Nov 2013 00:03:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problems-with-DMA/m-p/261931#M8159</guid>
      <dc:creator>alejandrolozan1</dc:creator>
      <dc:date>2013-11-12T00:03:46Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with DMA</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problems-with-DMA/m-p/261932#M8160</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Alejandro&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want the timestamp recorded in the FTM_C0V register to be stored in the destination buffer during DMA. When the buffer is full I just try to print it out.&lt;/P&gt;&lt;P&gt;I just made this for making the DMA transfering work. But nothing seems to happen at all. There is no elements in the destination buffer even though the timer detects multiple rising edges and updates the register properly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not sure what details you want about the behaviour. I have setup the flextimer and routed it to the pin on the MCU. It is tested with channel interrupts and works. I just want to make a single transfer from FTM_C0V register to destination buffer to test that the DMA works.&lt;/P&gt;&lt;P&gt;I tried to have a source buffer with some constants, but again nothing happes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I thought by enabling DMA transfer in the timer setting and setting up the DMA controller should be enough, but I have no idea what is missing or what is wrong.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Kenneth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Nov 2013 12:00:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problems-with-DMA/m-p/261932#M8160</guid>
      <dc:creator>kenrenjen</dc:creator>
      <dc:date>2013-11-12T12:00:26Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with DMA</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problems-with-DMA/m-p/261933#M8161</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kenneth,&lt;/P&gt;&lt;P&gt;I'm sorry for late response. From you mentioned in last emails, I think you want to use DMA to transfer the FTM_C0V to an array of 8 elements each 16bits until the array is full, then DMA interrupt happen and print out the data in array, isn’t right? If your answer is yes, I think I could send you a demo code and wish can help.&lt;/P&gt;&lt;P&gt;I’m looking forward your reply and apologize for late reply again.&lt;/P&gt;&lt;P&gt;Ping&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Nov 2013 06:48:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problems-with-DMA/m-p/261933#M8161</guid>
      <dc:creator>jeremyzhou</dc:creator>
      <dc:date>2013-11-13T06:48:50Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with DMA</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problems-with-DMA/m-p/261934#M8162</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ping&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your reply. That's exactly what I tried to do, so if you can sent me a demo code, it would be really great. &lt;/P&gt;&lt;P&gt;I've tried different examples, like ADC scan using DMA and PIT using DMA, but they didn't make sense to me. I hope your example can help me.&lt;/P&gt;&lt;P&gt;I appreciate it. Thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Kenneth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Nov 2013 07:00:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problems-with-DMA/m-p/261934#M8162</guid>
      <dc:creator>kenrenjen</dc:creator>
      <dc:date>2013-11-13T07:00:28Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with DMA</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problems-with-DMA/m-p/261935#M8163</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kenneth,&lt;/P&gt;&lt;P&gt;How about try the following code.&lt;/P&gt;&lt;P&gt;// Configure the DMA MUX and DMA controller module.&lt;/P&gt;&lt;P&gt;void dma_init(void)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp; SIM-&amp;gt;SCGC6 |= SIM_SCGC6_DMAMUX_MASK;&amp;nbsp; // Config DMA MUX &lt;/P&gt;&lt;P&gt;&amp;nbsp; SIM-&amp;gt;SCGC7 |= SIM_SCGC7_DMA_MASK;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // DMA controller&lt;/P&gt;&lt;P&gt;&amp;nbsp; DMA_ERQ &amp;amp;= ~(1&amp;lt;&amp;lt;0);&lt;/P&gt;&lt;P&gt;&amp;nbsp; DMAMUX0_CHCFG0 = DMAMUX_CHCFG_SOURCE_FTM0_CH0;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* transfer, making only a single minor loop necessary to complete a major loop */&lt;/P&gt;&lt;P&gt;&amp;nbsp; DMA_TCD0_SADDR = (uint32)(&amp;amp;FTM0_C0V); /* Set the Source Address */&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* Source offset disabled */&lt;/P&gt;&lt;P&gt;&amp;nbsp; DMA_TCD0_SOFF = 0x00;&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* Source and Destination Modulo off, source and destination size 1 = 16 bits */&lt;/P&gt;&lt;P&gt;&amp;nbsp; DMA_TCD0_ATTR = DMA_ATTR_SSIZE(1) | DMA_ATTR_DSIZE(1);&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* Transfer 2 bytes per transaction */&lt;/P&gt;&lt;P&gt;&amp;nbsp; DMA_TCD0_NBYTES_MLNO = 0x02;&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* No adjust needed */&lt;/P&gt;&lt;P&gt;&amp;nbsp; DMA_TCD0_SLAST = 0x00;&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* Destination address */&lt;/P&gt;&lt;P&gt;&amp;nbsp; DMA_TCD0_DADDR = (uint32)(&amp;amp;Data_Desti[0]);&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* Destination offset&amp;nbsp; */&lt;/P&gt;&lt;P&gt;&amp;nbsp; DMA_TCD0_DOFF = 0x02;&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* No link channel to channel, 1 transaction */&lt;/P&gt;&lt;P&gt;&amp;nbsp; DMA_TCD0_CITER_ELINKNO = DMA_CITER_ELINKNO_CITER(8);&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* No adjustment to destination address */&lt;/P&gt;&lt;P&gt;&amp;nbsp; DMA_TCD0_DLASTSGA = 0x00;&lt;/P&gt;&lt;P&gt;&amp;nbsp; DMA_TCD0_BITER_ELINKNO = DMA_BITER_ELINKNO_BITER(8); &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; DMA_TCD0_CSR |= (DMA_CSR_INTMAJOR_MASK|DMA_CSR_DREQ_MASK);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; DMAMUX0_CHCFG0 |=DMAMUX_CHCFG_ENBL_MASK;&lt;/P&gt;&lt;P&gt;&amp;nbsp; DMA_ERQ |=(1&amp;lt;&amp;lt;0);&lt;/P&gt;&lt;P&gt;&amp;nbsp; fnEnterInterrupt(irq_DMA0_ID, PRIORITY_DMA0, dma0_isr);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;If you still have question, please contact with without hesitate.&lt;/P&gt;&lt;P&gt;Good luck.&lt;/P&gt;&lt;P&gt;Ping.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Nov 2013 08:23:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problems-with-DMA/m-p/261935#M8163</guid>
      <dc:creator>jeremyzhou</dc:creator>
      <dc:date>2013-11-13T08:23:35Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with DMA</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problems-with-DMA/m-p/261936#M8164</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ping&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your fast reply.. I tried your code (which seems similar to mine almost) but still no transfer happen to buffer, when there is an channel input on the FTM.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;I have tested FTM and it works properly.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Nov 2013 09:21:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problems-with-DMA/m-p/261936#M8164</guid>
      <dc:creator>kenrenjen</dc:creator>
      <dc:date>2013-11-13T09:21:18Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with DMA</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problems-with-DMA/m-p/261937#M8165</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kenneth,&lt;/P&gt;&lt;P&gt;I'm sorry to hear that and I'll test the demo with my board as soon as possible. So be patient.&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Ping&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Nov 2013 01:06:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problems-with-DMA/m-p/261937#M8165</guid>
      <dc:creator>jeremyzhou</dc:creator>
      <dc:date>2013-11-14T01:06:33Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with DMA</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problems-with-DMA/m-p/261938#M8166</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ping&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I found the mistake and now it works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One of them was the configuration of the timer. A "stupid" mistake, because i misunderstood the documentation. I had to enable channel interrupts even though that I have enabled DMA transfer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another mistake was that:&lt;/P&gt;&lt;P&gt;DMA_TCD0_CITER_ELINKNO = 0x08;&lt;/P&gt;&lt;P&gt;DMA_TCD0_BITER_ELINKNO = 0x08;&lt;/P&gt;&lt;P&gt;needed to be changed to 8 byte instead of 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I appreciate your help very much. Now I'm much closer to my goal than ever before :smileywink:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One last question. Am I able to trigger DMA on a timer overflow? Or is there a way (without interrupts) to do that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again :smileyhappy:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Kenneth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Nov 2013 12:47:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problems-with-DMA/m-p/261938#M8166</guid>
      <dc:creator>kenrenjen</dc:creator>
      <dc:date>2013-11-14T12:47:30Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with DMA</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problems-with-DMA/m-p/261939#M8167</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kenneth,&lt;/P&gt;&lt;P&gt;I'm so glad to hear that you have figured out the problem. To your another question, Are your want to trigger the DMA transfer data when the FTM counter overflow or want the periodic trigger the DMA capability?&lt;/P&gt;&lt;P&gt;I'm looking forward to your reply.&lt;/P&gt;&lt;P&gt;BY&lt;/P&gt;&lt;P&gt;Ping&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Nov 2013 03:21:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problems-with-DMA/m-p/261939#M8167</guid>
      <dc:creator>jeremyzhou</dc:creator>
      <dc:date>2013-11-15T03:21:25Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with DMA</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problems-with-DMA/m-p/261940#M8168</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ping&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Right now DMA copies the timestamp for each rising edges. My problem is that the timer is 16bit and overflows very often. I therefor want to store/count or just move a pointer, to see the number of overflows. Also so I know when the overflow appeared. .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I just want to know if this is possible to do using flextimer. I would be nice if I could set up the DMA to trigger also when the timeroverflow happens, but it seems like I only can set it up to trigger DMA on inputs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Kenneth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Nov 2013 06:57:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problems-with-DMA/m-p/261940#M8168</guid>
      <dc:creator>kenrenjen</dc:creator>
      <dc:date>2013-11-15T06:57:21Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with DMA</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problems-with-DMA/m-p/261941#M8169</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kenneth,&lt;/P&gt;&lt;P&gt;I have known your purpos which record the times of overflow happens meanwhile rising edges still trigger DMA transfer FTM0_CnV to destination array. I think it's available to do it and can you show me your configuration code of the Fiextimer, then I can help you to figure out the proble。&lt;/P&gt;&lt;P&gt;I‘m looking forward to your reply.&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Ping&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Nov 2013 02:50:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problems-with-DMA/m-p/261941#M8169</guid>
      <dc:creator>jeremyzhou</dc:creator>
      <dc:date>2013-11-18T02:50:00Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with DMA</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problems-with-DMA/m-p/261942#M8170</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ping&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the configuration of the flextimer along with the DMA controller:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void ftm_init(void)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp; POWER_UP(6, SIM_SCGC6_FTM0); // Enable timer&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; PORTC_PCR1 = PC_1_FTM0_CH0 | PORT_LOCK; // (PTC1) Multiplexer (MUX) for flextimer (FTM) initialized to port FTM0 and channel 0&amp;nbsp; (route the desired signal to the pin)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; FTM0_MODE = (FTM_MODE_WPDIS | FTM_MODE_FTMEN); // Disable write protection&lt;/P&gt;&lt;P&gt;&amp;nbsp; FTM0_CONF = FTM_CONF_BDMMODE_3; // FTM_DEBUG_BEHAVIOUR: Allow timer to continue operating when debugging&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; FTM0_CNTIN = 0x0000; // Counter initial value&lt;/P&gt;&lt;P&gt;&amp;nbsp; FTM0_MOD = 0xFFFF; // Modulo to max&lt;/P&gt;&lt;P&gt;&amp;nbsp; FTM0_C0SC = (FTM_CSC_ELSA | FTM_CSC_CHIE | FTM_CSC_DMA);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; FTM0_SC = (FTM_SC_CLKS_SYS | FTM_SC_PS_1 | FTM_SC_TOIE); // Sets the source to system clock and define the prescalar. Timer overflow interrupt enabled (1)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; fnEnterInterrupt(irq_FTM0_ID, PRIORITY_HW_TIMER, ftm0_isr); //Configure and enter the ftm0 handling interrupt routine in the vector table &lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Configure DMA multiplexer and DMA controller&lt;/P&gt;&lt;P&gt;void dma_init(void)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp; POWER_UP(6, SIM_SCGC6_DMAMUX0);&lt;/P&gt;&lt;P&gt;&amp;nbsp; POWER_UP(7, SIM_SCGC7_DMA);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; DMAMUX0_CHCFG0 = (DMAMUX_CHCFG_SOURCE_FTM0_CH0 | DMAMUX_CHCFG_ENBL);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* transfer, making only a single minor loop necessary to complete a major loop */&lt;/P&gt;&lt;P&gt;&amp;nbsp; DMA_TCD0_SADDR = (uint32)(&amp;amp;FTM0_C0V); // Set the Source Address&lt;/P&gt;&lt;P&gt;&amp;nbsp; DMA_TCD0_SOFF = 0; // Source offset disabled &lt;/P&gt;&lt;P&gt;&amp;nbsp; DMA_TCD0_SLAST = 0; // Last Source Address Adjustment - No adjust needed&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; DMA_TCD0_DADDR = (uint32)dma_buf; // Set the Destination Address &lt;/P&gt;&lt;P&gt;&amp;nbsp; DMA_TCD0_DOFF = sizeof(uint16); // Destination offset 2 bytes (Increments the address after transaction)&lt;/P&gt;&lt;P&gt;&amp;nbsp; DMA_TCD0_DLASTSGA = -(sizeof(uint16)*buffer_size); // Last Destination Address Adjustment (2 byte * array size)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; DMA_TCD0_NBYTES_MLNO = sizeof(uint16); // Transfer 2 bytes per transaction (16 bit)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* Source and Destination Modulo off, source and destination size 1 = 16 bits */&lt;/P&gt;&lt;P&gt;&amp;nbsp; DMA_TCD0_ATTR = DMA_TCD_ATTR_SSIZE_16_BIT | DMA_TCD_ATTR_DSIZE_16_BIT;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* No link channel to channel, number of transactions */&lt;/P&gt;&lt;P&gt;&amp;nbsp; DMA_TCD0_CITER_ELINKNO = buffer_size; // Current Minor Loop Link, Major Loop Count&lt;/P&gt;&lt;P&gt;&amp;nbsp; DMA_TCD0_BITER_ELINKNO = buffer_size; // Beginning Minor Loop Link, Major Loop Count&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; DMA_ERQ |= DMA_ERQ_ERQ0; // Enable DMA request on channel 0 &lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Nov 2013 07:46:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problems-with-DMA/m-p/261942#M8170</guid>
      <dc:creator>kenrenjen</dc:creator>
      <dc:date>2013-11-18T07:46:35Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with DMA</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problems-with-DMA/m-p/261943#M8171</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jensen,&lt;/P&gt;&lt;P&gt;I think your code is ok, Have you completed your target now?&lt;/P&gt;&lt;P&gt;I'm looking forward to your good news.&lt;/P&gt;&lt;P&gt;Ping&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Nov 2013 09:38:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problems-with-DMA/m-p/261943#M8171</guid>
      <dc:creator>jeremyzhou</dc:creator>
      <dc:date>2013-11-19T09:38:18Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with DMA</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problems-with-DMA/m-p/261944#M8172</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ping&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have not reached my goal yet, because of the timer overflow problem. I can't find a way to trigger DMA when a timer overflow appears. &lt;/P&gt;&lt;P&gt;Right now I copy in an ISR the count value into an array, whenever a timer overflow happens. This seems like a very bad solution as it is hard to determine when the overflow happen and I really need to be accurate in every input.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you have any idea of how to solve this, I would be glad to know :smileyhappy:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for all your help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Kenneth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Nov 2013 10:15:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problems-with-DMA/m-p/261944#M8172</guid>
      <dc:creator>kenrenjen</dc:creator>
      <dc:date>2013-11-19T10:15:09Z</dc:date>
    </item>
  </channel>
</rss>

