> >> Given Va, Vb, and Vc, with output Vout and single-rail supply Vdd: > >> Vout = [(Vb-Vc)/(Va-Vc)]*Vdd > >> where Va > Vb > Vc, right? > > > > The equation you suggested is absolutely right > > Really? I thought you defined B as the bottom voltage and C as the middle. Perhaps he did, but I "re-labeled" to make it a little more logical for me. At any rate, I'd suggest using a digital solution, too, if you can make it work. Not knowing right off what the actual ranges are makes it tough, but if they are correct, using (with my nomenclature) Va as the Vref+, Vc as Vref-, and Vb as Vadc, the resulting reading of the ADC could be directly sent to a DAC of some sort with the end result being a voltage scaled between the supply rails of the DAC in exactly the manner you're looking for. No muss, no fuss. In fact, even if Va and Vc AREN'T within the acceptable range for the Vref+ and Vref- on the ADC, you can force them to be with pretty simple op-amp circuits. Since you mentioned that these voltages are "slow-changing" (to me that means Hz or even sub-Hz range), this sort of method should work quite well. Mike H. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist