Hot!which types of analog devices can use the FVR

Author
brownt
Super Member
  • Total Posts : 237
  • Reward points : 0
  • Joined: 2015/11/21 14:58:09
  • Location: 0
  • Status: offline
2018/02/13 00:31:50 (permalink)
0

which types of analog devices can use the FVR

The PIC18F26K40 has a built in Fixed Voltage Regulator that can be used for the AD rather than Vref. The example in the data sheet shows a schematic of it being done with a temperature sensor, but I don't see how it can be used with a potentiometer, can it?
#1

7 Replies Related Threads

    qɥb
    Monolothic Member
    • Total Posts : 2602
    • Reward points : 0
    • Joined: 2017/09/09 05:07:30
    • Location: Jupiter
    • Status: online
    Re: which types of analog devices can use the FVR 2018/02/13 00:52:39 (permalink)
    0
    It appears you can't output the FVR signal.
    There's no need to for a pot anyway. Just use the high end of the pot as the reference, then the absolute voltage level is irrelevant.
     

    This forum is mis-configured so it only works correctly if you access it via https protocol.
    The Microchip website links to it using http protocol. Will they ever catch on?
    PicForum "it just works"
    #2
    brownt
    Super Member
    • Total Posts : 237
    • Reward points : 0
    • Joined: 2015/11/21 14:58:09
    • Location: 0
    • Status: offline
    Re: which types of analog devices can use the FVR 2018/02/13 03:32:36 (permalink)
    0
    yes. I need something more stable.
    #3
    qɥb
    Monolothic Member
    • Total Posts : 2602
    • Reward points : 0
    • Joined: 2017/09/09 05:07:30
    • Location: Jupiter
    • Status: online
    Re: which types of analog devices can use the FVR 2018/02/13 04:19:59 (permalink)
    0
    For what?
    As I mentioned, to measure a pot, you just need to use the positive end of the pot as the reference.
    It's just the ratio that matters, not the absolute voltage.
    You do need some filtering on the signal to remove noise, but a 100nF capacitor should be sufficient.
     

    This forum is mis-configured so it only works correctly if you access it via https protocol.
    The Microchip website links to it using http protocol. Will they ever catch on?
    PicForum "it just works"
    #4
    brownt
    Super Member
    • Total Posts : 237
    • Reward points : 0
    • Joined: 2015/11/21 14:58:09
    • Location: 0
    • Status: offline
    Re: which types of analog devices can use the FVR 2018/02/13 04:40:52 (permalink)
    0
    It needs to be very exact. Any significant change in sample value, upsets the application. I have tried a cap as you mentioned previously, but it made it worse.
     
    There is some timing issue perhaps, as there  is a 32 sample conversion that occurs initially, and then a millisecond later, there is a 32 sample conversion that repeats over and over. And it is the first repeating conversion that comes in with a average of about 10 / 1023 different than the previous conversion, and also different from the following conversions.
     
    I have just found that if I discharge the sample capacitor before each 32 sample conversion (ADPCH = 0x3C), it works around the problem. Still I wonder what it is about.
     
     
    #5
    qɥb
    Monolothic Member
    • Total Posts : 2602
    • Reward points : 0
    • Joined: 2017/09/09 05:07:30
    • Location: Jupiter
    • Status: online
    Re: which types of analog devices can use the FVR 2018/02/13 04:48:17 (permalink)
    0
    Sounds like not enough "acquisition time" to me.
     

    This forum is mis-configured so it only works correctly if you access it via https protocol.
    The Microchip website links to it using http protocol. Will they ever catch on?
    PicForum "it just works"
    #6
    brownt
    Super Member
    • Total Posts : 237
    • Reward points : 0
    • Joined: 2015/11/21 14:58:09
    • Location: 0
    • Status: offline
    Re: which types of analog devices can use the FVR 2018/02/13 05:18:03 (permalink)
    0
    hmmm, i tried , 2, 4, 6 and 255 AD clocks cycles but it seemed the same. Though I have tried it again just now, and it seems to make some difference. How do I arrive at the correct acq time?
     
    There is a 64MHz micro clock, the AD clock is Fosc/128, so 500,000 MHz, which is 2uS. There are 32 samples being taken in a loop, so there is a sample being taken every 2uS. The first 32 sample conversion is separated from the second by about 20mS, and the third and subsequent 32 sample conversions are 40mS apart.
     
    So, I thought that 2 AD clock cycles would be sufficient.
     
    This is the code I am using
     

     while(ADCNT < ADRPT) //ADRPT = 32
        {
             value = ADCC_GetSingleConversion(channel);
        }
            ADACLR=1;
     
     
    adc_result_t ADCC_GetSingleConversion(adcc_channel_t channel)
    {
        // select the A/D channel
        ADPCH = channel;    

        // Turn on the ADC module
        ADCON0bits.ADON = 1;
        
        //Disable the continuous mode.
        ADCON0bits.ADCONT = 0;    

        // Start the conversion
        ADCON0bits.ADGO = 1;

        // Wait for the conversion to finish
        while (ADCON0bits.ADGO)
        {
        }

        // Conversion finished, return the result
         return ((ADFLTRH << 8) + ADFLTRL);

    }
     

    post edited by brownt - 2018/02/13 06:20:29
    #7
    Aussie Susan
    Super Member
    • Total Posts : 3186
    • Reward points : 0
    • Joined: 2008/08/18 22:20:40
    • Location: Melbourne, Australia
    • Status: offline
    Re: which types of analog devices can use the FVR 2018/02/13 18:42:45 (permalink)
    0
    Do I understand that your issue is that you are getting variations in the bottom bits of the ADC?
    If none of the changes you have mentioned changes your values then I suspect that what you are seeing us noise on the input.
    You have a 10-bit ADC in that device (hence the 1023 you mention as the total range).
    The '10' variation you mention is really just the noise that is appearing on the the bottom (approx) 3 bits.
    Even so, 10 out of 1023 is an accuracy of about 1% which is not too bad.
    Susan
     
    #8
    Jump to:
    © 2018 APG vNext Commercial Version 4.5