>>PIC's A/D gives me >>random values from 240 to 247. Is this normal? Is there a way to make the >>A/D shows a steady reading? >Unfortunately..... >It is called "quantization error" on most data sheets, and can amount to >quite a few bits. No, this is NOT quantization error. Quantization error is the difference between the actual analog value and the nearest digital value that can be put out by the converter. In the type of A/D used in PIC's, the quantization error is ALWAYS +-1/2LSB. >On the 16-bit converters we are looking at, and have used in the past, 6-9 >bits is not unusual. >The Max186 ADCs are quite tight in comparison, and are usually <3 bits. >I have no experience (yet) with the '74 or '877 ADC's, but the numbers you >give don't surprise me at all. I don't know about delta-sigma converters, but I strongly suspect that all A/D converters have quantization error of +-1/2LSB. There may be errors in delta-sigma's due to the fancy techniques they use to get outputs faster than 1/2^^n times the clock frequency (n being the number of output bits). They may even call this quantization error or quantization noise, but this kind error is not found in successive approximation converters, which are used in PIC's. >Best way to deal with this inherent noise is to average several readings. >Decimation is a standard technique and if you can average enough samples, >you can actually gain resolution. If there is +-3.5 LSB's of noise in a 10-bit converter (it is 10, isn't it?), then averaging may not be the best way. As others have said, proper circuit design should get your noise down to around +-1 LSB or less. Of course, if you can afford the averaging, it may be easier than doing the proper design work. The idea of gaining resolution is a neat one. You can actually get 12-bit resolution out of a 10-bit converter (but accuracy won't improve). Here's the surprising thing about that: in order for it to work, you need AT LEAST +-2LSB's of noise! By the way, the theoretical improvement in noise is to divide by the square root of the number of samples. For example, if your noise is 4 mV and you want it to be 1 mV, you need 16 samples. In practice, I've found it takes several times this number to achieve the results I want. >Things to do to help the situation: Make VERY sure you have the right >bypass capacitors in ALL the right places! Noisy analog power supplies and >reference supplies can kill a good ADC. You can also hang a cap directly >onto each power/reference pin, and insert a small series resistor to the >power rail--10 to 100 ohms depending on the current draw. This will >further isolate the bypass cap and increase its effectiveness. Bypassing is critical. The PIC and other digital devices put noise on your power supply lines. You need to get this out before you use these supplies for AVcc or Vref. The suggestions above are excellent. 0.1uF ceramic caps very close to the analog supply and reference pins on the PIC are good. 0.01 ceramic in parallel with 1uF tantalum is even better, though often not necessary. There's one other thing that can contribute - actual noise on your input signal. Keep in mind that this could come from noise on the ground line between your sensor and your A/D. To minimize this problem, run the ground straight from the sensor to the AGnd, and don't put any digital stuff on this line. If your actual signal is noisy, this is where filtering and averaging come in. Your meter probably does some of each, which could explain why it reads steady while your A/D doesn't. Hope this helps. Don