Newby with ADC problems.


Closed Thread
Results 1 to 4 of 4

Hybrid View

  1. #1
    Join Date
    Dec 2003
    Location
    Wichita KS
    Posts
    511


    Did you find this post helpful? Yes | No

    Default

    hello Mark,

    Mark try incorporating this in your program...


    TRISIO=%00001010 'Pic 12F675

    ' Define ADCIN parameters
    DEFINE ADC_BITS 10
    DEFINE ADC_CLOCK 3
    DEFINE ADC_SAMPLEUS 50

    'adval VAR byte

    'Pause 100
    'Loop:
    ADCIN 1, number ' Read channel 1 to adval (0-1023)
    'number = (number */ 500)>>2 equates to: (adval * 500)/1024
    number = number >> 6


    Your values should be between 1 and 1023...

    And use only ONE pin at first (until you get it working) then go to the using two pins.

    Make darn sure your pin has a A/C converter on it. and make darn sure your TRIS is set to a "1" to represent the A/D converter.

    Also, your reading will not be a "Voltage Reading" but a reading of a number between 0 and 1024... you must convert this number to a voltage reading.

    if 0=0 volts.
    if 5=1024

    Voltage= 5 X ADvalue / 1024



    Dwayne
    Last edited by Dwayne; - 3rd September 2004 at 16:50.
    Ability to Fly:
    Hurling yourself towards the ground, and missing.

    Engineers that Contribute to flying:
    Both optimists and pessimists contribute to the society. The optimist invents the aeroplane, the pessimist the parachute

    Pilots that are Flying:
    Those who know their limitations, and respect the green side of the grass...

Similar Threads

  1. Problems with ADC
    By mcbeasleyjr in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 29th January 2009, 17:34
  2. 16F819 ADC problems
    By MUC in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 22nd March 2008, 18:36
  3. PIC18f2423 two 12bit adc input problems
    By Brandon in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 16th December 2007, 09:47
  4. I have problems with de ADC...
    By jomavilla24 in forum Off Topic
    Replies: 1
    Last Post: - 16th February 2007, 16:24
  5. adc problems
    By MARAD75 in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 3rd December 2006, 05:47

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