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

    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.

  2. #2
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,604


    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.

  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

    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.

  4. #4
    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: 11281
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.

  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

    So after doing some searching I found this... here... http://www.microcontrollerboard.com/...converter.html
    Name:  adclock.jpg
Views: 11200
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.

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

    I don't think the enhanced cores were available yet when I wrote that page.
    The older chips had a minimum TAD of 1.6uS, but the newer ones have a minimum TAD of 1.0uS.

    So you could use the values in that table, but they will be off by 1 division from "Optimal" settings.

    If you look in the A/D section of the 1822 datasheet, you should see this table ...
    I've marked the best setting at each oscillator freq. in red.
    Put the matching ADCS bits into the ADCON1 register bits 4-6. DEFINE ADC_CLOCK does not have any effect on the enhanced core devices.

    Name:  1822_ADCS.jpg
Views: 11441
Size:  111.0 KB

    The FRC clock is an internal RC oscillator that is separate from the main internal oscillator (FOSC).
    It continues running even when the PIC is put to SLEEP.
    It can be used at any OSC. But the actual TAD period can be anywhere from 1.0 - 6.0uS.
    Last edited by Darrel Taylor; - 11th February 2014 at 17:31.
    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 : 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