How to calculate ADC resolution (pic12f683)


Closed Thread
Results 1 to 7 of 7

Hybrid View

  1. #1
    Join Date
    Feb 2005
    Posts
    130

    Question How to calculate ADC resolution (pic12f683)

    I have a doubt: how can I calculate the maximum detail I can get from an ADC reading.

    In my case I have these parameters:

    Vcc: 4v
    Lower value to be read: 1.90v
    Higher value to be read: 2.10v

    How many different values can I read between these levels using the pic12f683 ?


    Thanks in advance!

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by peu View Post
    I have a doubt: how can I calculate the maximum detail I can get from an ADC reading.

    In my case I have these parameters:

    Vcc: 4v
    Lower value to be read: 1.90v
    Higher value to be read: 2.10v

    How many different values can I read between these levels using the pic12f683 ?


    Thanks in advance!
    All of them...

  3. #3
    Join Date
    Feb 2005
    Posts
    130


    Did you find this post helpful? Yes | No

    Default

    WOW, that was fast, you were looking over my shoulders?

    maybe I didn't used the right words to formulate my question, what would be the resolution?

    1.9001, 1.901 or 1.91? or how many steps.

    I don't know how to calculate this. Thanks!

  4. #4
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by peu View Post
    I have a doubt: how can I calculate the maximum detail I can get from an ADC reading.

    In my case I have these parameters:

    Vcc: 4v
    Lower value to be read: 1.90v
    Higher value to be read: 2.10v

    How many different values can I read between these levels using the pic12f683 ?


    Thanks in advance!
    Well, let's see....
    Vcc = 4v
    Vdd = 0v
    Difference between Vcc and Vdd = 4v

    PIC12F683 has a 10 bit A/D converter, 1024 possible values to read between 0 and 4v.
    1.9v - 2.1v = .2v
    4v maximum value / 1024 = 3.90625mv/bit
    Therefore,
    .2v = 200mv
    200mv / 3.90625 = 51.2
    So, you can read 51.2 values between 1.9 and 2.1 volts.
    How 'bout that math...

    OR....
    You could set VRef to 2.2v...
    2.2v maximum value / 1024 = 2.1484375mv/bit
    Therefore,
    .2v = 200mv
    200mv / 2.1484375 = 93.09
    If you had a VRef of 2.2v, you could read 93.09 values between your limits...

  5. #5
    Join Date
    Feb 2005
    Posts
    130


    Did you find this post helpful? Yes | No

    Default

    AHA! that was the info I was after, thanks again skimask.

    So, after reading the datasheet I see that I can set the internal Vref for this purpose, but I dont understand something, from the datasheet:


    VRR = 1 (Low Range): CVREF = (VR3:VR0/24) x VDD
    VRR = 0 (High Range): CVREF = (VDD/4) + (VR3:VR0 X VDD/32)

    So in my example, if I set VR3:0 say at 1101 I get these values:

    VRR=1 2.167v
    VRR=0 2.625v

    or if I use VR3:0 at 1001 I get these

    VRR=1 1.5v
    VRR=0 2.125v


    So what should I use, VRR=1 or 0 ?

  6. #6
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    VR=9, VRR=0

    Closest to 2.1v without going under...

  7. #7
    Join Date
    Feb 2005
    Posts
    130


    Did you find this post helpful? Yes | No

    Smile

    Thanks skimask for your fast and accurate replies!

Similar Threads

  1. Stable Adc Reading Routine
    By gebillpap in forum General
    Replies: 27
    Last Post: - 13th May 2015, 02:18
  2. Can't get ADC to loop
    By TravisM in forum mel PIC BASIC
    Replies: 2
    Last Post: - 11th October 2009, 15:33
  3. ADC value with 2 decimals on an LCD
    By Squibcakes in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 2nd December 2005, 15:54
  4. 12F675 ADC 'Issues'
    By harrisondp in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 31st March 2005, 01:55
  5. High resolution ADC
    By vsingh in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 29th April 2004, 18:53

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