I want to use the ADC Fixed Voltage Reference FVR in case of the 16F18857 microchip.
http://www.microchip.com/wwwproducts/De ... /documents
I choose a potentiometer as example for input of an ADC. There is a possibility to choose "FVR" as Vref option in the ADC macro.
But this chip has three possible FVRs: 1.024 V, 2.048 V or 4.096V. The ADC macro does not show which FVR will be choosen.
What to do?
Kind regards
Jan
ADC FVR (Fixed Voltage Reference)
Moderator: Benj
- Jan Lichtenbelt
- Posts: 797
- Joined: Tue Feb 17, 2009 8:35 pm
- Location: Haren GN, the Netherlands
- Has thanked: 128 times
- Been thanked: 264 times
- Contact:
- Jan Lichtenbelt
- Posts: 797
- Joined: Tue Feb 17, 2009 8:35 pm
- Location: Haren GN, the Netherlands
- Has thanked: 128 times
- Been thanked: 264 times
- Contact:
Re: ADC FVR (Fixed Voltage Reference)
In the meanwhile I found a solution by entering the c-code after the RawEnable macro:
Kind regards
Jan
This gives ADC values between 0-1024 for voltages between 0-2.48 Volt.//ADC Vref+=FVR=2.048 Volt
FVRCON= FVRCON | 0x82; // set bit 1 (FVR 2.048 V) and 7 (FVR enable)
FVRCON= FVRCON & 0xFE; // clear bit 0 (FVR 2.048 V)
Kind regards
Jan