DT_Analog & 12F1822 internal voltage reference


Results 1 to 19 of 19

Threaded View

  1. #6
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default Re: DT_Analog & 12F1822 internal voltage reference

    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...

    Quote 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 ...
    1. The current VDD voltage during the test.
    2. The A/D reading of the FVR at that voltage.
    3. 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

    .
    Last edited by Darrel Taylor; - 7th November 2012 at 05:53.
    DT

Similar Threads

  1. Fixed Voltage Reference
    By kduck63 in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 20th April 2012, 11:27
  2. ADC with reference voltage
    By GoldStar in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 20th May 2010, 21:01
  3. ADC - 2 channels but not same voltage reference - how to?
    By flotulopex in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 25th November 2007, 19:03
  4. COMPARATOR - Voltage Reference settings
    By flotulopex in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 9th October 2007, 07:06
  5. AD Negative Voltage reference
    By flotulopex in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 28th June 2007, 15:01

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts