>Hi peeps, > Can anybody throw any light on this problem I have? I am using the ADC >on a PIC 16C77 and I am having problems with readings that 'float' around >+/- 2 of a central value in subsequent conversions. A simplified circuit is >shown in the attached diagram. > >I have 4 of these connected to A0,A1,A2 and A5, with VRef on A4 being taken >from one of the emitter outputs. I cycle around each of these taking a >reading. The transistor is there because I will have any number of channels >of 4 attached and I will select which bank I want with the output from a >counter or the pic itself. But for now it is tied to +5V. > >Now the problem goes away if I remove the diode from the circuit. But I need >one there as I shall have multiple copies of this connected to each 'A' pin. > >Now my analogue electronics knowlege goes as far as 'never stick your tounge >in a plug socket' so I am at a loss to explain why this should happen. > >If anybody can explain to me why this happens, but most importantly how I >can fix it I shall be very gratefull. > Diodes generate noise. A low pass RC filter will reduce the high frequency noise. Maybe you could swap the diode and the 1k resistor and put a 0.1uf cap to ground on the pic side of the resistor. You will need to allow additional settling time when switching to another bank of pots. (I assume that's what you're doing) A better solution howver is to average several readings, since you will always have at best a +-1bit uncertainty on individual ADC conversions. Ray Gardiner (DSP Systems) ray@dsp-systems.com http://www.dsp-systems.com private email to:- ray@netspace.net.au