DT_Analog & 12F1822 internal voltage reference


Closed Thread
Results 1 to 19 of 19

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default Re: DT_Analog & 12F1822 internal voltage reference

    Boy do I have a RED face...

    I think my last post to another thread was telling them the same thing...

    quoting myself:
    Just make sure you enter any "DEFINE" statements as all CAPS.
    They are case sensistive.
    I guess I did not go looking there because some of this code was working as an 8bit AD earlier. I'm guessing that 8 bit is the default and the fact that I had define "adc_bits = 8" was ignored.

    Working as expected now

    So now how do I use the internal FVR to make an external A/D reading more accurate?
    And how do I go about calibrating each PIC's FVR value??

    Thanks Darrel
    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: DT_Analog & 12F1822 internal voltage reference

    Sheesh...
    Disregard my last two questions.
    It's been a while since I read the whole thread.

    I think my questions had already been answered.

    But I do have another question...
    Why is the maximum AD value only 65472 for 16-bit DT_Analog??

    similarly is the AD value range for 8 bit 0-255 ??
    and for 10 bit AD 0-1023 ??

    Sorry for the dumb questions, I don't get into this programming enough to understand some of the finer points.


    dwight
    Last edited by Heckler; - 10th February 2014 at 16:58.

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


    Did you find this post helpful? Yes | No

    Default Re: DT_Analog & 12F1822 internal voltage reference

    Ok,

    after looking at 65472 in binary 1111111111000000

    It appears that you have just shifted a 10 bit binary to the Left end of a 16 bit number.

    So then the AD value for a 16-bit DT_Analog can range from 0-65472 ??
    Therefore we get to take advantage of the extra 6 bits of resolution EXCEPT when the value goes over 65472 ??
    We just give up a little resolution to gain the extra (almost) 6 bits over a 10 bit AD ??

    and 8 bit range is still 0-255
    and 10 bit range is still 0-1023
    Last edited by Heckler; - 10th February 2014 at 17:14.
    Dwight
    These PIC's are like intricate puzzles just waiting for one to discover their secrets and MASTER their capabilities.

  4. #4
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,621


    Did you find this post helpful? Yes | No

    Default Re: DT_Analog & 12F1822 internal voltage reference

    Hi,
    I suggest you do a little reading on Darrels DT_Analog page, I think it answers both questions.

    /Henrik.

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


    Did you find this post helpful? Yes | No

    Default Re: DT_Analog & 12F1822 internal voltage reference

    Thanks Henrik,

    that link seems to support what my gray matter was trying to wrap around

    I had been to Darrels web site but couldn't figure out how to get past the home page.

    My hat is off to those who can take all these intricate details of these PIC's and put it into practical application for the rest of us.
    Dwight
    These PIC's are like intricate puzzles just waiting for one to discover their secrets and MASTER their capabilities.

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


    Did you find this post helpful? Yes | No

    Default Re: DT_Analog & 12F1822 internal voltage reference

    Darrel,
    More questions...

    In your sample code above why is the A/D conversion clock set to FRC??
    Does that mean some sort of external hardware RC oscillator?

    Can you please shed some light on choosing the A/D conversion clock?
    From your website example... it would seem that one should only choose FRC is if the PIC clock is running at 48MHz
    Name:  adclock.gif
Views: 11601
Size:  9.4 KB
    or does this table not apply to the 16F1822?

    Thanks
    Dwight
    These PIC's are like intricate puzzles just waiting for one to discover their secrets and MASTER their capabilities.

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


    Did you find this post helpful? Yes | No

    Default Re: DT_Analog & 12F1822 internal voltage reference

    So after doing some searching I found this... here... http://www.microcontrollerboard.com/...converter.html
    Name:  adclock.jpg
Views: 11457
Size:  11.9 KB

    so now my question is...
    Is FRC just another way of saying Fosc/1 ?
    Is it not the case that Fosc/2 or Fosc/8 also come from the internal RC oscillator??

    Or is it the case that if one is using an external clock source for the PIC that you can either choose to divide the external clock source by 2, 8 or 32 (in the above example) or use the internal RC clock (FRC) for AD even though the PIC is clocked form an external source??

    Finally so far I have not had a need to run my projects faster than 4MHz and I just use the internal clock. So what is the best/correct AD clock source to use?
    Is it correct to read from the table on Darrel's AD page... if the OSC is running at 4MHz the best/correct choice is to use Fosc/8 ?

    Sorry for dragging this out so much... just trying to understand a little better.
    Dwight
    These PIC's are like intricate puzzles just waiting for one to discover their secrets and MASTER their capabilities.

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