I have about a dozen MCU development boards from various manufacturers sitting around my lab. With one exception, the ADCs built into the MCUs on these boards generate lots of noise.
To attempt to characterize this problem, I wrote a small bit of test code that allocates an array of longs either 1024 (for a 10-bit ADC) or 4096 (for a 12-bit ADC) elements in size. I then set up a resistor voltage divider to place the input voltage to the ADC right in the middle of the ADCs input range. The code then continuously reads the ADC and uses the value read as an index into the counter array and increments that element.
After letting this code run for a few days, I can then download the contents of the array and use it to plot a histogram of the results.
I would expect to see a fairly sharp, well-defined spike right at the midpoint (512 for a 10-bit ADC or 2048 for a 12-bit), with some outliers at maybe +/- 20 counts on either side.
What I'm actually seeing are very wide Gaussian curves that reach all the way down to 0 and all the way up to the maximum limit of the ADC. The counts at the extreme ends are not trivial, either.
I'm at the point in a project where I have to design my own PCB. I have two questions:
1. Can anyone point me to an article or book describing how to properly design the analog section of an otherwise digital PCB to avoid noise issues on the analog side?
2. Is what I'm trying to do even realistic? Can a 10 or 12 bit internal ADC in a 32-bit MCU running at 100 MHz with UARTs, SPI buses, I2C, etc, running simultaneously, even hope to generate good results under these circumstances?