That's great Steve!
You actually saw how it works. 
And as a "Single Point" calibration, it should definitely be calibrated as close to the "nominal" voltage as possible.
However, there's an interesting twist to the calibration procedure, which I'll try to cover first...

Originally Posted by
retepsnikrep
OK lets talk about calibrating it for the extra accuracy. ?
OK, let's ... 
Remember that Calibration can only be as accurate as the Test Equipment used to calibrate it.
Using a handheld voltmeter with it's Low Battery indicator flashing ... probably isn't the best tool.
I rely on a Tektronix Digital scope for my readings, but it has never been calibrated so I'm sure it's not perfect. (There's really no such thing as "Perfect").
Manual calibration of the FVR is fairly simple. All you need is ...- The current VDD voltage during the test.
- The A/D reading of the FVR at that voltage.
- The Maximun Possible A/D value. (65472 for 16-bit DT_Analog)
For example, on a 12F1822 here I read ...
VDD = 5.11 V <-- Measured VDD voltage
ADC = 13307 <-- Actual A/D reading from the FVR
So you can use a calculator, spreadsheet or your superior mental abilities to do ...
V = VDD / MAXad * ADC
V = 5.11 / 65472 * 13307
V = 1.039
Adjust the constant to match the measured FVR voltage ...
Code:
FVrefMV CON 1039 ; Fixed Vref Voltage in mV ( must match FVRCON )
And you have a nice single point calibration that will read exactly the same voltage as the test equipment at the test conditions.
So here's the "twist".
Since the calibration formula includes the measured VDD, the math doesn't care if it's 3V or 5V.
The end result is the voltage of the internal reference.
If the test VDD was 3V, and the A/D reading was 22675 ...
V = VDD / MAXad * ADC
V = 3.00/ 65472 * 22675
V = 1.039
So the FVrefMV CON 1039 is the same either way, and it's the only thing that gets changed in the program.
The math in the program uses 5V as a key datapoint, but the actual calibration voltage doesn't have to be that.
But the truth is ... if you calibrated it at 3.00V, the A/D result would NOT be 22675.
The so called "Fixed" voltage reference, varies with VDD.
So for accuracy across the full range, you need at least a two point calibration.
How do you do a "Two Point" calibration of the Fixed Voltage Reference?
I don't know, I haven't done it yet.
Get me started ... I dare ya 
.
Bookmarks