Can you show where you configure the A/D module of the PIC in your code?
In particular, you should have configured the A/D clock in the ADCON2 register. Please refer to Table 17-1 in the datasheet to choose it correctly.
How I can configure this ADCON2 register programming in C?
The A/D configurations are:
restart_WDT();
setup_oscillator (OSC_2MHZ|OSC_NORMAL);
SETUP_ADC(ADC_CLOCK_DIV_32 | ADC_TAD_MUL_20);
SETUP_ADC_PORTS(ALL_ANALOG| VSS_VDD); //Actually i use only the pins
restart_WDT(); //A0 and A1 as analog inputs