18F2520 ADC issue


Closed Thread
Results 1 to 11 of 11

Hybrid View

  1. #1
    Join Date
    Nov 2005
    Location
    Bombay, India
    Posts
    966


    Did you find this post helpful? Yes | No

    Default

    Repeated failure after a fixed duration suggests stack problem to me. I can suggest you check the nesting levels in your code and if you have sufficient stack left over for interrupts use. Due to stack failure, the program could be returning to a wrong location and somehow modifying the CVRCON register and turning the AN2 port to output VREF. There may be other symptoms that accompany this.

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


    Did you find this post helpful? Yes | No

    Default

    Hi, Jerson

    as the AN2 input permanently stays "damaged" after some times ... I do not think it could be a stack or soft problem ...
    as I wrote : re-programming the chip do not solve the issue ...

    let's say the program continue to run pretty fine, of course excepting what relies to AN2 input ...

    I must make some tests with RA2 as digital input/output ... just to try to see if something abnormal and verify if it is in the ADC input multiplexer or in the clamping diodes that the problem is ...

    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
    May 2004
    Location
    NW France
    Posts
    3,648


    Did you find this post helpful? Yes | No

    Red face Found something ... BUT ...

    Hi,

    I finally found something ...

    I used AN0 to AN2 ... and AN3 for external reference.

    Innocently ... I had declared AN3 as analog in the ADCON1 register.

    Looking closer to the Datasheet ... The reference DO NOT use the ADC multiplexer path.

    So, I declared AN3 as digital ...

    AND The right AN2 value re-appeared !!!



    BUT that is because I do not use AN's inputs greater than 2 ... I would have to valid AN3 as Analog if using AN4 ...

    So problem is still here.

    I Just found a Turnaround ...

    Alain
    Last edited by Acetronics2; - 24th August 2009 at 16:14.
    ************************************************** ***********************
    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 " !!!
    *****************************************

Similar Threads

  1. Stable Adc Reading Routine
    By gebillpap in forum General
    Replies: 27
    Last Post: - 13th May 2015, 02:18
  2. Battery charger - power supply issue affecting ADC
    By flotulopex in forum mel PIC BASIC Pro
    Replies: 29
    Last Post: - 14th December 2008, 00:12
  3. 18F1320 ... Strange Memory
    By Acetronics2 in forum mel PIC BASIC Pro
    Replies: 43
    Last Post: - 9th April 2006, 09:55
  4. ADC value with 2 decimals on an LCD
    By Squibcakes in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 2nd December 2005, 15:54
  5. 12F675 ADC 'Issues'
    By harrisondp in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 31st March 2005, 01:55

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