At 04:08 PM 6/9/2005, Todd Bailey wrote: >>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 -- that's exactly the > function I want, although the circuit doesn't have to be single supply. > > Further, to clear things up w/r/t an earlier suggested solution: >Vout isn't necessarily going into an ADC -- it might very well stay >analog, so the output has to be linear. Seems like it'd be totally doable >with a few op amps -- is that true? What frequency response? How much noise in the output can you tolerate? If I was trying to do this without involving a micro, I'd look at something like a ramp generator using PWM to drive a SPDT analog switch. The input voltages would set the ramp reference and PWM comparitor voltages; the SPDT analog switch would alternately switch the output between the desired output rail and gnd. The output ripple can be quite low if you set the PWM frequency high enough (KHz or tens of KHz). You can put an optical barrier at the PWM stage if you require voltage isolation. First glance suggests somewhere near 4 op-amps (better yet: comparitors) and something like a 4053 triple SPDT analog switch. That's assuming that the input signals are always within the common-mode range of the op-amps. Va feeds the ramp upper limit comparitor, Vb feeds the ramp lower limit comparitor (ramp output oscillates between Va & Vb), output of ramp generator feeds one input of PWM comparitor, Vc feeds other input of PWM comparitor. PWM comparitor feeds control input of SPDT analog switch with NO contact to Vdd, NC contact to Gnd, output comes from armature output via low pass filter. Add active filter if you need better ripple filtering and / or lower output impedance. So: a single LM339 quad comparitor with a few passives, a single cd4053 (might as well parallel all 3 switch sections), plus whatever low pass filter you want. dwayne -- Dwayne Reid Trinity Electronics Systems Ltd Edmonton, AB, CANADA (780) 489-3199 voice (780) 487-6397 fax Celebrating 21 years of Engineering Innovation (1984 - 2005) .-. .-. .-. .-. .-. .-. .-. .-. .-. .- `-' `-' `-' `-' `-' `-' `-' `-' `-' Do NOT send unsolicited commercial email to this email address. This message neither grants consent to receive unsolicited commercial email nor is intended to solicit commercial email. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist