<?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 strange behaviour in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/ADC-strange-behaviour/m-p/544227#M12854</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Genesy on Tue Nov 19 01:37:01 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Ok, I will try with your suggestions.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The ADC input is a voltage divider from a hall effect sensor.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you very much Marc.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 19:45:48 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T19:45:48Z</dc:date>
    <item>
      <title>ADC strange behaviour</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/ADC-strange-behaviour/m-p/544223#M12850</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Genesy on Fri Nov 15 10:21:05 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi, &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;as the title, I have a strange behaviour with ADC.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The program is this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;
static uint32_t ADCChannelAcquisition(uint8_t channel){
ADCRead( channel );
while ( !ADCIntDone );
ADCIntDone = 0;
return ADCValue[channel];
}

int main(void) {

SystemInit();
ADCInit( ADC_CLK );

int i;
uint32_t val=0;
uint32_t acquisition[10];

uint32_t count=0;

//for (i=0; i&amp;lt;100000; i++){
//count++;
//}

for (i=0; i&amp;lt;10; i++){
acquisition&lt;I&gt; = ADCChannelAcquisition(0);
}

for (i=0; i&amp;lt;10; i++){
val += acquisition&lt;I&gt;;
}

uint32_t valRif = (uint32_t)(((float)val&amp;nbsp; / 10.0) + 0.5);


return 0 ;
}
&lt;/I&gt;&lt;/I&gt;&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;SPAN&gt;The behaviour is different if I insert a breakpoint in the first acquisition as you can see in the attached images. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;In the first case the values ​​are higher than in the second case. What is the reason? &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;What values ​​are reliable?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried to insert a delay before making ADC readings, but nothing has changed.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you very much&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:45:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/ADC-strange-behaviour/m-p/544223#M12850</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:45:46Z</dc:date>
    </item>
    <item>
      <title>Re: ADC strange behaviour</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/ADC-strange-behaviour/m-p/544224#M12851</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by MarcVonWindscooting on Sat Nov 16 06:26:50 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Just a guess: before Init the port pin is GPIO with pullup.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The you switch to ADC input and start sampling within a few us. Pretty short time!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Can your excess reading be the removed pullup-current + low-pass behaviour?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:45:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/ADC-strange-behaviour/m-p/544224#M12851</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:45:47Z</dc:date>
    </item>
    <item>
      <title>Re: ADC strange behaviour</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/ADC-strange-behaviour/m-p/544225#M12852</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Genesy on Mon Nov 18 01:51:54 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Yes, I also thought that it could be a matter of timing and I inserted a short delay but wasn't enough.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Than it should be this late?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:45:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/ADC-strange-behaviour/m-p/544225#M12852</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:45:47Z</dc:date>
    </item>
    <item>
      <title>Re: ADC strange behaviour</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/ADC-strange-behaviour/m-p/544226#M12853</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by MarcVonWindscooting on Mon Nov 18 12:11:47 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Have you tried with a long delay in the seconds range (like your breakpoint does)?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;100*1000 loops isn't that much nowadays ;-)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also, are you sure, the loop is executes as expected? I believe so, too. But to be 100% sure, declare count 'volatile'.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;What is the input circiut to your ADC? Voltage divider?&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:45:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/ADC-strange-behaviour/m-p/544226#M12853</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:45:48Z</dc:date>
    </item>
    <item>
      <title>Re: ADC strange behaviour</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/ADC-strange-behaviour/m-p/544227#M12854</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Genesy on Tue Nov 19 01:37:01 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Ok, I will try with your suggestions.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The ADC input is a voltage divider from a hall effect sensor.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you very much Marc.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:45:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/ADC-strange-behaviour/m-p/544227#M12854</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:45:48Z</dc:date>
    </item>
  </channel>
</rss>

