Converting 10bit ADC result to 8 bit


Closed Thread
Results 1 to 10 of 10

Hybrid View

  1. #1
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default Re: Converting 10bit ADC result to 8 bit

    shift the value 2 places to the right.... 10bits shift >> 2, 8 bits....
    Dave Purola,
    N8NTA
    EN82fn

  2. #2
    Join Date
    Aug 2003
    Posts
    985


    Did you find this post helpful? Yes | No

    Default Re: Converting 10bit ADC result to 8 bit

    If you simply shift out the least significant bits you lose any small variations between values
    that might not have occurred with a divide, but then when you multiply back to the original range
    you also drop resolution.

    You can calculate a new range like this:
    NewValue = (((OriginalValue - OriginalMin) * (NewMax - NewMin)) / (OriginalMax - OriginalMin)) + NewMin

  3. #3
    Join Date
    Jul 2003
    Location
    USA - Arizona
    Posts
    156


    Did you find this post helpful? Yes | No

    Default Re: Converting 10bit ADC result to 8 bit

    Unless I am missing the obvious. Shifting right by two, or dividing by two (integer division) is identical. The only difference should be in speed. Shifts should always be faster, and divides may be slower depending on the compiler optimization.

  4. #4
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default Re: Converting 10bit ADC result to 8 bit

    Lanquer, That is correct...
    Dave Purola,
    N8NTA
    EN82fn

  5. #5
    Join Date
    Aug 2003
    Posts
    985


    Did you find this post helpful? Yes | No

    Default Re: Converting 10bit ADC result to 8 bit

    Ignore my whole post... don't know where my head was,
    you're going to drop the same resolution anyway!

  6. #6
    Join Date
    Feb 2004
    Location
    Michigan, USA
    Posts
    305


    Did you find this post helpful? Yes | No

    Default Re: Converting 10bit ADC result to 8 bit

    Correct me if I'm wrong but if you divide a 10 bit result by 2, you get a 9 bit result. EG 1024/2 = 512. 8 bit max is 256 so you'd have to divide it by 4.

  7. #7
    Join Date
    Jul 2003
    Location
    USA - Arizona
    Posts
    156


    Did you find this post helpful? Yes | No

    Default Re: Converting 10bit ADC result to 8 bit

    you're correct, this
    or dividing by two
    was my hands playing catchup with the brain

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