First GetADC using DT_Analog.pbp incorrect measurement afterwards is good. Why?


Closed Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2010
    Posts
    10

    Default First GetADC using DT_Analog.pbp incorrect measurement afterwards is good. Why?

    I am using Darrel Taylor's DT_Analog.pbp for taking analog measurements. Measurements are taken in a loop using GetADC.
    The first ADC measurement is always an incorrect value. After the first measurement, all consecutive measurements are correct.
    To get around this I do a single measurement first. Then I run my loop to take multiple measurements using GetADC. What is the reason the first measurement is always bad or incorrect?

    Your help is always greatly appreciated.

    Bryan

  2. #2
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,597


    Did you find this post helpful? Yes | No

    Default Re: First GetADC using DT_Analog.pbp incorrect measurement afterwards is good. Why?

    Hard to comment without seeing any code.

    Does the PIC have time to stabilize before taking the first reading?

    What if you add a short PAUSE?

    Robert

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


    Did you find this post helpful? Yes | No

    Default Re: First GetADC using DT_Analog.pbp incorrect measurement afterwards is good. Why?

    At least for the 12F683 it has a charge holding capacitor in the ADC circuit. The way I understand it that needs to be give the appropriate amount of time to charge fully before you take a reading. That time may change depending on which chip you're using.

    My guess is that Demons suggestion of a short pause would solve the problem. Or a counter that won't allow display until the appropriate time has elapsed. Either gives the ADC a chance to stabilize and provide the correct reading.

Similar Threads

  1. Acquisition time in DT_Analog when oversampling?
    By tjkelly in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 12th April 2015, 21:52
  2. DT_Analog.pbp
    By malc-c in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 30th January 2015, 04:42
  3. DT_Analog & 12F1822 internal voltage reference
    By retepsnikrep in forum mel PIC BASIC Pro
    Replies: 18
    Last Post: - 11th February 2014, 17:24
  4. DT_Analog.pbp
    By iw2fvo in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 21st November 2013, 21:05
  5. DT_Analog Module Works Great,But Why?
    By arniepj in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 1st October 2012, 20:32

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