On 5/12/07, Bob Axtell wrote: > Yes, I have had no trouble either. To REALLY get an absolute reading, > sum 8 readings then divide them by 8 > (shift right three times). This is- in effect- a way to cancel noise > out, as one sample might be taken below the value, > another time above the value. Err... No. This is a good way to lose precision. For example, say you have 7 samples with a value of 512, and one sample with a value of 511. The sum is 4095, and when you do a right shift 3 times (divide by 8), you get 511 (due to integer arithmetic). What you want to do is to sum 8 samples, add (8/2), and then divide by 8. In the above example, you have (4095 + 4) / 8 = 512 (integer arithmetic) which is what you would want. > The biggest problem people have with PIC's ADC is that they don't allow > the input sampling cap to charge up > properly before they take the measurement. If the impedance on the PIN > is high (> 5K) then you might need > 5ms before the input cap can obtain a reliable sample. Definately! In one project I was doing, I had to continually sample one ADC channel, but occasionally had to sample another. The continually sampled ADC channel was fine, but when I switched to the other channel I noticed a "ghost" of the original channel for the first few measurements. What I wound up doing was to throw away the first few measurements when I switched ADC channels. Bill { currently in digest mode before I leave on vacation } -- Psst... Hey, you... Buddy... Want a kitten? straycatblues.petfinder.org -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist