Help with multiple ADC inputs


Results 1 to 7 of 7

Threaded View

  1. #1
    Join Date
    Dec 2012
    Location
    Tennessee
    Posts
    262

    Default Help with multiple ADC inputs

    I'm having some issues turning on more than a single ADC input, Ive been using the code below.
    Code:
    DEFINE ADC_BITS 10 ' A/D number of bits
    DEFINE ADC_CLOCK 1 ' Use A/D internal RC clock
    DEFINE ADC_SAMPLEUS 50 ' Set sampling time in us
    RES1 Var Word ' A/D converter result
    RES2 Var Word ' A/D converter result
    RES3 Var Word ' A/D converter result
    AGAIN:
    ADCIN 0, Res1 ' Read Channel 0 data
    ADCIN 1, Res2 ' Read Channel 1 data
    ADCIN 2, Res3 ' Read Channel 2 data
    res1 = res1 /256
    res2 = res2 /256
    res3 = res3 /256
    'Display all 3 ADC results on LCD
    Pause 100
    goto again
    end
    Now I know im missing some ansel, adcon or something to enable the extra inputs, right now the extra inputs are eratic/off, they dont take readings right.
    as long as i stay with ADCIN 0 thers no problem, but I need to take readings on more pins. and am confused on these extra settings, any ideas would be great. also i havent learned to do the fuse settins for freq, brounout, mclre ect, so if possible leave that stuff out of code for right now.

    BTW using a 18F4550
    Last edited by wdmagic; - 28th December 2012 at 05:51.

Similar Threads

  1. Multiple analog inputs ?
    By rngd in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 25th February 2008, 15:13
  2. Can't get RA0 to read inputs?!?
    By kevj in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 17th December 2007, 20:46
  3. dip switchs & inputs
    By grounded in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 19th September 2006, 13:37
  4. Many Analog Inputs
    By Ioannis in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 10th July 2006, 08:15
  5. multiple serial inputs
    By Richardco in forum mel PIC BASIC
    Replies: 2
    Last Post: - 25th November 2005, 21:26

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