Robert Rolf wrote: > Can't you tell that just from the value you set for the reference voltage? > Seems to me 3 pins is all you need since the number of cells also determi= nes > the reference voltage you want. The charger has a fixed reference voltage (2.048V -- a little close to the = PIC's 2V minimum, but it seems to work). One NiMH cell has a maximum safe voltage of 1.5V, but I'd like to give the = circuitry the ability to measure up to 2V (just for the sake of having a bi= t = of a safety margin) > Or something. 1% resistors attached to tri state pins on PIC to change > values in binary. If you're clever about the R values you can probably > get away with ONE pin. Low, Tristate, High for 1, 2, 4 cells. Hm, not in an opamp feedback circuit. I could replace the pulldown resistor = with a permanent pulldown and two switchable parallel resistors.. Good idea= , = thanks. 5p worth of resistors vs. a =A35 digital potentiometer IC... -- = Phil. | Kitsune: Acorn RiscPC SA202 64M+6G ViewFind= er philpem@dsl.pipex.com | Cheetah: Athlon64 3200+ A8VDeluxeV2 512M+10= 0G http://www.philpem.me.uk/ | Tiger: Toshiba SatPro4600 Celeron700 256M+4= 0G -- = http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist