On Tuesday 04 February 2003 01:55 pm, you wrote: > Assuming high impedances are OK, there's a different way to address > the problem with the common-mode input range of the comparator. > Instead of connecting the RC filter to the comparator (-) input, > connect it to the (+) input and put a resistor between the pot wiper > and the (+) input, like this: > > o +5V 16F628 > > | +--------- > > \ 10K | > / 470K RA2| > \<---/\/\/\---+------------| comp + > / | 470K RA3| > \ +--/\/\/\----| charge > > V =3D=3D=3D 0.02uF | > > V +--------- > > Connect the (-) input to a fixed internal or external reference of > 0.5*Vcc. Modify the firmware so that it inverts the state of the > comparator output bit when it copies it to the charge pin. The > circuit now operates so that the average voltage on the charge pin is > the complement of the voltage on the pot wiper, and both inputs to > the comparator are held at 0.5*Vcc. That's pretty neat, I'll have to try that. I'm guessing that the=20 advantage is reduced current consumption and the fact that the=20 comparator is being operated at it's most accurate point. Does that=20 sound right? michael -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body