So, you can only assign analog inputs in ascending order, but the only thing that will 'affect' is when the 'lower' pins are inputs. IOW, if the lower pins are all outputs, you can assign ANx as an analog input and only that pin will be treated as such and the only one you will have to worry about. Put a third way, the digital I/O assignments for outputs override the analog input settings. Joe M. peter green wrote: > MCH wrote: >> Am I reading the PIC 18F4520 docs correctly that you can only assign >> analog inputs in ascending order? IOW, if I want only three analog >> inputs, I have to use pins AN0, AN1, and AN2 and I cannot make the >> selection based on open pins such as AN3, AN8, and AN9? >> >> Put another way, if I want AN5 to be analog, AN4-AN0 has to be analog as >> well. >> > Yes and no > > Yes you can only put pins into analog mode in order. However afaict the > only thing that putting a pin in analog input mode does is disable the > digitial input buffers. > > So you can still use a pin as a digital output when it's set as analog > (this was very useful when I had to drive a resistive touchscreen) and > if you are prepared to put up with the extra power consumption caused by > having a digital input floating between the rails you can use a pin as > an analog input when it's set as digitial. > > > ------------------------------------------------------------------------ > > > No virus found in this incoming message. > Checked by AVG - www.avg.com > Version: 9.0.733 / Virus Database: 271.1.1/2684 - Release Date: 02/12/10 14:35:00 > -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist