16f877 with LM335 problem


Closed Thread
Results 1 to 40 of 47

Hybrid View

  1. #1
    Join Date
    Jan 2013
    Location
    Texas USA
    Posts
    229


    Did you find this post helpful? Yes | No

    Default Re: 16f877 with LM335 problem

    Roger,

    Check out section 9.1.6 "Result Formatting" of the Datasheet.
    It shows the difference in the two formatting options.

    In essence Right Shifted will place the 10-bit value in bits 9 through 0 (MSB is bit9).
    Left Shifted will place the 10-bit value in bits 15 through 6 (MSB is bit15)

    So if your ADC reading is 250 then here would be the values.
    Right Shifted = 250 (%0000 0000 1111 1010)
    Left Shifted = 1600 (%0011 1110 1000 0000)
    Regards,
    TABSoft

  2. #2
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    951


    Did you find this post helpful? Yes | No

    Default Re: 16f877 with LM335 problem

    Thanks Tabsoft,

    I already read that chapter may times but I just can't understand what this feature is meant for.

    Why would one choose either option?

    I need an example of both usage, maybe this could help
    Roger

  3. #3
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,170


    Did you find this post helpful? Yes | No

    Default Re: 16f877 with LM335 problem

    If you want to use only 8 bit (may be it is enough for specific application) then the left justified result will give yout the number in the ADRESH directly. No shifting or dividing required.

    But for the full 10 bit results you have to right justify the bytes in the ADRESH-ADRESL to be correct.

    Ioannis

  4. #4
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    951


    Did you find this post helpful? Yes | No

    Default ADC - left or right justified result

    Okay, I think, I've got it now. Next problem: I need to remember it
    Roger

Similar Threads

  1. 16F877 HSERIN problem with 3th party software
    By RFsolution in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 11th March 2009, 18:11
  2. LCD problem with 16F877
    By alexx_57 in forum General
    Replies: 10
    Last Post: - 25th July 2007, 14:47
  3. problem using 16f877
    By yrch in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 20th February 2006, 19:58
  4. 16F877 20MHz problem
    By swordman in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 31st July 2004, 11:02
  5. 16F877, DS18S20 and Serial Comm Problem
    By YellowTang in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 26th April 2004, 11:36

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