> I'm not sure I quite understand how ADCON1 works on the 16F877, > Im looking to have two or three analogue inputs and still maintain > the rest of the pins as digital I/O's Your best bet would be to set PCFG3:PCFG0 to 0100. That gives you 3 x A (RA0, RA1, RA3) and 5 x D 0010 sets PortE to D and PortA to A if you'd wanted 3 x D and 5 x A ;-( Table 11-2, DS30292B (F877 Manual) or Section 21, Mid-Range Manual -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads