18F46K22 FVR ADC Issue
Posted: Wed Dec 14, 2011 4:51 pm
I have been trying to turn on and use FVR (@ 4.096V) on a 18F46K22 using some suggestions for other devices in other posts on this forum but not having any luck. I have code compiled with the CCS compiler that is getting a value of 1023 on AN0 and I'm trying to get the same results in Flowcode but the value is 768. I tried customizing the SampleADC component macro using the following code but the results did not change.
Code: Select all
//Assign FVR functionality
st_bit(adcon1, VCFG1);
clear_bit(adcon1, VCFG0);
//turn on FVR and set to 4.096V
vrefcon0 = 0xF0;