PIC16F1503 Fixed Voltage Reference


Closed Thread
Results 1 to 11 of 11
  1. #1
    Join Date
    Jan 2011
    Location
    Sydney, Australia
    Posts
    166

    Default PIC16F1503 Fixed Voltage Reference

    Hi All,

    I am working with a PIC16F1503 and would like to use the Fixed Voltage Reference (FVR) as the reference for the ADC.
    I have successfully done this in the past using a PIC16F1829 but the same register settings do not apply for the PIC16F1503.

    In the case of the '1829:
    From the datasheet, setting ADPREF<1:0> to "11" means "Vref+ is connected to internal Fixed Voltage Reference (FVR) module

    In the case of the '1503:
    From the datasheet, the only two setting options for ADPREF<1:0> are "00" (Vrpos is connected to Vdd) and "10" (Vrpos is connected to external Vref+ pin)
    All other options are "Reserved" and there is not FVR option listed.

    Can anyone enlighten me on how to use the Fixed Voltage Reference (FVR) as the reference for the ADC on a PIC16F1503?

    Cheers
    Barry
    VK2XBP

  2. #2
    Join Date
    May 2013
    Location
    australia
    Posts
    2,383


    Did you find this post helpful? Yes | No

    Default Re: PIC16F1503 Fixed Voltage Reference

    a quick look at the data sheet leaves you with only two option for positive reference
    vdd or external vref
    Attached Images Attached Images  
    Warning I'm not a teacher

  3. #3
    Join Date
    Jan 2011
    Location
    Sydney, Australia
    Posts
    166


    Did you find this post helpful? Yes | No

    Default Re: PIC16F1503 Fixed Voltage Reference

    Hi Richard,

    Yes, I see that now but contradictory to this diagram, the datasheet also states that the output of the FVR can be configured to supply a reference voltage to the ADC input channel:

    Name:  PIC16F1503 FVR.jpg
Views: 484
Size:  216.0 KB

    and this is supported in the FRVCON register (bits 1-0) regarding the relevant ADC FVR buffer gain:

    Name:  PIC16F1503 FVR2.jpg
Views: 423
Size:  247.8 KB

    Which one is to be believed?

    Cheers
    Barry
    VK2XBP

  4. #4
    Join Date
    May 2013
    Location
    australia
    Posts
    2,383


    Did you find this post helpful? Yes | No

    Default Re: PIC16F1503 Fixed Voltage Reference

    it could be worded better. the hight-lighted word "reference" could be removed to better reflect reality

    The Fixed Voltage Reference (FVR) is a stable voltage
    reference, independent of VDD, with a nominal output
    level (VFVR) of 1.024V. The output of the FVR can be
    configured to supply a reference voltage to the
    following:
    • ADC input channel
    • Comparator positive input
    • Comparator negative input
    The FVR can be enabled by setting the FVREN bit of
    the FVRCON register
    Warning I'm not a teacher

  5. #5
    Join Date
    Jan 2011
    Location
    Sydney, Australia
    Posts
    166


    Did you find this post helpful? Yes | No

    Default Re: PIC16F1503 Fixed Voltage Reference

    the exact same wording is used in the PIC16F1829 datasheet yet that device DOES have the option to set the ADC Vref+ to the internal FVR module (ADPREF<1:0> = 11)

    Some consistency would be a good thing....

    Cheers
    Barry
    VK2XBP

  6. #6


    Did you find this post helpful? Yes | No

    Default Re: PIC16F1503 Fixed Voltage Reference

    Come on guy, Microchip can't even decide what to call basic registers. Hay hoo.
    George

  7. #7
    Join Date
    Apr 2014
    Location
    OK
    Posts
    557


    Did you find this post helpful? Yes | No

    Default Re: PIC16F1503 Fixed Voltage Reference

    I ran into this exact issue with this exact PIC! I swapped over to a PIC16F18323. I wanted to monitor battery voltage. If input voltage were to start dropping with ADC referencing Vdd, I may never see a dying battery until it was too late. Referencing ADC to 2.048 volts with a voltage divider on the input made it more precise. I think that's similar to what you are trying to do.

  8. #8
    Join Date
    Jan 2011
    Location
    Sydney, Australia
    Posts
    166


    Did you find this post helpful? Yes | No

    Default Re: PIC16F1503 Fixed Voltage Reference

    That is EXACTLY what I am trying to do!
    I have looked at PIC16F1703, PIC16F1823 and the one you recommended, PIC16F18323 - all are pin compatible and have the ability to set the FVR as the reference voltage for the ADC.

    Cheers
    Barry
    VK2XBP

  9. #9
    Join Date
    May 2013
    Location
    australia
    Posts
    2,383


    Did you find this post helpful? Yes | No

    Default Re: PIC16F1503 Fixed Voltage Reference

    if all you need to do is calculate vdd then
    connect adc to fvr and measure fvr count

    vdd = 1024*fvr_const/fvr_count

    fvr_const would be very close to 1.000 and could be determined using a calibrated power supply if required
    Warning I'm not a teacher

  10. #10
    Join Date
    Jan 2011
    Location
    Sydney, Australia
    Posts
    166


    Did you find this post helpful? Yes | No

    Default Re: PIC16F1503 Fixed Voltage Reference

    Thanks Richard.

    The PIC is being fed via a liner regulator so I am not that interested in reading Vdd.
    I want to read the battery voltage feeding this 5V linear reg. The battery also feeds a 6V buck regulator.
    I have the ADC pin fed via a voltage divider.
    All works well until the battery voltage drops sufficiently cause Vdd to droop, thus throwing off my ADC readings and battery status indicator LEDs.

    Given there are numerous pin compatible devices which allow the FVR module to be used as a reference voltage for the ADC, I believe my easiest path forward is to change devices.
    These are not expensive devices (~AUD$1.50 for single unit purchase) so making the change has no real drawbacks.

    Cheers
    Barry
    VK2XBP

  11. #11
    Join Date
    May 2013
    Location
    australia
    Posts
    2,383


    Did you find this post helpful? Yes | No

    Default Re: PIC16F1503 Fixed Voltage Reference

    yes that method is only good for reading vdd , in the past I have used the dac module along with the comparator module for that purpose [16f648a from memory], even built a mppt solar regulator too. the dac can set high low trigger points for the comparator. resolution of about 0.1 volts is about the best you can achieve that way
    Warning I'm not a teacher

Similar Threads

  1. Replies: 8
    Last Post: - 21st March 2015, 18:21
  2. Replies: 1
    Last Post: - 18th February 2014, 03:39
  3. 16F886 and Voltage reference
    By retepsnikrep in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 25th August 2013, 19:15
  4. Fixed Voltage Reference
    By kduck63 in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 20th April 2012, 12:27
  5. Replies: 7
    Last Post: - 22nd January 2012, 05:50

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