16f688 Adc


Closed Thread
Results 1 to 5 of 5

Thread: 16f688 Adc

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by PICante View Post
    Setting up the 10-bit ADC I expected a 0 – 1023 range, what I got was 0 to 65472 !!?
    That's from the ADFM bit. For 10-bit A/D, use ADCON0.7 = 1 ; right justify

    The math depends on what you're reading, but this might help ..
    http://www.picbasic.co.uk/forum/showthread.php?p=2010
    <br>
    DT

  2. #2
    Join Date
    Dec 2007
    Location
    Sweden
    Posts
    73


    Did you find this post helpful? Yes | No

    Thumbs up

    Thanks Darrel!

    I changed the; ADCON0 = %00000001 to ADCON0 = %10000001, and it works!
    And yes, the link helped me do some math too, only; how can I get two decimals?

    Thanks again!

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


    Did you find this post helpful? Yes | No

    Default

    For 2 decimals, multiply by 500 instead of 50.

    Then this will display the value with 2 decimal places ...
    Code:
       LCDout $FE,2,"V= ",DEC Volts/100,".",DEC2 Volts//100," Vdc"
    DT

  4. #4
    Join Date
    Dec 2007
    Location
    Sweden
    Posts
    73


    Did you find this post helpful? Yes | No

    Smile

    Thank you very much Darrel!

Similar Threads

  1. Stable Adc Reading Routine
    By gebillpap in forum General
    Replies: 27
    Last Post: - 13th May 2015, 02:18
  2. 10 bit ADC display on LCD using 16f873
    By pr2don in forum mel PIC BASIC
    Replies: 3
    Last Post: - 6th March 2010, 18:29
  3. Can't get ADC to loop
    By TravisM in forum mel PIC BASIC
    Replies: 2
    Last Post: - 11th October 2009, 15:33
  4. ADC value with 2 decimals on an LCD
    By Squibcakes in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 2nd December 2005, 15:54
  5. 12F675 ADC 'Issues'
    By harrisondp in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 31st March 2005, 01:55

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