<?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: ADC no interrupt after software start in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/ADC-no-interrupt-after-software-start/m-p/1588690#M51411</link>
    <description>&lt;P class="lia-align-justify"&gt;Hello &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/19450"&gt;@randylee&lt;/a&gt;,&lt;/P&gt;
&lt;P class="lia-align-justify"&gt;Looking at what you have done. In your init code, you are using &lt;EM&gt;LPADC_DoOffsetCalibration(LPADC_BASE)&lt;/EM&gt; and &lt;EM&gt;LPADC_DoAutoCalibration(LPADC_BASE)&lt;/EM&gt;. Both of them were not previously added in your configuration trough ConfigTools, if you want them to be part of your code in peripherals.c, you should add them as follows:&lt;/P&gt;
&lt;P class="lia-align-justify"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RaulRomero_0-1674798373931.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/208522i2F56F81602A8F01F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="RaulRomero_0-1674798373931.png" alt="RaulRomero_0-1674798373931.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P class="lia-align-justify"&gt;[ConfigTools. Peripherals Tool. ADC0. General configuration.]&lt;/P&gt;
&lt;P class="lia-align-justify"&gt;Also, you should do a previous configuration before and after the ADC configuration. Looking at the examples, and User Manual, you should do something similar to this after the ADC initialization:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;while(1)
{  
   LPADC_DoSoftwareTrigger(DEMO_LPADC_BASE, UM); /* UM is trigger mask, look at the following table for choose which trigger should be mask according your needs*/

   while (!g_LpadcConversionCompletedFlag)
   {
   }

   g_LpadcConversionCompletedFlag = false;
}&lt;/LI-CODE&gt;
&lt;P class="lia-align-justify"&gt;NOTE: This is for &lt;EM&gt;interrupt method&lt;/EM&gt;.&lt;/P&gt;
&lt;P class="lia-align-justify"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="lia-align-justify"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RaulRomero_1-1674798373935.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/208523i8BF0F8FAC56B4C42/image-size/medium?v=v2&amp;amp;px=400" role="button" title="RaulRomero_1-1674798373935.png" alt="RaulRomero_1-1674798373935.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P class="lia-align-justify"&gt;[LPC55S1x/LPC551x User Manual. Chapter 39: LPC55S1x/LPC551x 16-bit ADC controller (ADC)]&lt;/P&gt;
&lt;P class="lia-align-justify"&gt;Hope this helps.&lt;/P&gt;
&lt;P class="lia-align-justify"&gt;Best regards, Raul.&lt;/P&gt;</description>
    <pubDate>Fri, 27 Jan 2023 05:50:12 GMT</pubDate>
    <dc:creator>RaRo</dc:creator>
    <dc:date>2023-01-27T05:50:12Z</dc:date>
    <item>
      <title>ADC no interrupt after software start</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/ADC-no-interrupt-after-software-start/m-p/1587216#M51362</link>
      <description>&lt;P&gt;I'm using MCUexpresso, SDK 2.11.0 on an LPC5512.&amp;nbsp; I'm just attempting to periodically (slowly) look at a line for ADC Conversion.&amp;nbsp; I've used some example stuff to set this up sort of but it just isn't going to fire an interrupt.&lt;/P&gt;&lt;P&gt;so I set up ADC0 thusly:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="randylee_0-1674575630361.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/208250i09E07B9C3B6BA20E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="randylee_0-1674575630361.png" alt="randylee_0-1674575630361.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="randylee_1-1674575670447.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/208251iA7F8419278F364B9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="randylee_1-1674575670447.png" alt="randylee_1-1674575670447.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Code is simple (setup in the normal peripherals.c init stuff):&lt;/P&gt;&lt;P&gt;&lt;FONT face="terminal,monaco"&gt;void ADC0_IRQHANDLER(void)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="terminal,monaco"&gt;{&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="terminal,monaco"&gt;g_LpadcInterruptCounter++;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="terminal,monaco"&gt;if (LPADC_GetConvResult(LPADC_BASE, &amp;amp;g_LpadcResultConfigStruct, 0U))&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="terminal,monaco"&gt;{&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="terminal,monaco"&gt;g_LpadcConversionCompletedFlag = true;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="terminal,monaco"&gt;}&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="terminal,monaco"&gt;SDK_ISR_EXIT_BARRIER;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="terminal,monaco"&gt;}&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="terminal,monaco"&gt;Then every so often fire off:&amp;nbsp;LPADC_DoSoftwareTrigger(LPADC_BASE, ADC0_BATTLOOK);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="terminal,monaco"&gt;I never see an ISR here.&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jan 2023 16:00:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/ADC-no-interrupt-after-software-start/m-p/1587216#M51362</guid>
      <dc:creator>randylee</dc:creator>
      <dc:date>2023-01-24T16:00:03Z</dc:date>
    </item>
    <item>
      <title>Re: ADC no interrupt after software start</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/ADC-no-interrupt-after-software-start/m-p/1588414#M51403</link>
      <description>&lt;P&gt;In my init code (after the regular SDK init code), I do the following:&lt;/P&gt;&lt;P&gt;LPADC_Enable(LPADC_BASE,true); // turn us on and let's go then&lt;BR /&gt;LPADC_DoOffsetCalibration(LPADC_BASE);&lt;BR /&gt;LPADC_DoAutoCalibration(LPADC_BASE);&lt;/P&gt;&lt;P&gt;//&lt;BR /&gt;// Fire this off right off the bat so we have seomthing to look at later.&lt;BR /&gt;//&lt;BR /&gt;LPADC_DoSoftwareTrigger(LPADC_BASE, ADC0_BATTLOOK);&lt;/P&gt;&lt;P&gt;On the subsequent polling I break it and look at the registers which shows STAT showing Calibrated so I'm talking to the ADC.. it just doesn't seem to want to fire off a software trigger.&amp;nbsp; It is also showing it's doing nothing (STAT.ADC_ACTIVE is 0) (STAT.CMDACT is 0)&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jan 2023 16:39:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/ADC-no-interrupt-after-software-start/m-p/1588414#M51403</guid>
      <dc:creator>randylee</dc:creator>
      <dc:date>2023-01-26T16:39:26Z</dc:date>
    </item>
    <item>
      <title>Re: ADC no interrupt after software start</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/ADC-no-interrupt-after-software-start/m-p/1588491#M51404</link>
      <description>&lt;P&gt;Interestingly enough, if I manually set some things:&lt;/P&gt;&lt;P&gt;/* Set conversion CMD configuration. */&lt;BR /&gt;// simpler configuration thing I think.&lt;BR /&gt;LPADC_GetDefaultConvCommandConfig(&amp;amp;mLpadcCommandConfigStruct);&lt;BR /&gt;mLpadcCommandConfigStruct.channelNumber = 3; // this is the pin we're on here&lt;BR /&gt;LPADC_SetConvCommandConfig(LPADC_BASE, ADC0_TAKEONE, &amp;amp;mLpadcCommandConfigStruct);&lt;/P&gt;&lt;P&gt;/* Set trigger configuration. */&lt;BR /&gt;LPADC_GetDefaultConvTriggerConfig(&amp;amp;mLpadcTriggerConfigStruct);&lt;BR /&gt;mLpadcTriggerConfigStruct.targetCommandId = ADC0_TAKEONE;&lt;BR /&gt;mLpadcTriggerConfigStruct.enableHardwareTrigger = false;&lt;BR /&gt;LPADC_SetConvTriggerConfig(LPADC_BASE, 0U, &amp;amp;mLpadcTriggerConfigStruct); /* Configurate the trigger0. */&lt;/P&gt;&lt;P&gt;(this taken from one of the examples) I then get a ISR but it can't get it to shut up (constant ISR).&amp;nbsp; Now these settings are the same as is in the peripheral.c file so I can only assume there is some order that isn't happening correctly to these.....&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jan 2023 18:57:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/ADC-no-interrupt-after-software-start/m-p/1588491#M51404</guid>
      <dc:creator>randylee</dc:creator>
      <dc:date>2023-01-26T18:57:45Z</dc:date>
    </item>
    <item>
      <title>Re: ADC no interrupt after software start</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/ADC-no-interrupt-after-software-start/m-p/1588552#M51409</link>
      <description>&lt;P class="lia-align-justify"&gt;Hello &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/19450"&gt;@randylee&lt;/a&gt;,&lt;/P&gt;
