Figuring out the Fixed Voltage Reference (FVR) 12F1822 (and others)


Closed Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2009
    Location
    Utah, USA
    Posts
    427

    Default Figuring out the Fixed Voltage Reference (FVR) 12F1822 (and others)

    Hey group,

    Well I spent most of the weekend trying to figure out how to take advantage of the FVR to improve my A/D conversions.

    Just when I though I'd never get it... and Darrel's (and others) hints and tips were falling into a black hole (where my brain should be), it all started to make sense.

    I can now use the FVR as a reference to either reading Vdd or an outside AD input. (what fun!)

    Any way one thing that is still confusing me is a note on the 12F1822 datasheet.
    The FVRCON register contains a FVRRDY bit 6 that tells you when the FVR is stable.
    Note 1: FVRRDY is always ‘1’ on PIC12F1822/16F1823 only
    Datasheet pp. 138

    So what are the ramifications of that??
    Does that mean that one should include a fixed delay to give the FVR time to settle down? Or that the FVR is always ready on these chips and there is no need to wait for it?


    thanks
    Last edited by Heckler; - 17th February 2014 at 23:33.
    Dwight
    These PIC's are like intricate puzzles just waiting for one to discover their secrets and MASTER their capabilities.

  2. #2
    Join Date
    Oct 2009
    Location
    Utah, USA
    Posts
    427


    Did you find this post helpful? Yes | No

    Default Re: Figuring out the Fixed Voltage Reference (FVR) 12F1822 (and others)

    Most of what I learned and the Code samples I used came from this other thread...
    http://www.picbasic.co.uk/forum/showthread.php?t=17321

    I'd be happy to share anything I learned with others...

    Mostly what I had to understand was that whatever you use as the ADC voltage reference (VDD, FVR, or External Vref+ on AN1) will be equivalent to 1023 counts (10bit) and the analog voltage you are trying to read will be measured against that (and cannot exceed that REF without employing some sort of voltage divider to scale it down.)

    So if you program the FVR to be 1.024v then that will be 1023 counts and your analog input cannot exceed that.

    When your external analog input is the same voltage as what ever you have chosen as the reference (via ADCON1) it will also read as 1023 counts. So if you set the FVR to be 4.096v then your analog input will also show 1023 counts when it reaches 4.096 volts.

    If you want to calibrate the FVR (ie. find out what it actually is internally [since, as Darrel pointed out] it will likely only be close to the data sheet value)
    then set the registers (ADCON0, ADCON1 & FVRCON) so that the ADC uses VDD for the reference and do an ADCIN 31 (which is the FVR channel) you can then (using an accurate voltmeter) measure your VDD, and compare the reading you get from the FVR (ADCIN 31) and then do a simple ratio to determine the real FVR voltage.

    ie. if your VDD is 4.500 volts and you read 233 counts on ADCIN31 then 4500/1023 = ?(FVR actual)/233 So the answer is FVR real = 1024.9 mv or 1.0249 volts. Continuing with that same test but this time setting the FVR to be 4.096 (by changing FVRCON) and you read 930 counts on an ADCIN31 then...
    4500/1023 = ?/930 then the FVR is actually putting out 4.0909v NOT 4.096v.

    You can then use the above information to adjust your calculations when using the FVR as the reference to an external AD measurement.

    I hope this helps others understand. And if I got something wrong here please correct me.
    I am by no means an expert but it helps me to understand it just by writing it here.
    Last edited by Heckler; - 18th February 2014 at 02:59.
    Dwight
    These PIC's are like intricate puzzles just waiting for one to discover their secrets and MASTER their capabilities.

Similar Threads

  1. DT_Analog & 12F1822 internal voltage reference
    By retepsnikrep in forum mel PIC BASIC Pro
    Replies: 18
    Last Post: - 11th February 2014, 17:24
  2. Fixed Voltage Reference
    By kduck63 in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 20th April 2012, 11:27
  3. Replies: 7
    Last Post: - 22nd January 2012, 04:50
  4. ADC with reference voltage
    By GoldStar in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 20th May 2010, 21:01
  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 : 1

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