<?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 Read ADC values using DMA in FRDM k64 in MQX Software Solutions</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/Read-ADC-values-using-DMA-in-FRDM-k64/m-p/598226#M16650</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;I am using FRDM K64 in MQX to read 32 values from ADC and find the avaerage of it using DMA.But i am not getting any reading at the buffer. when read from DMA.&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is my DMA setting.&amp;nbsp;&lt;/P&gt;&lt;P&gt;void Set_Dma(void)&lt;BR /&gt;{&lt;BR /&gt; // setup the DMA channels ( CH0 = playback and CH1 = buffer transfer )&lt;BR /&gt; DMA_CR = 0&lt;BR /&gt; | DMA_CR_EDBG_MASK // Stall DMA transfers when debugger is halted (avoid noise)&lt;BR /&gt; ; // no minor loop mapping&lt;/P&gt;&lt;P&gt;DMA_DCHPRI15 = 0; // just not to have same priorities&lt;BR /&gt; DMA_DCHPRI0 = 15; // cannot be pre-empeted, can pre-empt, highest priority&lt;/P&gt;&lt;P&gt;// fill the TCD area&lt;BR /&gt; DMA_TCD0_SADDR = (uint32_t)&amp;amp;ADC0_RA ; &lt;BR /&gt; DMA_TCD0_SOFF = 0; // 2 byte offset&lt;BR /&gt; DMA_TCD0_ATTR = DMA_ATTR_SMOD(0) | DMA_ATTR_SSIZE(1) | DMA_ATTR_DMOD(0) | DMA_ATTR_DSIZE(1); // no circular addressing S&amp;amp;D, 16 bit S&amp;amp;D&lt;BR /&gt; DMA_TCD0_NBYTES_MLNO = 2; // one 16bit sample every minor loop&lt;BR /&gt; DMA_TCD0_SLAST = 0;//-(DMA_BUF_SIZE*2); // source address will always be newly written before each new start DMA_TCD0_DADDR&lt;BR /&gt; DMA_TCD0_DADDR = (uint32_t) &amp;amp;BufferSource_A[0]; // the FTM Channel 0 duty value&lt;BR /&gt; DMA_TCD0_DOFF = 2;&lt;BR /&gt; DMA_TCD0_CITER_ELINKNO = DMA_BUF_SIZE; // total samples ( 32 )&lt;BR /&gt; DMA_TCD0_DLASTSGA = -64; &lt;BR /&gt; DMA_TCD0_CSR = DMA_CSR_INTMAJOR_MASK ; // interrupt when done&lt;BR /&gt; DMA_TCD0_BITER_ELINKNO = DMA_BUF_SIZE;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; // configure DMA_MUX to trigger DMA channel 0 with FTM2 CH1&lt;BR /&gt; Set_Dma_Mux();&lt;/P&gt;&lt;P&gt;// now enable chan0 for HW triggers&lt;BR /&gt; DMA_ERQ = DMA_ERQ_ERQ0_MASK ;&lt;BR /&gt; // Install DMA0 Major loop complete IRQ&lt;BR /&gt; _int_install_isr(INT_DMA0, dma_ch0_isr, NULL);&lt;BR /&gt; //_cortex_int_init(INT_DMA0, 3, TRUE);&lt;BR /&gt; _nvic_int_init(INT_DMA0, 3, TRUE);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;Can anyone tell me what is wrong in this??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tanks and Regards,&lt;/P&gt;&lt;P&gt;Olivia&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 20 Mar 2017 07:29:38 GMT</pubDate>
    <dc:creator>oliviachristyva</dc:creator>
    <dc:date>2017-03-20T07:29:38Z</dc:date>
    <item>
      <title>Read ADC values using DMA in FRDM k64</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Read-ADC-values-using-DMA-in-FRDM-k64/m-p/598226#M16650</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;I am using FRDM K64 in MQX to read 32 values from ADC and find the avaerage of it using DMA.But i am not getting any reading at the buffer. when read from DMA.&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is my DMA setting.&amp;nbsp;&lt;/P&gt;&lt;P&gt;void Set_Dma(void)&lt;BR /&gt;{&lt;BR /&gt; // setup the DMA channels ( CH0 = playback and CH1 = buffer transfer )&lt;BR /&gt; DMA_CR = 0&lt;BR /&gt; | DMA_CR_EDBG_MASK // Stall DMA transfers when debugger is halted (avoid noise)&lt;BR /&gt; ; // no minor loop mapping&lt;/P&gt;&lt;P&gt;DMA_DCHPRI15 = 0; // just not to have same priorities&lt;BR /&gt; DMA_DCHPRI0 = 15; // cannot be pre-empeted, can pre-empt, highest priority&lt;/P&gt;&lt;P&gt;// fill the TCD area&lt;BR /&gt; DMA_TCD0_SADDR = (uint32_t)&amp;amp;ADC0_RA ; &lt;BR /&gt; DMA_TCD0_SOFF = 0; // 2 byte offset&lt;BR /&gt; DMA_TCD0_ATTR = DMA_ATTR_SMOD(0) | DMA_ATTR_SSIZE(1) | DMA_ATTR_DMOD(0) | DMA_ATTR_DSIZE(1); // no circular addressing S&amp;amp;D, 16 bit S&amp;amp;D&lt;BR /&gt; DMA_TCD0_NBYTES_MLNO = 2; // one 16bit sample every minor loop&lt;BR /&gt; DMA_TCD0_SLAST = 0;//-(DMA_BUF_SIZE*2); // source address will always be newly written before each new start DMA_TCD0_DADDR&lt;BR /&gt; DMA_TCD0_DADDR = (uint32_t) &amp;amp;BufferSource_A[0]; // the FTM Channel 0 duty value&lt;BR /&gt; DMA_TCD0_DOFF = 2;&lt;BR /&gt; DMA_TCD0_CITER_ELINKNO = DMA_BUF_SIZE; // total samples ( 32 )&lt;BR /&gt; DMA_TCD0_DLASTSGA = -64; &lt;BR /&gt; DMA_TCD0_CSR = DMA_CSR_INTMAJOR_MASK ; // interrupt when done&lt;BR /&gt; DMA_TCD0_BITER_ELINKNO = DMA_BUF_SIZE;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; // configure DMA_MUX to trigger DMA channel 0 with FTM2 CH1&lt;BR /&gt; Set_Dma_Mux();&lt;/P&gt;&lt;P&gt;// now enable chan0 for HW triggers&lt;BR /&gt; DMA_ERQ = DMA_ERQ_ERQ0_MASK ;&lt;BR /&gt; // Install DMA0 Major loop complete IRQ&lt;BR /&gt; _int_install_isr(INT_DMA0, dma_ch0_isr, NULL);&lt;BR /&gt; //_cortex_int_init(INT_DMA0, 3, TRUE);&lt;BR /&gt; _nvic_int_init(INT_DMA0, 3, TRUE);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;Can anyone tell me what is wrong in this??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tanks and Regards,&lt;/P&gt;&lt;P&gt;Olivia&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Mar 2017 07:29:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Read-ADC-values-using-DMA-in-FRDM-k64/m-p/598226#M16650</guid>
      <dc:creator>oliviachristyva</dc:creator>
      <dc:date>2017-03-20T07:29:38Z</dc:date>
    </item>
    <item>
      <title>Re: Read ADC values using DMA in FRDM k64</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Read-ADC-values-using-DMA-in-FRDM-k64/m-p/598227#M16651</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Olivia:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would suggest you dump the adc and dma register value to check this issue. Have you enabled the DMA in ADC module? please check ADC0_SC2-&amp;gt;DMAEN.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In fact, MQX ADC driver doesn't include the DMA integration , but you can easily move a bare metal&amp;nbsp; project into your MQX project to handle it.&lt;/P&gt;&lt;P&gt;The below link might be help to use DMA and ADC&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/docs/DOC-102951"&gt;PIT- ADC- DMA Example for FRDM-KL25z, FRDM-K64F, TWR-K60D100 and TWR-K70&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Danniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Apr 2017 08:16:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Read-ADC-values-using-DMA-in-FRDM-k64/m-p/598227#M16651</guid>
      <dc:creator>danielchen</dc:creator>
      <dc:date>2017-04-26T08:16:09Z</dc:date>
    </item>
  </channel>
</rss>

