<?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>LPC Microcontrollers中的主题 Re: LPC1768 ADC errors</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1768-ADC-errors/m-p/523164#M5800</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by rocketdawg on Wed Nov 20 13:57:59 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;An interesting observation in AN10974.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;JTAG debugging reeks havoc&amp;nbsp; on ADC sampling.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 17:59:18 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T17:59:18Z</dc:date>
    <item>
      <title>LPC1768 ADC errors</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1768-ADC-errors/m-p/523159#M5795</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by 2394y80 on Tue Nov 19 11:51:43 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a board using a LPC1768 which interfaces directly to another board.&amp;nbsp; I have a problem where the AD values start to show errors when the sister board is powered up.&amp;nbsp; I have isolated the power supply, but it appears that there still is some noise coming down the data lines with affect the ADC output.&amp;nbsp; I have tried different chokes on the Vdda/Vssa/Vrefp/Vrefn pins without any effect.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The actual ADC routine runs as an interrupt which scans 7 of the AD pins in a loop, but the ADC error rate is the same outside an interrupt, so I have test code as below. Note that I am using the Keil RTX RTOS and Pclk is 100 MHz, and I I have tied the AD pin to a voltage source so that I can detect and quantify how many reads are inaccurate.&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;LPC_ADC-&amp;gt;ADCR = 0; // Power AD down
 LPC_SC-&amp;gt;PCONP |= (1 &amp;lt;&amp;lt; 12); // Enable power to AD block
LPC_SC-&amp;gt;PCLKSEL0 &amp;amp;= ~(1&amp;lt;&amp;lt;24); // clock 25 MHz
LPC_SC-&amp;gt;PCLKSEL0 &amp;amp;= ~(1&amp;lt;&amp;lt;25);
LPC_ADC-&amp;gt;ADCR = 7 &amp;lt;&amp;lt; 8; // conversion clock = 100 Mhz / 8 [7+1] = 12.5 MHz
LPC_ADC-&amp;gt;ADCR |= (1&amp;lt;&amp;lt;21); // PDN = set AD operational
LPC_ADC-&amp;gt;ADCR |= (1&amp;lt;&amp;lt;0); // SEL = select AD0.0 to start

