Many people have started threads about problems that they have had with the ADC on the LPC1768 - this is yet another one, but with a tool that others can use to reach their own conclusions.
I built the tool (link above) to analyze the ADC performance after reading, with some horror, the earlier threads, and it confirms (for me at least) that the ADC is prone to glitches - and by glitch I mean a hardware event (fault), probably related to some actual noise (internal or introduced via the input lead) disrupting the successive approximation process that is at the heart of the converter. SAR converters are particularly vulnerable to noise at the comparator input when a "bit" is being determined; if an error occurs, it cannot be later corrected and will show up as a "spike" in the result.
Noise at the input to an A/D should appear as a gaussian (bell shaped) distribution of readings. The reading distributions of the LPC1768 show significant departures from a gaussian distribution. With very clean inputs, the readings distribution are nominally gaussian, but "spikes" (outliers in the distribution that are statistically improbable) appear. If good circuit practices are not followed, these spikes predominate and the ADC becomes unusable.
The glitch suppression technique that is included in the tool appears to be effective when good circuit practices have been followed, and makes the onboard ADC useable for most applications.
For those that are offended by the "fix", I suggest using an MCP3208 (SPI 12 bit ADC) - it's what I use with great success.
Import programAnalogInAnalyzer
Last commit 18 Feb 2011 by Bob Anderson
Many people have started threads about problems that they have had with the ADC on the LPC1768 - this is yet another one, but with a tool that others can use to reach their own conclusions.
I built the tool (link above) to analyze the ADC performance after reading, with some horror, the earlier threads, and it confirms (for me at least) that the ADC is prone to glitches - and by glitch I mean a hardware event (fault), probably related to some actual noise (internal or introduced via the input lead) disrupting the successive approximation process that is at the heart of the converter. SAR converters are particularly vulnerable to noise at the comparator input when a "bit" is being determined; if an error occurs, it cannot be later corrected and will show up as a "spike" in the result.
Noise at the input to an A/D should appear as a gaussian (bell shaped) distribution of readings. The reading distributions of the LPC1768 show significant departures from a gaussian distribution. With very clean inputs, the readings distribution are nominally gaussian, but "spikes" (outliers in the distribution that are statistically improbable) appear. If good circuit practices are not followed, these spikes predominate and the ADC becomes unusable.
The glitch suppression technique that is included in the tool appears to be effective when good circuit practices have been followed, and makes the onboard ADC useable for most applications.
For those that are offended by the "fix", I suggest using an MCP3208 (SPI 12 bit ADC) - it's what I use with great success.