10bit A/d input


Closed Thread
Results 1 to 9 of 9

Thread: 10bit A/d input

Hybrid View

  1. #1
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,612


    Did you find this post helpful? Yes | No

    Default Re: 10bit A/d input

    Hi,
    If your reference voltage is 5V and you're feeding in 5V on the analog input the ADC will return the value 1023. Since a 10 bit value need two bytes (ADRESH and ADRESL) to "fit" you can choose if the result should be left or right justified within those two bytes containing the result.
    Code:
    ADRESH   ADRESL
     00000011   11111111   <-This is right justified, result is "pushed toward the right" within the two bytes
     11111111   11000000   <-This is left justified, result is "pushed towards the left" within the two bytes
    
    The red digits represnts the most significant bit in the result
    If you read the result by combining the high and low byte into a word when the result is left justified you'll get 65572 instead 1023.

    /Henrik.

  2. #2
    Join Date
    Jul 2009
    Location
    Worcester South Africa
    Posts
    18


    Did you find this post helpful? Yes | No

    Default Re: 10bit A/d input

    Thanks a lot Henrik, I think I understand it a bit better now.

    Willie

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