If I want to configure only AN4 (RA5) of a 18f4620 for ADC input, and AN0-3 for digital inputs or outputs purposes, can this be done? Looking at the datasheet for register ADCON1, this does not seem possible? Any workaround?
If you only want 1 analogue pin then it needs to be AN0. To get AN4 to be analogue requires that you make 5 pins analogue. You can use analogue pins as digital outputs but not as digital inputs. Alternatively choose a more recent pic with the ANSEL registers.