&lt;P class="lia-align-justify"&gt;Could you please tell me which SDK and version are you using?&lt;/P&gt;
&lt;P class="lia-align-justify"&gt;Also, could you please try out the LPADC examples? Are they running as intended in your microcontroller?&lt;/P&gt;
&lt;P class="lia-align-justify"&gt;Related with your polling method, is better if you use LPADC_Init instead of LPADC_Enable, LPADC_Init have a few steps more and includes the LPADC_Enable. Nonetheless, if this init code you are showing includes the ADC0 configuration trough ConfigTools, LPADC_Enable is not needed.&lt;/P&gt;
&lt;P class="lia-align-justify"&gt;Do you want polling or interrupt method for work with the ADC? In polling the IRQ Handler, EnableIRQ and LPADC_EnableInterrupts are not needed nor used.&lt;/P&gt;
&lt;P class="lia-align-justify"&gt;Regards, Raul.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jan 2023 21:16:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/ADC-no-interrupt-after-software-start/m-p/1588552#M51409</guid>
      <dc:creator>RaRo</dc:creator>
      <dc:date>2023-01-26T21:16:07Z</dc:date>
    </item>
    <item>
      <title>Re: ADC no interrupt after software start</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/ADC-no-interrupt-after-software-start/m-p/1588690#M51411</link>
      <description>&lt;P class="lia-align-justify"&gt;Hello &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/19450"&gt;@randylee&lt;/a&gt;,&lt;/P&gt;
