<?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: Trouble configuring the ADC on the LPC845 in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/Trouble-configuring-the-ADC-on-the-LPC845/m-p/1190600#M43078</link>
    <description>&lt;P&gt;I used the peripheral configuration tool in the IDE to set up the ADC. I set up the voltage range and clock. I turn the ADC on via its power-down bit as pointed to in the post marked 'solution' in this thread. I'm pretty sure that's all you need to do if you want to use polling with the ADC.&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you also want to use interrupts, you need to set up an ISR for the ADC and point it to that in the peripheral configurator tool (or somewhere in the ADC setup).&lt;/P&gt;&lt;P&gt;I'd look at the code&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/105884"&gt;@carstengroen&lt;/a&gt;&amp;nbsp;posted in this thread (2020/10/08).&lt;/P&gt;&lt;P&gt;Tom&lt;/P&gt;</description>
    <pubDate>Mon, 30 Nov 2020 04:06:45 GMT</pubDate>
    <dc:creator>tomchr</dc:creator>
    <dc:date>2020-11-30T04:06:45Z</dc:date>
    <item>
      <title>Trouble configuring the ADC on the LPC845</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Trouble-configuring-the-ADC-on-the-LPC845/m-p/1164248#M42496</link>
      <description>&lt;P&gt;I'm trying to use the ADC on the LPC845 and am having a hard time with it. It seems the conversion never finishes. I hope one of you would be able to get me unstuck.&lt;/P&gt;&lt;P&gt;Here's the setup:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;const adc_config_t ADC0configStruct = {

  .clockMode = kADC_ClockSynchronousMode,

  .clockDividerNumber = 1,

  .enableLowPowerMode = false,

  .voltageRange = kADC_HighVoltageRange,

};

/* Conversion sequence A configuration structure */

const adc_conv_seq_config_t ADC0ConvSeqAConfigStruct = {

  .channelMask = 1U,

  .triggerMask = 0U,

  .triggerPolarity = kADC_TriggerPolarityNegativeEdge,

  .enableSyncBypass = false,

  .enableSingleStep = false,

  .interruptMode = kADC_InterruptForEachConversion

};



static void ADC0_init(void) {

  /* Perform self calibration */

  ADC_DoSelfCalibration(ADC0_PERIPHERAL, ADC0_CLK_FREQ);

  /* Initialize ADC0 peripheral */

  ADC_Init(ADC0_PERIPHERAL, &amp;amp;ADC0configStruct);

  /* Configure the conversion sequence A */

  ADC_SetConvSeqAConfig(ADC0_PERIPHERAL, &amp;amp;ADC0ConvSeqAConfigStruct);

  /* Enable the conversion sequence A */

  ADC_EnableConvSeqA(ADC0_PERIPHERAL, true);

  /* Configure threshold compare interrupt on channel 0 */

  ADC_EnableThresholdCompareInterrupt(ADC0_PERIPHERAL, 0U, kADC_ThresholdInterruptDisabled);

}&lt;/LI-CODE&gt;&lt;P&gt;And here's how I use it:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;    adc_result_info_t ADC_Result;

    ADC_DoSoftwareTriggerConvSeqA(ADC0_PERIPHERAL);
    while (!ADC_GetChannelConversionResult(ADC0_PERIPHERAL, 0U, &amp;amp;ADC_Result))
    {
    }
    printf("Results register cleared\n");&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The program never reaches the printf() statement. I'm sure I'm missing something really fundamental here... The clock source is the 15 MHz output from the FRO.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tom&lt;/P&gt;</description>
      <pubDate>Thu, 08 Oct 2020 01:53:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Trouble-configuring-the-ADC-on-the-LPC845/m-p/1164248#M42496</guid>
      <dc:creator>tomchr</dc:creator>
      <dc:date>2020-10-08T01:53:45Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble configuring the ADC on the LPC845</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Trouble-configuring-the-ADC-on-the-LPC845/m-p/1164268#M42497</link>
      <description>&lt;P&gt;Here's what's in BOARD_BootClockRUN:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;CLOCK_Select(&lt;SPAN&gt;&lt;I&gt;kADC_Clk_From_Fro&lt;/I&gt;&lt;/SPAN&gt;); &lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;/*!&amp;lt; select FRO for ADC */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;CLOCK_SetCoreSysClkDiv(1U);&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;CLOCK_SetClkDivider(&lt;SPAN&gt;&lt;I&gt;kCLOCK_DivAdcClk&lt;/I&gt;&lt;/SPAN&gt;, 15U); &lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;/*!&amp;lt; set ADC clock &lt;/SPAN&gt;&lt;SPAN&gt;div&lt;/SPAN&gt;&lt;SPAN&gt; */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Tom&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Oct 2020 02:55:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Trouble-configuring-the-ADC-on-the-LPC845/m-p/1164268#M42497</guid>
      <dc:creator>tomchr</dc:creator>
      <dc:date>2020-10-08T02:55:26Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble configuring the ADC on the LPC845</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Trouble-configuring-the-ADC-on-the-LPC845/m-p/1164353#M42499</link>
      <description>&lt;P&gt;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/156911"&gt;@tomchr&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;attached is my ADC code (for 845) from my last project, works perfectly. Maybe you can get some hints from that ?&lt;/P&gt;</description>
      <pubDate>Thu, 08 Oct 2020 07:53:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Trouble-configuring-the-ADC-on-the-LPC845/m-p/1164353#M42499</guid>
      <dc:creator>carstengroen</dc:creator>
      <dc:date>2020-10-08T07:53:53Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble configuring the ADC on the LPC845</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Trouble-configuring-the-ADC-on-the-LPC845/m-p/1164738#M42503</link>
      <description>&lt;P&gt;Like I said, "it's probably something simple". I have concluded that it helps considerably if the ADC is turned on. I was missing:&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;#include "fsl_power.h"&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;POWER_DisablePD(&lt;SPAN&gt;&lt;I&gt;kPDRUNCFG_PD_ADC0&lt;/I&gt;&lt;/SPAN&gt;);&lt;/P&gt;&lt;P&gt;I'm a bit surprised this isn't added automatically by the peripheral configuration tool, but whatever.&lt;/P&gt;&lt;P&gt;Tom&lt;/P&gt;</description>
      <pubDate>Thu, 08 Oct 2020 19:32:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Trouble-configuring-the-ADC-on-the-LPC845/m-p/1164738#M42503</guid>
      <dc:creator>tomchr</dc:creator>
      <dc:date>2020-10-08T19:32:33Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble configuring the ADC on the LPC845</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Trouble-configuring-the-ADC-on-the-LPC845/m-p/1190512#M43069</link>
      <description>&lt;P&gt;Will you please help?&lt;/P&gt;&lt;P&gt;I am using LPC845 33 pin chip. Properly connected VREFP and VREFN&lt;BR /&gt;I am giving an input of 1.7V to PIO0_21(ADC_5), pin 28&lt;/P&gt;&lt;P&gt;When tried to initialise the ADC, first ensuring IOCON PIO0_21 is set for no-pull-up and no-pull-down&lt;BR /&gt;and then assigning ADC_5 through SWM, the voltage goes to 0.3V&lt;/P&gt;&lt;P&gt;Even if I proceed to calibrate and read, I get a low value of 0x19&lt;/P&gt;&lt;P&gt;I tried changing the sequence of initialising SWM and then IOCON, and this time&lt;BR /&gt;firat I get some 1.7V but the moment the IOCON is loaded, the voltage drops.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;To avoid any problem related to library, I even tried using all register addresses and bit values dirctly&lt;/P&gt;&lt;P&gt;No change in the result.&lt;/P&gt;&lt;P&gt;I had tried SDK 2.5 and 2.8 versions both. I need some help very much, please.&lt;/P&gt;</description>
      <pubDate>Sat, 28 Nov 2020 11:56:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Trouble-configuring-the-ADC-on-the-LPC845/m-p/1190512#M43069</guid>
      <dc:creator>srchethan</dc:creator>
      <dc:date>2020-11-28T11:56:28Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble configuring the ADC on the LPC845</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Trouble-configuring-the-ADC-on-the-LPC845/m-p/1190541#M43072</link>
      <description>&lt;P&gt;Did you tell the ADC to use the two reference voltages and set the correct voltage range?&lt;/P&gt;&lt;P&gt;Tom&lt;/P&gt;</description>
      <pubDate>Sun, 29 Nov 2020 01:11:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Trouble-configuring-the-ADC-on-the-LPC845/m-p/1190541#M43072</guid>
      <dc:creator>tomchr</dc:creator>
      <dc:date>2020-11-29T01:11:16Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble configuring the ADC on the LPC845</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Trouble-configuring-the-ADC-on-the-LPC845/m-p/1190551#M43073</link>
      <description>&lt;P&gt;Thanks.. for your soon reply.&lt;/P&gt;&lt;P&gt;A/D trim register, reset value is 0. (VRANGE is High voltage, VDD = 2.7 V to 3.6 V).&lt;BR /&gt;I'm giving reference voltage VREFP is 3.3V, so i'm not configure A/D trim register.&lt;/P&gt;&lt;P&gt;Is their is anything else, to configure ADC for the two reference voltages.(VREFP and VREFN)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 29 Nov 2020 05:18:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Trouble-configuring-the-ADC-on-the-LPC845/m-p/1190551#M43073</guid>
      <dc:creator>srchethan</dc:creator>
      <dc:date>2020-11-29T05:18:07Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble configuring the ADC on the LPC845</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Trouble-configuring-the-ADC-on-the-LPC845/m-p/1190600#M43078</link>
      <description>&lt;P&gt;I used the peripheral configuration tool in the IDE to set up the ADC. I set up the voltage range and clock. I turn the ADC on via its power-down bit as pointed to in the post marked 'solution' in this thread. I'm pretty sure that's all you need to do if you want to use polling with the ADC.&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you also want to use interrupts, you need to set up an ISR for the ADC and point it to that in the peripheral configurator tool (or somewhere in the ADC setup).&lt;/P&gt;&lt;P&gt;I'd look at the code&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/105884"&gt;@carstengroen&lt;/a&gt;&amp;nbsp;posted in this thread (2020/10/08).&lt;/P&gt;&lt;P&gt;Tom&lt;/P&gt;</description>
      <pubDate>Mon, 30 Nov 2020 04:06:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Trouble-configuring-the-ADC-on-the-LPC845/m-p/1190600#M43078</guid>
      <dc:creator>tomchr</dc:creator>
      <dc:date>2020-11-30T04:06:45Z</dc:date>
    </item>
  </channel>
</rss>

