ADval*/Quanta Question


Results 1 to 8 of 8

Threaded View

  1. #2
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Take VDD divided by the MAX A/D reading, and multiply times 256.

    5 / 1023 * 256 = 1.251

    Scale that up to however many decimal places you want.
    For 3 decimal places, multiply by 1000.

    = 1251

    So your current number is correct for 10-bit A/D with 3 decimals. (0-4999)

    If you only want 2 decimals as indicated in your post, use 125 instead. (0-499)
    Or you can calculate to 3 decimals, then add 5 and divide by 10 and you'll get a rounded number. (0-500)

    4999 + 5 = 5004, /10 = 500
    <br>
    Last edited by Darrel Taylor; - 6th May 2009 at 22:17. Reason: added rounding
    DT

Similar Threads

  1. ADCIN question
    By Greg McFadden in forum General
    Replies: 4
    Last Post: - 16th September 2008, 03:53
  2. Remote PIC input question
    By Adrian in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 1st September 2007, 16:44
  3. Question for a math guru
    By Christopher4187 in forum General
    Replies: 3
    Last Post: - 22nd November 2006, 10:45
  4. Please answer my first question
    By John_001 in forum Off Topic
    Replies: 1
    Last Post: - 15th September 2006, 07:49
  5. Timer / CCP Question
    By jamie_s in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 2nd November 2005, 09:22

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