&lt;P class="lia-align-justify"&gt;Looking at what you have done. In your init code, you are using &lt;EM&gt;LPADC_DoOffsetCalibration(LPADC_BASE)&lt;/EM&gt; and &lt;EM&gt;LPADC_DoAutoCalibration(LPADC_BASE)&lt;/EM&gt;. Both of them were not previously added in your configuration trough ConfigTools, if you want them to be part of your code in peripherals.c, you should add them as follows:&lt;/P&gt;
&lt;P class="lia-align-justify"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RaulRomero_0-1674798373931.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/208522i2F56F81602A8F01F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="RaulRomero_0-1674798373931.png" alt="RaulRomero_0-1674798373931.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P class="lia-align-justify"&gt;[ConfigTools. Peripherals Tool. ADC0. General configuration.]&lt;/P&gt;
&lt;P class="lia-align-justify"&gt;Also, you should do a previous configuration before and after the ADC configuration. Looking at the examples, and User Manual, you should do something similar to this after the ADC initialization:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;while(1)
{  
   LPADC_DoSoftwareTrigger(DEMO_LPADC_BASE, UM); /* UM is trigger mask, look at the following table for choose which trigger should be mask according your needs*/

   while (!g_LpadcConversionCompletedFlag)
   {
   }

   g_LpadcConversionCompletedFlag = false;
}&lt;/LI-CODE&gt;
&lt;P class="lia-align-justify"&gt;NOTE: This is for &lt;EM&gt;interrupt method&lt;/EM&gt;.&lt;/P&gt;
&lt;P class="lia-align-justify"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="lia-align-justify"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RaulRomero_1-1674798373935.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/208523i8BF0F8FAC56B4C42/image-size/medium?v=v2&amp;amp;px=400" role="button" title="RaulRomero_1-1674798373935.png" alt="RaulRomero_1-1674798373935.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P class="lia-align-justify"&gt;[LPC55S1x/LPC551x User Manual. Chapter 39: LPC55S1x/LPC551x 16-bit ADC controller (ADC)]&lt;/P&gt;
&lt;P class="lia-align-justify"&gt;Hope this helps.&lt;/P&gt;
&lt;P class="lia-align-justify"&gt;Best regards, Raul.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jan 2023 05:50:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/ADC-no-interrupt-after-software-start/m-p/1588690#M51411</guid>
      <dc:creator>RaRo</dc:creator>
      <dc:date>2023-01-27T05:50:12Z</dc:date>
    </item>
    <item>
      <title>Re: ADC no interrupt after software start</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/ADC-no-interrupt-after-software-start/m-p/1588912#M51415</link>
      <description>A couple of things here:&lt;BR /&gt;SDK is (as mentioned) SDK 2.11.0&lt;BR /&gt;It's a transliteration issue to use the examples with the tools as the examples don't actually use the config tool sets much. They tend to do a lot with directly programmatically setting up things so a person needs to go through those and figure out what the tools are doing and what needs to get done still. Easy to miss stuff, that's just the way that is.&lt;BR /&gt;&lt;BR /&gt;My code was pulled from the examples almost verbatim. Except for the initialization stuff which I'm struggling with here apparently....</description>
      <pubDate>Fri, 27 Jan 2023 14:20:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/ADC-no-interrupt-after-software-start/m-p/1588912#M51415</guid>
      <dc:creator>randylee</dc:creator>
      <dc:date>2023-01-27T14:20:32Z</dc:date>
    </item>
    <item>
      <title>Re: ADC no interrupt after software start</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/ADC-no-interrupt-after-software-start/m-p/1588914#M51416</link>
      <description>&lt;P&gt;this is one key thing that I've missed here; this idea that this isn't an index but a bitmap. The tools do not make this clear at all and I think I had it as an index. Moving that around helps some&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jan 2023 16:15:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/ADC-no-interrupt-after-software-start/m-p/1588914#M51416</guid>
      <dc:creator>randylee</dc:creator>
      <dc:date>2023-01-27T16:15:15Z</dc:date>
    </item>
    <item>
      <title>Re: ADC no interrupt after software start</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/ADC-no-interrupt-after-software-start/m-p/1588917#M51417</link>
      <description>&lt;P&gt;I got this working by dropping back to a fully polling (using the poling ADC example (which I missed the existence of to begin with)).&amp;nbsp; My application is quite simple so waiting for an ADC to finish isn't a problem.&lt;/P&gt;&lt;P&gt;One thing that I missed in the translation and is of *vital* import is the line:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;POWER_DisablePD(kPDRUNCFG_PD_LDOGPADC);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Not having that always gives results that go 1/2 rail no matter what input you have. (see also&amp;nbsp;&lt;A href="https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S69-ADC-always-measuring-half-rail/m-p/1557247" target="_blank" rel="noopener"&gt;Solved: LPC55S69 ADC always measuring half rail? - NXP Community&lt;/A&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;So I've got this thing pulling some numbers... Now to get the numbers to line up correctly...&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jan 2023 14:27:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/ADC-no-interrupt-after-software-start/m-p/1588917#M51417</guid>
      <dc:creator>randylee</dc:creator>
      <dc:date>2023-01-27T14:27:04Z</dc:date>
    </item>
  </channel>
</rss>

