<?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>Kinetis MicrocontrollersのトピックDoes ADC require additonal time after intialization to sample accurately?</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Does-ADC-require-additonal-time-after-intialization-to-sample/m-p/944188#M54504</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to implement 12-bit ADC using FRDM K22F board to sample a DC voltage. I have used auto-calibration function to calibrate ADC during initialization and the ADC gets calibrated successfully as indicated by CALF flag in SC3 register. I have observed that the total fluctuation in ADC Conversion results for 500 samples is more (6-7 counts). But when I add a long delay (intentional) after the auto calibration function is called, the fluctuation decreases to 4 counts. Does ADC take some more time before it is ready to sample the input signal accurately? If yes, then how can I ensure that ADC has completed auto calibration and is ready to sample the signal accurately?&lt;/P&gt;&lt;P&gt;The ripple in ADC input signal is very low.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The ADC initialization sequence is as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;adc16_config_t adc_config;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;EnableIRQ(ADC0_IRQn);&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;ADC16_GetDefaultConfig(&amp;amp;adc_config);&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;adc_config.clockSource = kADC16_ClockSourceAlt0;/*Bus clock 60 Mhz*/&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;adc_config.clockDivider = kADC16_ClockDivider4;/*Divided by 4*/&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;adc_config.longSampleMode = kADC16_LongSampleDisabled;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;ADC16_Init(ADC0, &amp;amp;adc_config);&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;while(kStatus_Success != ADC16_DoAutoCalibration((ADC0))&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;{&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;}&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;if(ADC16_GetStatusFlags((ADC0))&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;{&lt;/P&gt;&lt;P style="margin-bottom: .0001pt; text-indent: .5in;"&gt;printf("failed");&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;}&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;/*&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;for (uint32_t p=0, p &amp;lt; 0xFFFFFFF, p++)&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;{&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;} /* intentional delay */&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;*/&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;ADC16_EnableHardwareTrigger((ADC0, false); /* Make sure the software trigger is used. */&lt;/P&gt;&lt;P&gt;ADC16_EnableDMA((ADC0, true);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help in resolving the issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;Thanks and Best Regards,&lt;/P&gt;&lt;P&gt;Vaibhavi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 19 Oct 2019 04:30:56 GMT</pubDate>
    <dc:creator>vaibhavi_padwal</dc:creator>
    <dc:date>2019-10-19T04:30:56Z</dc:date>
    <item>
      <title>Does ADC require additonal time after intialization to sample accurately?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Does-ADC-require-additonal-time-after-intialization-to-sample/m-p/944188#M54504</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to implement 12-bit ADC using FRDM K22F board to sample a DC voltage. I have used auto-calibration function to calibrate ADC during initialization and the ADC gets calibrated successfully as indicated by CALF flag in SC3 register. I have observed that the total fluctuation in ADC Conversion results for 500 samples is more (6-7 counts). But when I add a long delay (intentional) after the auto calibration function is called, the fluctuation decreases to 4 counts. Does ADC take some more time before it is ready to sample the input signal accurately? If yes, then how can I ensure that ADC has completed auto calibration and is ready to sample the signal accurately?&lt;/P&gt;&lt;P&gt;The ripple in ADC input signal is very low.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The ADC initialization sequence is as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;adc16_config_t adc_config;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;EnableIRQ(ADC0_IRQn);&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;ADC16_GetDefaultConfig(&amp;amp;adc_config);&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;adc_config.clockSource = kADC16_ClockSourceAlt0;/*Bus clock 60 Mhz*/&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;adc_config.clockDivider = kADC16_ClockDivider4;/*Divided by 4*/&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;adc_config.longSampleMode = kADC16_LongSampleDisabled;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;ADC16_Init(ADC0, &amp;amp;adc_config);&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;while(kStatus_Success != ADC16_DoAutoCalibration((ADC0))&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;{&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;}&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;if(ADC16_GetStatusFlags((ADC0))&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;{&lt;/P&gt;&lt;P style="margin-bottom: .0001pt; text-indent: .5in;"&gt;printf("failed");&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;}&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;/*&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;for (uint32_t p=0, p &amp;lt; 0xFFFFFFF, p++)&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;{&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;} /* intentional delay */&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;*/&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;ADC16_EnableHardwareTrigger((ADC0, false); /* Make sure the software trigger is used. */&lt;/P&gt;&lt;P&gt;ADC16_EnableDMA((ADC0, true);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help in resolving the issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;Thanks and Best Regards,&lt;/P&gt;&lt;P&gt;Vaibhavi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 19 Oct 2019 04:30:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Does-ADC-require-additonal-time-after-intialization-to-sample/m-p/944188#M54504</guid>
      <dc:creator>vaibhavi_padwal</dc:creator>
      <dc:date>2019-10-19T04:30:56Z</dc:date>
    </item>
    <item>
      <title>Re: Does ADC require additonal time after intialization to sample accurately?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Does-ADC-require-additonal-time-after-intialization-to-sample/m-p/944189#M54505</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Vaibhavi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Usually the ADC has some measurements error and there's some techniques to help you improve the accuracy of this. Please check the following documents:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/docs/DOC-104288"&gt;Improving my ADC design&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.nxp.com/docs/en/application-note/AN4373.pdf"&gt;Cookbook for SAR ADC Measurements&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.nxp.com/docs/en/application-note/AN5250.pdf"&gt;How to Increase the Analog-to-Digital Converter Accuracy in an Application&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One of the easiest way would be to enable the long sample in the configuration structure and select one of the option for it.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;kADC16_LongSampleCycle24 = 0U, /*!&amp;lt; 20 extra ADCK cycles, 24 ADCK cycles total. */&lt;BR /&gt; kADC16_LongSampleCycle16 = 1U, /*!&amp;lt; 12 extra ADCK cycles, 16 ADCK cycles total. */&lt;BR /&gt; kADC16_LongSampleCycle10 = 2U, /*!&amp;lt; 6 extra ADCK cycles, 10 ADCK cycles total. */&lt;BR /&gt; kADC16_LongSampleCycle6 = 3U, /*!&amp;lt; 2 extra ADCK cycles, 6 ADCK cycles total. */&lt;BR /&gt; kADC16_LongSampleDisabled = 4U, /*!&amp;lt; Disable the long sample feature. */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me know if this helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Alexis Andalon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Oct 2019 20:24:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Does-ADC-require-additonal-time-after-intialization-to-sample/m-p/944189#M54505</guid>
      <dc:creator>Alexis_A</dc:creator>
      <dc:date>2019-10-22T20:24:07Z</dc:date>
    </item>
  </channel>
</rss>

