Thanks for this PCMProgrammer. It is wrong on the posted code. A typo on my part due to cut and paste etc.
It is right in the main code that I am using but thank you, it made me go and check.
...
Can anybody help me with this problem? I am trying to read a DC voltage going from 0.5 to 3.5V on pin A2 of a pic16F15345. For some reason all I can read is the max value of 1023 or thereab ...