At 02:17 PM 11/3/2004, Eisermann, Phil [Ridg/CO] wrote: >I want to use a single comparator on a 16F628A. One input >should be the internal reference voltage. > >So, to sum it up in short form, I want to >1) use a single comparator (mode 101). >2) connect my analog input to RA1. >3) configure RA2 as a digital output. >3) connect Vin+ of the comparator to the internal reference. I *think* that you have to use mode 010. The consequences of this are that pins RA0, 2, 3 are also all analog inputs and cannot be used as digital inputs. They can be used as digital outputs so long as you deal with any R-M-W issues (use a shadow register). Note that you also have to ensure bit VROE is held low. What is your intended usage for the two pins you didn't mention (RA0, RA3)? dwayne -- Dwayne Reid Trinity Electronics Systems Ltd Edmonton, AB, CANADA (780) 489-3199 voice (780) 487-6397 fax Celebrating 20 years of Engineering Innovation (1984 - 2004) .-. .-. .-. .-. .-. .-. .-. .-. .-. .- `-' `-' `-' `-' `-' `-' `-' `-' `-' 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