<?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 LPC553x ADC VREF dependency in MCUXpresso Config Tools</title>
    <link>https://community.nxp.com/t5/MCUXpresso-Config-Tools/LPC553x-ADC-VREF-dependency/m-p/1653977#M1691</link>
    <description>&lt;P&gt;On the LPC553x&amp;nbsp;system I am using, the ADC has terrible results unless the internal VREF module and the low power bandgap is enabled prior to use of the ADC module. I initially did not turn on the VREF module because my board design uses an external reference through the VREFP pin.&lt;/P&gt;&lt;P&gt;I suspect the voltage reference must be used in the autocalibration process or somewhere internally in the SAR conversion. This is fine, and it's now documented in&amp;nbsp;revision 2 of the processor family reference manual, but the Config Tools code generation interface doesn't warn you of this when instantiating just an ADC module.&lt;/P&gt;&lt;P&gt;Interestingly, if I drop the ADC module clock rate to 8MHz I can get usable results out without enabling the bandgap reference.&lt;/P&gt;</description>
    <pubDate>Fri, 19 May 2023 18:13:02 GMT</pubDate>
    <dc:creator>asund</dc:creator>
    <dc:date>2023-05-19T18:13:02Z</dc:date>
    <item>
      <title>LPC553x ADC VREF dependency</title>
      <link>https://community.nxp.com/t5/MCUXpresso-Config-Tools/LPC553x-ADC-VREF-dependency/m-p/1653977#M1691</link>
      <description>&lt;P&gt;On the LPC553x&amp;nbsp;system I am using, the ADC has terrible results unless the internal VREF module and the low power bandgap is enabled prior to use of the ADC module. I initially did not turn on the VREF module because my board design uses an external reference through the VREFP pin.&lt;/P&gt;&lt;P&gt;I suspect the voltage reference must be used in the autocalibration process or somewhere internally in the SAR conversion. This is fine, and it's now documented in&amp;nbsp;revision 2 of the processor family reference manual, but the Config Tools code generation interface doesn't warn you of this when instantiating just an ADC module.&lt;/P&gt;&lt;P&gt;Interestingly, if I drop the ADC module clock rate to 8MHz I can get usable results out without enabling the bandgap reference.&lt;/P&gt;</description>
      <pubDate>Fri, 19 May 2023 18:13:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-Config-Tools/LPC553x-ADC-VREF-dependency/m-p/1653977#M1691</guid>
      <dc:creator>asund</dc:creator>
      <dc:date>2023-05-19T18:13:02Z</dc:date>
    </item>
    <item>
      <title>Re: LPC553x ADC VREF dependency</title>
      <link>https://community.nxp.com/t5/MCUXpresso-Config-Tools/LPC553x-ADC-VREF-dependency/m-p/1654504#M1692</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Regarding your question, even if you do not use the on-chip Voltage Reference as ADC voltage reference, you have to configure the on-chip Voltage Reference.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="xiangjun_rong_0-1684739263364.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/224147i396B19BE82F9B4D6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="xiangjun_rong_0-1684739263364.png" alt="xiangjun_rong_0-1684739263364.png" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;xiangjun_rong_0-1684739263364.png&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;This is the ADC code for the LPC5536:&lt;/P&gt;
&lt;P&gt;/* Disable VREF power down */&lt;BR /&gt;POWER_DisablePD(kPDRUNCFG_PD_VREF);&lt;/P&gt;
&lt;P&gt;VREF_GetDefaultConfig(&amp;amp;vrefConfig);&lt;BR /&gt;vrefConfig.bufferMode = kVREF_ModeBandgapOnly;&lt;BR /&gt;vrefConfig.enableInternalVoltageRegulator = false;&lt;BR /&gt;vrefConfig.enableVrefOut = false;&lt;BR /&gt;VREF_Init(VREF, &amp;amp;vrefConfig);&lt;/P&gt;
&lt;P&gt;Regarding the ADC clock, I suppose that the 8MHz is too slow. This is the value you should set up:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="xiangjun_rong_1-1684739499553.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/224152i3410F801A6FA9B4C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="xiangjun_rong_1-1684739499553.png" alt="xiangjun_rong_1-1684739499553.png" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;xiangjun_rong_1-1684739499553.png&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Regarding the ADC result which is not stable, I suggest you set a big value for the g_LpadcCommandConfigStruct.sampleTimeMode = &lt;FONT color="#FF0000"&gt;kLPADC_SampleTimeADCK131&lt;/FONT&gt;;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;/* Set conversion CMD configuration. */&lt;BR /&gt;LPADC_GetDefaultConvCommandConfig(&amp;amp;g_LpadcCommandConfigStruct);&lt;BR /&gt;g_LpadcCommandConfigStruct.channelNumber = xxxx;&lt;BR /&gt;g_LpadcCommandConfigStruct.sampleChannelMode = DEMO_LPADC_SAMPLE_CHANNEL_MODE;&lt;BR /&gt;g_LpadcCommandConfigStruct.sampleTimeMode = &lt;FONT color="#FF0000"&gt;kLPADC_SampleTimeADCK131&lt;/FONT&gt;;&lt;BR /&gt;g_LpadcCommandConfigStruct.hardwareAverageMode = kLPADC_HardwareAverageCount128;&lt;BR /&gt;#if defined(FSL_FEATURE_LPADC_TEMP_SENS_BUFFER_SIZE)&lt;BR /&gt;g_LpadcCommandConfigStruct.loopCount = FSL_FEATURE_LPADC_TEMP_SENS_BUFFER_SIZE - 1U;&lt;BR /&gt;#endif /* FSL_FEATURE_LPADC_TEMP_SENS_BUFFER_SIZE */&lt;BR /&gt;#if defined(FSL_FEATURE_LPADC_HAS_CMDL_MODE) &amp;amp;&amp;amp; FSL_FEATURE_LPADC_HAS_CMDL_MODE&lt;BR /&gt;g_LpadcCommandConfigStruct.conversionResolutionMode = kLPADC_ConversionResolutionHigh;&lt;BR /&gt;#endif /* FSL_FEATURE_LPADC_HAS_CMDL_MODE */&lt;BR /&gt;LPADC_SetConvCommandConfig(DEMO_LPADC_BASE, DEMO_LPADC_USER_CMDID, &amp;amp;g_LpadcCommandConfigStruct);&lt;/P&gt;
&lt;P&gt;Especially, when&amp;nbsp; the analog channel source has large impedance.&lt;/P&gt;
&lt;P&gt;Hope it can help you&lt;/P&gt;
&lt;P&gt;BR&lt;/P&gt;
&lt;P&gt;XiangJun Rong&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 May 2023 07:17:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-Config-Tools/LPC553x-ADC-VREF-dependency/m-p/1654504#M1692</guid>
      <dc:creator>xiangjun_rong</dc:creator>
      <dc:date>2023-05-22T07:17:42Z</dc:date>
    </item>
    <item>
      <title>Re: LPC553x ADC VREF dependency</title>
      <link>https://community.nxp.com/t5/MCUXpresso-Config-Tools/LPC553x-ADC-VREF-dependency/m-p/1654937#M1695</link>
      <description>&lt;P&gt;Thanks for the feedback, I have submitted a change request to our config tools team.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 May 2023 15:28:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-Config-Tools/LPC553x-ADC-VREF-dependency/m-p/1654937#M1695</guid>
      <dc:creator>AleGuzman</dc:creator>
      <dc:date>2023-05-22T15:28:20Z</dc:date>
    </item>
  </channel>
</rss>

