> The other comparator input is connected to a pot wiper Is the pot > 10k and greater than the recommended source impedance ? Have you tried a 4k7 ? Maybe there's a little crosstalk between RA2 and RA3 as RA3 switches -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.