<?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: MK10DN512 ADC0 with DMA continuous mode not working! in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/MK10DN512-ADC0-with-DMA-continuous-mode-not-working/m-p/1234246#M59702</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Glad to hear that this issue is resolved from below post.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.nxp.com/t5/Kinetis-Microcontrollers/I-found-a-bug-on-the-DMA-code-for-the-MK10-family-or-did-I/m-p/1231692#M59644" target="_blank"&gt;https://community.nxp.com/t5/Kinetis-Microcontrollers/I-found-a-bug-on-the-DMA-code-for-the-MK10-family-or-did-I/m-p/1231692#M59644&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;
&lt;P&gt;Daniel&lt;/P&gt;</description>
    <pubDate>Mon, 22 Feb 2021 08:59:36 GMT</pubDate>
    <dc:creator>danielchen</dc:creator>
    <dc:date>2021-02-22T08:59:36Z</dc:date>
    <item>
      <title>MK10DN512 ADC0 with DMA continuous mode not working!</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/MK10DN512-ADC0-with-DMA-continuous-mode-not-working/m-p/1230080#M59601</link>
      <description>&lt;P&gt;I'm pulling my hair out here and I don't know what else to try.&lt;/P&gt;&lt;P&gt;I have a project I created for the &lt;STRONG&gt;MK10DC512VLQ10&lt;/STRONG&gt; where I need to configure ADC0 to work with DMA in continuous mode. The idea is to first make it work with the internal temp sensor and then with the real ADC inputs.&lt;/P&gt;&lt;P&gt;I based my project on the&amp;nbsp;&lt;STRONG&gt;twrk60d100m_demo_apps_adc16_low_power&lt;/STRONG&gt; demo app which shows how to deal with the internal temp sensor. But since it doesn't use DMA, I tried to mix it with the&amp;nbsp;&lt;STRONG&gt;frdmk64f_adc16_continuous_edma&amp;nbsp;&lt;/STRONG&gt;sample. The mix was not only a copy-paste mix since I'm using the config tool and most of the names won't coincide. I did an analysis of the&amp;nbsp;&lt;STRONG&gt;frdmk64f_adc16_continuous_edma&amp;nbsp;&lt;/STRONG&gt;project and added the necessary code and configurations to my project to be consistent with what is being done.&lt;/P&gt;&lt;P&gt;The&amp;nbsp;&lt;STRONG&gt;frdmk64f_adc16_continuous_edma&lt;/STRONG&gt;&amp;nbsp;and&amp;nbsp;&lt;STRONG&gt;twrk60d100m_demo_apps_adc16_low_power&amp;nbsp;&lt;/STRONG&gt;projects work wonderfully separately, the former on an &lt;STRONG&gt;FRDMK64F&lt;/STRONG&gt; board and the later on my MK10 custom board, with no problems at all. I have analyzed both to get familiar with them and I know how they work, but my project with the mix of both on the custom MK10 doesn't.&lt;/P&gt;&lt;P&gt;I have a place in the code where I do this:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;    uint32_t adcr_bg = 0; /*! ADC value of BANDGAP */
    uint32_t vdd = 0;     /*! VDD in mV */
    pmc_bandgap_buffer_config_t pmcBandgapConfig;

    pmcBandgapConfig.enable = true;
    PMC_ConfigureBandgapBuffer(PMC, &amp;amp;pmcBandgapConfig);

    adc_clear();

    /* Set the channel to convert by ADC0 to bandgap */
    ADC16_SetChannelConfig(ADC0_PERIPHERAL, ADC0_CH0_CONTROL_GROUP, &amp;amp;adc0_channelsConfig[0]);

    /* Wait for the conversion to be done */
    //WDOG_Refresh(WATCHDOG_PERIPHERAL);
    while (!adc0_val_dma_transfer_rdy);

    /* Clear the flag */
    adc0_val_dma_transfer_rdy = false;

    /* Get current ADC BANDGAP value */
    adcr_bg = adc0_val;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That is the part where I'm trying to measure the internal bandgap to calibrate the internal temp sensor. Since I have configured the DMA, I expect the code to hit the &lt;STRONG&gt;adcr_bg = adc0_val;&lt;/STRONG&gt;&amp;nbsp;line with the ADC0 value already in&amp;nbsp;&lt;STRONG&gt;adc0_val&amp;nbsp;&lt;/STRONG&gt;and placed there by the DMA.&lt;/P&gt;&lt;P&gt;The problem is that the code gets stuck in&amp;nbsp;&lt;STRONG&gt;while (!adc0_val_dma_transfer_rdy);&lt;/STRONG&gt; because the solution is not working.&lt;/P&gt;&lt;P&gt;I don't really know what is going on. If you care to please download and import the attached project to your MCUXpresso 11.3.0 you can see how I configured the project.&lt;/P&gt;&lt;P&gt;I can post more details of the code here if you don't want to download the project. I just didn't want to post all the code here and make this a very long post.&lt;/P&gt;&lt;P&gt;The ADC0 and DMA seem to be configured correctly, but I don't know. I have even copied the code from my project to the FRDMK64F and it works there!! So I don't really know what's going on.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Feb 2021 22:28:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/MK10DN512-ADC0-with-DMA-continuous-mode-not-working/m-p/1230080#M59601</guid>
      <dc:creator>m4l490n</dc:creator>
      <dc:date>2021-02-11T22:28:02Z</dc:date>
    </item>
    <item>
      <title>Re: MK10DN512 ADC0 with DMA continuous mode not working!</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/MK10DN512-ADC0-with-DMA-continuous-mode-not-working/m-p/1234246#M59702</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Glad to hear that this issue is resolved from below post.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.nxp.com/t5/Kinetis-Microcontrollers/I-found-a-bug-on-the-DMA-code-for-the-MK10-family-or-did-I/m-p/1231692#M59644" target="_blank"&gt;https://community.nxp.com/t5/Kinetis-Microcontrollers/I-found-a-bug-on-the-DMA-code-for-the-MK10-family-or-did-I/m-p/1231692#M59644&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;
&lt;P&gt;Daniel&lt;/P&gt;</description>
      <pubDate>Mon, 22 Feb 2021 08:59:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/MK10DN512-ADC0-with-DMA-continuous-mode-not-working/m-p/1234246#M59702</guid>
      <dc:creator>danielchen</dc:creator>
      <dc:date>2021-02-22T08:59:36Z</dc:date>
    </item>
  </channel>
</rss>

