Well, yeah, except it does affect the swing, and therefore the noise margin; you would like the whole range (with the added end R's, and using a given modulation scheme) to not be too tightly centered at the threshold. So you should at least approximate the whole waveform, i.e., do the math for the extremes just to be sure that everything has good resolution. I personally had good results with a differential scheme, where the cap is charged with a known resistance and then charged with the unknown. This gets around the tempco problems for all but the R's. Also allows the use of "sloppy" digital inputs (as long as the stimulus conditions are the same for both the known & unknown cycles) and can therefore be used on the simplest PICs (without comparators, or A/Ds, or even a Schmidt trigger input) --Tom Rogers -----Original Message----- From: Walter Banks To: PICLIST@MITVMA.MIT.EDU Date: Wednesday, January 07, 1998 1:12 PM Subject: Re: Best way to read a POT without the A/D? > --------------| Output Bit > | | > / Rh | > \ | > |--------------| Vin Sense bit > / | | > \ Rl === C | > | | | > ------- > | > GND > > > Vin the sense bit is at the threshold of the gate going into the > micro controller. Rh and Rl are the two resistors parts of the POT > The output bit is PWM by software to act like a variable voltage > for the resistor chain. > Rl Th > Vin = -------------- * ------------ * K > Rl + Rh Th + Tl > > "Th" is the high time of the output bit and "Tl" is the low time of the > > output bit. The software to measure the pot position toggles the > output bit to keep the Vin at the gate threshold. Solving the above > equation will show that there is a direct relationship between the > software PWM times and the pot position. > > Practical implementations will have two fixed value resistors on > each end of the POT so the POT will operate over its entire range. > The C value is non critical. It is only used for filtering. > > >Walter Bankls >