As I always do, let me preface by saying I'm a noob with little surety, a modest desire to help, and an immense desire learn. It is my hope that by making a sincere effort to solve your problem, it will be one I do not have to make for myself
Looking at page 128 of the datasheet, it would appear your ADCON1 register is bunged:
Your setting: ADCON1 = %000111, appears to me to left justify the two high bits with ADCON1.7 = 0; I should think it would be easier to manipulate an ADC value with all the bits right justified (ADCON1.7 = 1). Also, the right bits (0-3) are A/D port configuration control bits - they set which channels are ADC, which are the Vref+/- channels, and which are digitals. There are two settings which RESEMBLE your configuration:
'011X', which disables ADC (making all channels digital) and '1111' which sets AN0 as analog, AN2 as vRef- and AN3 as vRef+. This appears to be what you want...
So, if my evaluation is correct, 001111 is the correct ADCON1 register configuration setting for 1 ADC channel, 10 bit resolution, right justified. Do you read it this way as well?
Actually, in better looking at the choices (doh) it appears that 001110, sets AN0 analog - without vRefs. Time to edit had expired...





Bookmarks