ADC in 12F683; puzzled


Closed Thread
Results 1 to 14 of 14

Hybrid View

  1. #1
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869


    Did you find this post helpful? Yes | No

    Default

    Just guessing with your code, It looks like your result is left justified (or right) but in any event, you appear to be reading the the 2 LSB as bit 6,7 of your answer. since the 10 bit result is a word, you seem to have result high as valid 8 bits. but your result low is ddxxxxxx. So your LSB is really = dec128 and not 1!

    How do i guess this? if you right shift your 13300 6 times, you get ~207. Assuming you are testing 0-5V you expect 1024/5=204 per volt. Pretty close.

    If you need help understanding or fixing this, post code!

    Sorry, we posted together
    Last edited by cncmachineguy; - 21st September 2010 at 13:24. Reason: code posted while I was postng
    -Bert

    The glass is not half full or half empty, Its twice as big as needed for the job!

    http://foamcasualty.com/ - Warbird R/C scratch building with foam!

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