How to check a 12 bits ADC


+ Reply to Thread
Results 1 to 7 of 7
  1. #1
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    937

    Default How to check a 12 bits ADC

    I have a PIC with a 12 bits ADC resolution (16F18446).

    I though, having some 10kΩ 10 turns potentiometer in my drawer, I would be able to visualize all 4096 points of the ADC measurement.

    It dosen't.

    Looking at the range via serial comm, I can see "holes" in the 0..4095 range like it would jump from i.e. 646 to 648 never showing 647.

    My PIC has a lot of ADC features but I think I turned them OFF, all.

    I have made some circuits with additional resistors hoping to reduce the ADC input range hence rising the résolution of the potentiometer itself, but it doesn't seem to do quite better.

    Is there a way to "visualize" the whole ADC range of my PIC?
    Roger

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


    Did you find this post helpful? Yes | No

    Default Re: How to check a 12 bits ADC

    This won't be an answer to question, more "food for thought".

    Neither the ADC nor the pot is "perfect" (of course) and the ADC inside a $1.50 PIC will not be the best but it does have data specified the datasheet, page 632.

    What's the linearity and "resolution" of the potentiometer? There are some mighty fine potentiometers out there but a cheap 10-turn is probably worse than the ADC. In theory, the resolution is "endless" but in practice it is not. 4096 "steps", even over 10 turns, is less than 0.9° of rotation of the wiper, can YOU resolve that accurately?

    I suppose you could put an accurate voltmeter parallell with the ADC input and compare the voltage readings with the ADC readings? Does the voltage readings also skip the "647-value"?
    Remember, if you have the pot across 3.3V then 1LSB of the ADC is 805uV (microvolt).

  3. #3
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    937


    Did you find this post helpful? Yes | No

    Default How to check a 12 bits ADC

    Thanks Hendrik, I obviously didn't think about that miserable ratio of 0.87 turns per resolution step

    If the embedded ADC is not a gold medalist, what about a MCP3221; how do they compare?
    Roger

  4. #4
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,628


    Did you find this post helpful? Yes | No

    Default Re: How to check a 12 bits ADC

    Hi, Flotul,

    consider you have NO chance to get what you want with the internal ADC's of your Pic.

    that said ... if you want a "quasi-linear " behaviour, try this inexpensive chip : https://fr.aliexpress.com/item/10050...Cquery_from%3A

    But, of course, you'll have to be extra careful with all its environment ...

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  5. #5
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    937


    Did you find this post helpful? Yes | No

    Default How to check a 12 bits ADC

    Hey Alain,

    Thanks for the advice

    What about the MCP3221 I have in my drawer? Is it worth a try or should I scrap them

    I don't really know what to compare looking at ADCs.....
    Roger

  6. #6
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,628


    Did you find this post helpful? Yes | No

    Default Re: How to check a 12 bits ADC

    Hi,Roger

    as a common rule, you first consider you loose at least 2LSB for the ADC " normal " behaviour ( right shift twice ! ) - that's it. You can verify that carefully reading the ADC's datas and AN's...

    you also could calculate the mean value for a significant number of samples ( takes time ! ). BTW, on the forum, there was a thread about " enhanced resolution " ( Darrel T.) ... but if signal changes slowly ... it's no more accurate !!!

    now, you have to care for the settling time of the ADC ...

    at this point, you considered your input voltage is perfectly steady, and perfectly linear vs "pot" position as it has already been raised.

    THEN, you can hope for a steady linear readout.
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  7. #7
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    937


    Did you find this post helpful? Yes | No

    Default How to check a 12 bits ADC

    Charrette, ça en fait des "si"!

    Thanks a lot Alain.

    That's a lot of good info
    Roger

Similar Threads

  1. Replies: 3
    Last Post: - 25th February 2024, 13:04
  2. How do I check (or set) a group of consecutive bits within a byte?
    By HankMcSpank in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 2nd April 2012, 09:13
  3. Problem with I2Cread command for an 32 bits ADC
    By Pilou81 in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 27th October 2011, 16:32
  4. Incorrect adc channel bits generated
    By grahamg in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 6th February 2010, 19:56
  5. parsing adc word into bits
    By GREYBIRDMAN in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 13th April 2007, 22:08

Members who have read this thread : 15

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