just noticed you have no adc defines
could help, they should be included anywayDEFINE ADC_BITS 8
DEFINE ADC_CLOCK 3
DEFINE ADC_SAMPLEUS 100
just noticed you have no adc defines
could help, they should be included anywayDEFINE ADC_BITS 8
DEFINE ADC_CLOCK 3
DEFINE ADC_SAMPLEUS 100
you are setting the frv (ps bit 6 of fvrcon is read only) but never connecting it to the adc module .ADCON1 = %00000000
FVRCON = %11000010 'voltage reference set to 2.048V
to use the fvr as ref you need to set adcon1 bits 0 & 1 to 1
you have also selected a conversion clock of fosc/2 which @4mhz is out of specs
you need fosc/4 or rc clock for adc
Bookmarks