On Sun, 18 Apr 2004 07:50:20 -0500, Edward Gisske wrote: >I am contemplating using a 16F873A for a project. The circuit needs to have >one channel of A/D and one comparator and a bunch of digital I/O. After a >lot of RTFM'ing of the Data Sheet and the Mid-Range reference, I haven't >been able to devine if it is possible to use port A for A/D, comparator, and >some digital I/ >O at the same time (different lines of Port A of course). Do the comparator >inputs have to be designated as A/D inputs in ADCON? How are these functions >multiplexed? > The 873 has 5 A/D channels but it doesn't have any comparators. You can mix A/D channels with digital I/O by setting ADCON1 bits (16F87x data sheet, DS30292C, page 112). A setting of 0 configures all 5 port A pins as A/D channels. A setting of 6 or 7 configures all 5 port A pins as digital I/O. The other settings configure the port for different mixes of A/D inputs, digital I/O, and Vref selections. Depending on your application, you could perhaps compare an A/D result to a fixed value to perform as a comparator in software. Alternatively, you could implement an external hardware comparator and read its output with a digital I/O pin. Regards, Bob -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.