ADC values above 4095 for 12 bit ADC


Results 1 to 8 of 8

Threaded View

  1. #3
    Join Date
    Sep 2009
    Posts
    755


    Did you find this post helpful? Yes | No

    Default Re: ADC values above 4095 for 12 bit ADC

    You didn't tell what PIC you use. It can make big difference...
    For example PIC18F87K22 have differential inputs, and negative results are two’s complement of result. So for -1 = $FFFF, -2 = $FFFE etc.
    You can use SDEC to get correct result.
    Or you can use this:
    Code:
    ADCIN 17,value1 'I'm not sure how ADCIN in handles negative numbers... So maybe manual reading of ADRES registers are better solution
    IF value1.1 = 1 THEN           
        Sign="-"
    ELSE
        Sign=" "
    ENDIF
    value1=ABS(value1)
    HSEROUT2 ["value1 = ",Sign, dec4 value1,13,10]
    Last edited by pedja089; - 31st January 2015 at 10:20.

Similar Threads

  1. Scaling ADC values
    By purkolator in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 29th November 2007, 05:14
  2. Flash PIC with 12 bit ADC
    By Steve_88 in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 12th October 2007, 20:35
  3. Adc giving widely flactuating values
    By tamersoss in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 17th December 2006, 08:59
  4. MAX1247 4-Channel, 12-Bit ADC
    By Atom058 in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 15th December 2006, 23:38
  5. Need help with 16f819 10 bit ADC
    By bannrikae in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 26th September 2005, 15:20

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