int Good = 1;
int Bad = 0;
while(1)
{
LPC_ADC-&amp;gt;ADCR |= (1&amp;lt;&amp;lt;24); // START = start conversion now
while (!(LPC_ADC-&amp;gt;ADGDR &amp;amp; ( 1UL &amp;lt;&amp;lt; 31)))
;&amp;nbsp; /* Wait for Conversion end&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; */
int value = (LPC_ADC-&amp;gt;ADDR0 &amp;gt;&amp;gt; 4) &amp;amp; 0xFFF;
if((value &amp;lt; 0x580) || (value &amp;gt; 0x5FF))
Bad++;
else
Good++;
double pct = (double)Bad * 100 / (double)Good;
Debug("AN0 = %X good %5d bad %5d %.02f%%", value, Good , Bad, pct);
os_dly_wait(25);
}
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;SPAN&gt;The output of the test code is like 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;AN0 = 5D6 good&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2 bad&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0 0.00%
AN0 = 5D8 good&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3 bad&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0 0.00%
AN0 = 5D3 good&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4 bad&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0 0.00%
AN0 = 5D8 good&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5 bad&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0 0.00%
AN0 = 5D8 good&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 6 bad&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0 0.00%
AN0 = 5D6 good&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 7 bad&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0 0.00%
AN0 = 3FF good&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 7 bad&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1 14.29%
AN0 = 5D7 good&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8 bad&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1 12.50%
AN0 = 5D5 good&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 9 bad&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1 11.11%
AN0 = 5D8 good&amp;nbsp;&amp;nbsp;&amp;nbsp; 10 bad&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1 10.00%
AN0 = 5D7 good&amp;nbsp;&amp;nbsp;&amp;nbsp; 11 bad&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1 9.09%
AN0 = 5D9 good&amp;nbsp;&amp;nbsp;&amp;nbsp; 12 bad&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1 8.33%
AN0 = 5D7 good&amp;nbsp;&amp;nbsp;&amp;nbsp; 13 bad&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1 7.69%
AN0 = 5D5 good&amp;nbsp;&amp;nbsp;&amp;nbsp; 14 bad&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1 7.14%
AN0 = 5D7 good&amp;nbsp;&amp;nbsp;&amp;nbsp; 15 bad&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1 6.67%
AN0 = 5D8 good&amp;nbsp;&amp;nbsp;&amp;nbsp; 16 bad&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1 6.25%
AN0 = 5D6 good&amp;nbsp;&amp;nbsp;&amp;nbsp; 17 bad&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1 5.88%
AN0 = 5D6 good&amp;nbsp;&amp;nbsp;&amp;nbsp; 18 bad&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1 5.56%
AN0 = 5D9 good&amp;nbsp;&amp;nbsp;&amp;nbsp; 19 bad&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1 5.26%
AN0 = 5D7 good&amp;nbsp;&amp;nbsp;&amp;nbsp; 20 bad&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1 5.00%
AN0 = 5D7 good&amp;nbsp;&amp;nbsp;&amp;nbsp; 21 bad&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1 4.76%
AN0 = 5D8 good&amp;nbsp;&amp;nbsp;&amp;nbsp; 22 bad&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1 4.55%
AN0 = 5D6 good&amp;nbsp;&amp;nbsp;&amp;nbsp; 23 bad&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1 4.35%
AN0 = FFF good&amp;nbsp;&amp;nbsp;&amp;nbsp; 23 bad&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2 8.70%
AN0 = 5D5 good&amp;nbsp;&amp;nbsp;&amp;nbsp; 24 bad&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2 8.33%&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;SPAN&gt;Over time the error rate is about 2.8%.&amp;nbsp; Most of the erroneous values are 0xFFF, 0xDFF or similar, so I believe that the ADC is being glitched from noise.&amp;nbsp; A slow conversion clock gives more errors - about 4% - so I believe that the slower clock gives the ADC core more chance of glitching.&amp;nbsp; Setting the pin to pull up or pull down makes no difference.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I don't believe the problem is with the software setup / pin configuration since if I start the debugger and manually set up the ADC registers and then keep firing the START bit I get about the same error rate.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The next step would be to re-design the board to give more isolation, but that is going to take some time, and from what I see may not help much.&amp;nbsp; Any ideas?&amp;nbsp; &lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:59:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1768-ADC-errors/m-p/523159#M5795</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:59:14Z</dc:date>
    </item>
    <item>
      <title>Re: LPC1768 ADC errors</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1768-ADC-errors/m-p/523160#M5796</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by 2394y80 on Tue Nov 19 15:36:24 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Update (as I cannot reply to messages it seems)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;- I am fairly sure there is not a problem with the PCB / manufacture / soldering - these are prototype boards made by our regular manufacturer of production boards.&amp;nbsp; I have 9 boards and the 3 that I tried all behaved the same.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- Floating input pins - I've double-checked that pin connect block and everything is either a SF, output or pulled to ground.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- Other ADC pins are all unused, and they have a pull down resistor.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The interesting thing I found today is that the conversion frequency makes a difference:&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;// LPC_ADC-&amp;gt;ADCR = 1 &amp;lt;&amp;lt; 8; // 12.5 MHz = 5.5% error rate
// LPC_ADC-&amp;gt;ADCR = 2 &amp;lt;&amp;lt; 8; // 8.33 MHz = 3.5% error rate
// LPC_ADC-&amp;gt;ADCR = 3 &amp;lt;&amp;lt; 8; // 6.25 MHz = 8% error rate
LPC_ADC-&amp;gt;ADCR = 4 &amp;lt;&amp;lt; 8; // 5 MHz = 1.25% error rate
// LPC_ADC-&amp;gt;ADCR = 5 &amp;lt;&amp;lt; 8; // 4.16 MHz = 2.8% error rate
// LPC_ADC-&amp;gt;ADCR = 7 &amp;lt;&amp;lt; 8; // 3.125 MHz = 8% error rate
// LPC_ADC-&amp;gt;ADCR = 9 &amp;lt;&amp;lt; 8; // 2.5 MHz = 1.6% error rate
// LPC_ADC-&amp;gt;ADCR = 0xF9 &amp;lt;&amp;lt; 8; // 100 khz = 3.5% error rate &lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So I have changed the conversion from using an slow conversion clock and firing the next conversion from the interrupt to a timer &amp;amp; match register, which has reduced the error rate from 3.5% to 1.25%&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:59:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1768-ADC-errors/m-p/523160#M5796</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:59:15Z</dc:date>
    </item>
    <item>
      <title>Re: LPC1768 ADC errors</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1768-ADC-errors/m-p/523161#M5797</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Pacman on Wed Nov 20 08:56:01 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Strange that people can't send me email anymore. This used to work. Perhaps I'm marked as a spammer, as I wrote a long reply to a blog-post, which was rejected; and I didn't even try to sell anything. ;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Anyway... It's strange that there are still errors; and you aren't even switching channels.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Unfortunately I can't do much testing in that area here.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: &lt;/STRONG&gt;&lt;BR /&gt;I have tried different chokes on the Vdda/Vssa/Vrefp/Vrefn pins without any effect&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Uhm.. You say "Chokes" - are they 'coils' or are they ferrite beads ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-If they're coils, try ferrite beads instead; for instance 330R/200mA (BLM18BD331SN1D) or 470R/1A (BLM18PG471SN1D).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Between the ferrite-bead and the pin, connect a 100nF capacitor to GND.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you have access to a data-logger/-analyzer, you could perhaps check if the input signal changes drastically.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Just in case; I think you've already checked this, as you've isolated the power supply too: Make sure there's enough power available to your microcontroller.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But you mention that noise is coming down the data-lines. Is this noise on the ADC pins, or on other GPIO pins ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Since it's a prototype PCB... If the noise is coming in on other (GPIO) pins, it might help to run a GND trace on both sides of those data lines as far as you can, and VIAs to a GND plane on the back-side.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Running a GND trace on both sides of your ADC traces plus a GND plane below them might also be a good idea.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I don't know if there is any help in any of those things I mentioned; you probably tried them all, but if there's a chance that I hit anything, it's been worth it. :)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I think I've run completely out of ideas.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[color=#00f]Are there any ADC experts in here, who can assist ?[/color] :)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:59:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1768-ADC-errors/m-p/523161#M5797</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:59:16Z</dc:date>
    </item>
    <item>
      <title>Re: LPC1768 ADC errors</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1768-ADC-errors/m-p/523162#M5798</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by 2394y80 on Wed Nov 20 11:05:25 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Well, I thought there were ferrite beads but when I search the part number MLZ1608N1R0L I see they are listed as inductors.&amp;nbsp; I'll try the parts as you suggested.&amp;nbsp; I did use a 220nF cap to ground and also try to reduce the input impedance.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;At this point I'm committed to re-designing the PCB and getting another batch made so I'll try to shield the noisy lines as best I can when I re-design the board.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The good news is that in the worst case I can over sample and filter out the erroneous values via software if I have to, but I'd rather fix the root cause.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;SPAN&gt;I did find a lot of references to ADC noise on the mbed part (which uses the LPC1768 as well) so it seems that the ADC is easily glitched in that micro-controller.&amp;nbsp; See &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fmbed.org%2Fforum%2Fbugs-suggestions%2Ftopic%2F1514%2F" rel="nofollow" target="_blank"&gt;http://mbed.org/forum/bugs-suggestions/topic/1514/&lt;/A&gt;&lt;SPAN&gt; and &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fmbed.org%2Fforum%2Fmbed%2Ftopic%2F1866%2F" rel="nofollow" target="_blank"&gt;http://mbed.org/forum/mbed/topic/1866/&lt;/A&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:59:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1768-ADC-errors/m-p/523162#M5798</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:59:16Z</dc:date>
    </item>
    <item>
      <title>Re: LPC1768 ADC errors</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1768-ADC-errors/m-p/523163#M5799</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Pacman on Wed Nov 20 13:09:53 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: 2394y80&lt;/STRONG&gt;&lt;BR /&gt;Well, I thought there were ferrite beads but when I search the part number MLZ1608N1R0L I see they are listed as inductors.&amp;nbsp; I'll try the parts as you suggested.&amp;nbsp; I did use a 220nF cap to ground and also try to reduce the input impedance.&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The 220nF cap should easily replace a 100nF. ;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Hopefully the switch to ferrite beads will help.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: &lt;/STRONG&gt;&lt;BR /&gt;At this point I'm committed to re-designing the PCB and getting another batch made so I'll try to shield the noisy lines as best I can when I re-design the board.&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;SPAN&gt;That's what I always do when I have my first batch of prototype boards: I find all the errors I can, and all the possible places that can be improved on, then I get the second batch, if all checks out, I go for production.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: &lt;/STRONG&gt;&lt;BR /&gt;The good news is that in the worst case I can over sample and filter out the erroneous values via software if I have to, but I'd rather fix the root cause.&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;SPAN&gt;That's a good engineer! :)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(and you could leave the filtering code in there, even though the problems are fixed).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: &lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I did find a lot of references to ADC noise on the mbed part (which uses the LPC1768 as well) so it seems that the ADC is easily glitched in that micro-controller.&amp;nbsp; See &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fmbed.org%2Fforum%2Fbugs-suggestions%2Ftopic%2F1514%2F" rel="nofollow" target="_blank"&gt;http://mbed.org/forum/bugs-suggestions/topic/1514/&lt;/A&gt;&lt;SPAN&gt; and &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fmbed.org%2Fforum%2Fmbed%2Ftopic%2F1866%2F" rel="nofollow" target="_blank"&gt;http://mbed.org/forum/mbed/topic/1866/&lt;/A&gt;&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hmm, that does not look good. It could be board-design, though. If you need accuracy, it could perhaps be good to have an option for mounting an external ADC, just in case?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I wonder what makes all that noise possible. Are you running from the internal oscillator, by the way ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If you are, try patching in a 12MHz clock crystal if possible, and see if it changes anything.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Just one more note; I do not know if I've mentioned it earlier:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Have you tried disabling the ADC-function on all ADC-pins, except the one you're currently using for measuring ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If the signals should not be short-circuited to GND, you could perhaps try making "high-impedance" pins by changing the pin to GPIO + Open Drain and set it to output ? (I haven't thought much about this, there could perhaps be pitfalls).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I just saw &lt;/SPAN&gt;&lt;A href="http://http://mbed.org/users/chris/notebook/Getting-best-ADC-performance/"&gt;this&lt;/A&gt;&lt;SPAN&gt; -I followed a link on the last site you mentioned.&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:59:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1768-ADC-errors/m-p/523163#M5799</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:59:17Z</dc:date>
    </item>
    <item>
      <title>Re: LPC1768 ADC errors</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1768-ADC-errors/m-p/523164#M5800</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by rocketdawg on Wed Nov 20 13:57:59 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;An interesting observation in AN10974.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;JTAG debugging reeks havoc&amp;nbsp; on ADC sampling.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:59:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1768-ADC-errors/m-p/523164#M5800</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:59:18Z</dc:date>
    </item>
  </channel>
</rss>

