I've become quite adept at pin sharing. :-) Thanks for the confirmation. The basic premise is what I was asking about - whether having AN5 used means I have to set AN4-0 as analog as well (even temporarily in the subroutine). Pin sharing aside, I think you confirmed that is true. So, getting into sharing, not only would I have to consider what is connected to AN5, but also perhaps AN4-0 if the circuit cannot be left floating while AN0-4 are defined as analog inputs. Joe M. ivp wrote: >> Am I reading the PIC 18F4520 docs correctly that you can only >> assign analog inputs in ascending order? > > Yes. Some are not like that, and you can assign any individual pin as > an analogue input on its own > > Depending on the circuit, you should be able to temporarily switch > from outputs to inputs if the pin is not left floating. For example if > you want AN5 to be the analogue input and PORTA <4:0> are in > use as outputs, you set PORTA <5:0> as inputs in TRISA and > ADCON1 <3:0> = 1001 to configure AN <5:0> whilst you select > and read AN5 (ADCON0 <5:2> = 0101) > > wbr -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist