18F2520 ADC issue


Closed Thread
Results 1 to 11 of 11

Hybrid View

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

    Question 18F2520 ADC issue

    Hi,

    A little thing I do not understand :

    I have a 4.096 voltage ref for ADC
    Input sees a LM335 , through a 10k/.22µ L.P.F., powered from 5 v with a 2.2k series resistor.
    Wiring to lm335 is ground shielded.

    Everything has worked fine for 25+ hours ... ( reading Ok ... etc,etc ...)


    Now,

    An ADC input overflow has occured ( logged by the system ) that should NEVER had happend ... and the ADC result now is DIVIDED by 2 !!!

    a ( say many ! ) system reset did not change anything ...


    I took the chip off to read its logging values and just rewrote the "wrong logged" data. ( NO change to the program ).


    Pic placed Back to its place ...

    ISSUE has disappeared... everything fine again.



    Soooo ...

    Is there some limitation on ADC input voltage relative to the ADC Vref ??? ...

    Yess ... Parameter A25 ( Midrange data ) says ... Vref + 0.3v !!! , that seems logical not to input more than what can be read, ... but no such issue specified ...

    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 " !!!
    *****************************************

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Janine View Post
    I am just wondering if there are some one know how to change c code to picbasic.
    Or if some one can help me to write PICBASIC code for LCD03
    I also use BASIC.
    How did this go from Ace's ADC issue to converting code from C to PicBasic?
    If you know C (cut and paste from some website somewhere?), then reading your code in Post#3 and converting that to a similar PicBasicPro program should be easy enough. Looks easy enough to me...but that's just me...


    ADC issue - maybe a spike on the A/D input, CMOS latchup or something similar?

  3. #3
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    What about if you add some clamping diode, but instead of sending them to Vdd, send them to Vref... well a buffered Vref.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

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


    Did you find this post helpful? Yes | No

    Wink

    Hi, Steve

    Good idea ... I've placed a low-leakage BAW62 ... hope my TL431 ref. will agree !!!

    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 " !!!
    *****************************************

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


    Did you find this post helpful? Yes | No

    Default Once again ...

    Hi, pros

    One more 18F2520 Out of use after 30 Hours of good work, like the others, and still the same AN2 ADC input leakage current tremendously increasing. ( I repeat here AN1 has EXACTLY the same input circuit : a LM335 fully filtered and clamped : a 10k resistor in series ...).

    EVERYTHING has been carefully verified ... Even Microchip gurus didn't have anything to reply ...

    another " damaged " circuit has been continuously running for more than a year ... all other analog inputs are still Ok !!!

    Has anyone a little idea ???

    Date Markings are 07204AY ...

    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 " !!!
    *****************************************

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


    Did you find this post helpful? Yes | No

    Default

    Alain

    I'm not sure if just powering off and on the PIC would solve your problem. Most likely it would if the input protection got clamped on a spike and stayed stuck(latched). I've seen similar behaviour in other hardware with input protections and the usual way to recover was a power cycle. Is it possible for you to rule that out?

    Jerson

  7. #7
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Acetronics View Post
    ... and still the same AN2 ADC input leakage current tremendously increasing.
    Is there any possibility that the CVRCON register is getting modified somewhere along the way?

    Either intentionally ... CVRCON = %11000000

    or Unintentionally ... if you have ASM in your program and are in the wrong bank when writing to address B5.

    If the CVref is turned on, and the CVROE bit is set, the CVref will output on RA2/AN2/VREF-/CVREF.
    <br>
    DT

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