<?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: MKL16 ADC read using DMA in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/MKL16-ADC-read-using-DMA/m-p/890450#M52622</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sabina,&lt;/P&gt;&lt;P&gt;Thanks for your reply. Actually, I am working on client project and I got this code from them. I am working on re-designing the code. I would not be able to share code. We are using this ADC to monitor photo-diode readings. Please let me know if you need any other configuration details.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Balkrishana&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 17 May 2019 05:16:40 GMT</pubDate>
    <dc:creator>balkrishanaa</dc:creator>
    <dc:date>2019-05-17T05:16:40Z</dc:date>
    <item>
      <title>MKL16 ADC read using DMA</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/MKL16-ADC-read-using-DMA/m-p/890446#M52618</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #51626f; "&gt;Came across code for MKL16 controller, where ADC single channel data is read in DMA interrupt in "uint32 adc_data[4]". And after reading data using&amp;nbsp;DMA_PrepareTransfer(), data in&amp;nbsp;&lt;SPAN&gt;adc_data[1] is used while ignoring&amp;nbsp;adc_data[0]. &lt;STRONG&gt;Code seems to work fine&lt;/STRONG&gt;, what can be the justification for this? &lt;STRONG&gt;ADC is configured for differential conversion and auto calibration is enabled.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #51626f; "&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #51626f; "&gt;&lt;SPAN&gt;ADC configuration:&amp;nbsp;resolution = 16 bit&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #51626f; "&gt;&lt;SPAN&gt;longSampleMode =&amp;nbsp;kADC16_LongSampleCycle24&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #51626f; "&gt;&lt;SPAN&gt;enableContinuousConversion = false&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #51626f; "&gt;&lt;SPAN&gt;enableInterruptOnConversionCompleted = false&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #51626f; "&gt;&lt;SPAN&gt;enable dma = true&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #51626f; "&gt;sample code :&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #51626f; "&gt;&lt;SPAN&gt;uint32AveragedReading;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #51626f; "&gt;&lt;SPAN&gt;uint32 adc_data[4];&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #51626f; "&gt;//interrupt used for reading ADC data&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #51626f; "&gt;DMA0_IRQHandler()&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #51626f; "&gt;{&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;int data;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #51626f; "&gt;DMA_ClearChannelStatusFlags();&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;DMA_PrepareTransfer(&amp;amp;DMA_TransferConfig, (void *)(uint32_t)(&amp;amp;ADC0-&amp;gt;R[0]), sizeof(uint32_t),&lt;BR /&gt; (void *)&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;adc_data&lt;/SPAN&gt;, sizeof(uint32_t), sizeof(&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;adc_data&lt;/SPAN&gt;),&lt;BR /&gt; kDMA_PeripheralToMemory);&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data =&amp;nbsp;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;adc_data[1];// why &lt;STRONG style="background-color: #ffffff; color: #51626f; "&gt;adc_data[0] is ignored?&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;AveragedReading = averaged_value_of_'data';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #51626f; "&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #51626f; "&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #51626f; "&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 May 2019 07:11:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/MKL16-ADC-read-using-DMA/m-p/890446#M52618</guid>
      <dc:creator>balkrishanaa</dc:creator>
      <dc:date>2019-05-13T07:11:10Z</dc:date>
    </item>
    <item>
      <title>Re: MKL16 ADC read using DMA</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/MKL16-ADC-read-using-DMA/m-p/890447#M52619</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Balkrishna,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you please tell me which example you are working on and what version of the SDK it is?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me know as soon as you can, so I can assist you.&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Sabina&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 May 2019 15:07:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/MKL16-ADC-read-using-DMA/m-p/890447#M52619</guid>
      <dc:creator>Sabina_Bruce</dc:creator>
      <dc:date>2019-05-14T15:07:29Z</dc:date>
    </item>
    <item>
      <title>Re: MKL16 ADC read using DMA</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/MKL16-ADC-read-using-DMA/m-p/890448#M52620</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Simua,&lt;/P&gt;&lt;P&gt;Thanks for your reply. I am using "kds 2.2.0". And could you please tell what you mean by "&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;which example you are working on&lt;/SPAN&gt;"?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 May 2019 09:54:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/MKL16-ADC-read-using-DMA/m-p/890448#M52620</guid>
      <dc:creator>balkrishanaa</dc:creator>
      <dc:date>2019-05-15T09:54:17Z</dc:date>
    </item>
    <item>
      <title>Re: MKL16 ADC read using DMA</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/MKL16-ADC-read-using-DMA/m-p/890449#M52621</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;Hi&amp;nbsp;&lt;SPAN style="background-color: #ffffff;"&gt;Balkrishna&lt;/SPAN&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;You said that you&lt;SPAN style="background-color: #ffffff;"&gt;&amp;nbsp;&lt;STRONG&gt;"Came across code for MKL16 controller"&lt;/STRONG&gt;. In order for me to be able to better assist you I need to know where you located this code.&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;If you can attach the project that would also be helpful.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;Thank you,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;Sabina&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 May 2019 20:45:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/MKL16-ADC-read-using-DMA/m-p/890449#M52621</guid>
      <dc:creator>Sabina_Bruce</dc:creator>
      <dc:date>2019-05-16T20:45:53Z</dc:date>
    </item>
    <item>
      <title>Re: MKL16 ADC read using DMA</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/MKL16-ADC-read-using-DMA/m-p/890450#M52622</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sabina,&lt;/P&gt;&lt;P&gt;Thanks for your reply. Actually, I am working on client project and I got this code from them. I am working on re-designing the code. I would not be able to share code. We are using this ADC to monitor photo-diode readings. Please let me know if you need any other configuration details.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Balkrishana&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 May 2019 05:16:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/MKL16-ADC-read-using-DMA/m-p/890450#M52622</guid>
      <dc:creator>balkrishanaa</dc:creator>
      <dc:date>2019-05-17T05:16:40Z</dc:date>
    </item>
    <item>
      <title>Re: MKL16 ADC read using DMA</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/MKL16-ADC-read-using-DMA/m-p/890451#M52623</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Balkrishana,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for the information you have provided. I tried replicating the code you provided, but the first sample&amp;nbsp;is just as valid as the rest of the samples in the data[4] array. Unfortunately from our side there is no valid reason as to why ignore the first sample that is being read from the ADC. I believe this particular implementation will be specific to your client's needs. I would recommend that you ask them directly why this is being done.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Sabina&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 May 2019 21:01:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/MKL16-ADC-read-using-DMA/m-p/890451#M52623</guid>
      <dc:creator>Sabina_Bruce</dc:creator>
      <dc:date>2019-05-20T21:01:59Z</dc:date>
    </item>
    <item>
      <title>Re: MKL16 ADC read using DMA</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/MKL16-ADC-read-using-DMA/m-p/890452#M52624</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sabina,&lt;/P&gt;&lt;P&gt;Thanks for your help. I am trying to reach the developer who wrote this code and I will update this thread if he has any specific reasons for doing this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Balkrishana&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 May 2019 11:05:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/MKL16-ADC-read-using-DMA/m-p/890452#M52624</guid>
      <dc:creator>balkrishanaa</dc:creator>
      <dc:date>2019-05-21T11:05:12Z</dc:date>
    </item>
  </channel>
</rss>

