First ADC conversion in a sequence always returns lower result 18F14K50


Closed Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2009
    Posts
    24

    Default First ADC conversion in a sequence always returns lower result 18F14K50

    Hi all, Just wondering if anybody has ever come across this before.... just asking in case someone has observed this before....the work around is obvious, but I'd prefer to fix it.

    I am using 2 ADC channels to take 3 samples in a loop, configuring the ADC to use the first channel, resetting the ADC, delay 10uS, then the second channel, resetting the ADC, delay 75uS then the first channel again, etc.

    The code works fine except for the fact that the first conversion is always about 5 counts low. This channel is supplied by an op amp buffer (capable of supplying +/-30mA), it's input is from CVref output of the PIC. The second channel is supplied from a 10K pot on the development board, with no buffer.

    If I reverse the connections to the ADC channels I still get a low first reading.

    After the first conversion, every subsequent conversion is stable, regardless of which voltage source is used.

    The TAD and Fosc/X are all within the allow parameters and changing them or adding extra delay before the first conversion has no effect.

    It appears that after a certain time of inactivity the ADC will always return a low first conversion result. It's kind of like getting in your car on a cold morning and having to give the engine a bit of a rev to really get the car going.

    Regards
    Chris

  2. #2
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,614


    Did you find this post helpful? Yes | No

    Default

    Hi, Chris

    May we get the ADC loop code snippet ???

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  3. #3
    Join Date
    Jan 2009
    Posts
    24


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Acetronics View Post
    Hi, Chris

    May we get the ADC loop code snippet ???

    Alain
    Hi Alain,

    I new somebody would ask that !

    Which is why I posted in "Off Topic", because I am modifying the original PBP code (I wrote) to suit new hardware using Microchip C18 to appease a university lecturer I am working with on a summer research project. I think I have solved the problem, as it happens. The C18 compiler is quite strict when it comes to the order of precedence, where PBP is quite forgiving. The Microchip forums can be full of point scorers, this forum is not, hence, I thought I'd try my luck here, in case someone had had the same problem and could give me some general clues as to where to start looking.
    Regards
    Chris

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