Help with multiple ADC inputs


Closed Thread
Results 1 to 7 of 7

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default Re: Help with multiple ADC inputs

    I got it to work by leaving off the adcon.7 code, heres what I am using for 2 ADC, it works great, if I change the adcon.7 it wont even compile

    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
    
    ADCON1 = %10000000
    TRISA = %00000011 'PORTA 0&1 is input
     
    SETT Var Word ' A/D converter result in 10bit
    READT var word ' A/D converter result in 10bit
    
    AGAIN:
    ADCIN 0, READT ' Read Channel 0 data
    ADCIN 1, SETT ' Read Channel 1 data

  2. #2
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default Re: Help with multiple ADC inputs

    ADCON.7 will not compile because it is a wrong command. You need to use ADCON2.7=1
    Dave
    Always wear safety glasses while programming.

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