At 12:25 PM 1/7/98 -0500, you wrote: >---------- Walter, I like the approach. Is there any code examples that do this? > > --------------| 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 > >