help for the adc of the 16f1786


Closed Thread
Results 1 to 2 of 2
  1. #1

    Default help for the adc of the 16f1786

    i try make a 12 bit conversion with this:

    define ADC_BITS 12
    define ADC_SAMPLEUS 50
    adval var word
    ADCON0= %00000000
    ADCON1= %10000000
    trisa=%111111

    start:
    adcin 0, adval
    LCDOUT $FE,2,"value:",dec adval
    goto start
    -------------------------------------

    but the result is too low, with 1,4 volts on ra0 the resulting value is "7", what is wrong? Now the vref (adcon1 reg) is 5v i think....may i have to set the fvrcon register too?

  2. #2
    Join Date
    Sep 2010
    Location
    Las Vegas, NV
    Posts
    305


    Did you find this post helpful? Yes | No

    Default Re: help for the adc of the 16f1786

    ADCON0= %00000000 among other things doesn't turn on the ADC.

    More code and a schematic if that doesn't help.

Similar Threads

  1. Replies: 10
    Last Post: - 13th March 2016, 01:51
  2. 16F1786 issue with simple program.
    By luxornet in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 24th January 2016, 13:07
  3. ADC values above 4095 for 12 bit ADC
    By longpole001 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 1st February 2015, 22:24
  4. ADC problem on 18F46K22 device using all 28 ADC pins
    By JimAvanti in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 23rd February 2012, 20:22
  5. adc help
    By mpardinho in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 24th October 2006, 22:19

Members who have read this thread : 1

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