> Am I reading the PIC 18F4520 docs correctly that you can only > assign analog inputs in ascending order? Some of what I wrote previously is not correct. A couple of points - In your example, any pins below AN5 that are set as digital I/O do not need changing to analogue inputs, so you can leave TRISA as you need it. However, if AN5 is selected as a digital I/O then you might get a problem if it has an analogue voltage on it IOW, it's OK to have digital signals on a pin configured as an analogue input or potential analogue input but it's not always OK to have analogue voltage on a pin configured as a digital I/O. A series current-limiting should prevent excessive power consumption In that case, if you want to use AN5 as the analogue input, set ADCON1 to 1001, TRISA <5> = 1 and ADCON0 to 0101 Sorry for the mistake, was kind of thinking of something else wbr -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist