strange readings


Closed Thread
Results 1 to 7 of 7
  1. #1
    Join Date
    Nov 2007
    Posts
    9

    Default strange readings

    16f88 @ 16mhz

    What would cause strange readings on AN0 specifically? Here is the scenario, simple LM35 setup feeding output directly to AN0/pin 17. The temp reading is off by a couple of degrees. If I move the connection from AN0/pin 17 to AN1/pin 18 the temp reading is correct. Same thing goes for AN2/pin 1....it reads correctly. When I scope AN0/pin 17 (with LM35 output connected) I see the the clock signal with reasonable amplitude. When I scope the other analog inputs (with the LM35 connected) I see the clock signal again but a less than half the amplitude of AN0.

    I've tried different 16f88's and LM35's with the same results

    Looking at the internal diagrams of the 16f88 I can see that what I'm looking at is the internal switch but why would it be different across the board and how do I eliminate the problem. I've tried the suggestions in the LM35 datasheet but see no changes.


    Please tell me the answer is not....just use the analog inputs that give you the correct readings...hehe

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


    Did you find this post helpful? Yes | No

    Default

    <table><tr><td></td><td>Yeah there's some stuff like that.
    Can you post your whole code?
    What happen if you set all other analog input to digital?
    Did you try to increase the sampling time?</td></tr></table>
    Steve

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

  3. #3
    Join Date
    Nov 2007
    Posts
    9


    Did you find this post helpful? Yes | No

    Default

    You know. I didn't try setting all the other unused inputs to digital. I will give that a try. I have changed the sampling without any changes.

    I did have some success just a bit ago but putting a 200 ohm resistor from AN0/pin 17 to ground.

  4. #4
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Hi,

    I have no idea why the different pins are giving different readings but the way to have these LMs give a stable reading is to place a capacitor from the signal pin to ground. I use a 22uf.
    Dave
    Always wear safety glasses while programming.

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


    Did you find this post helpful? Yes | No

    Wink Temp measurements ... aaaaaaahhhhh, a whole story !!!

    Hi,

    The LM 35 problem ...

    Simply the output range : 0v for 0°C ...250 mV for 25°C !!!

    IF you use the 5v ref voltage ... 250 mV/ 5v = 1/50 of the usable range ...


    3 Solutions ...

    1) use a Vref just a bit Higher than your max input ( say 500 mv for 50°C ) - not so good !
    2) use a voltage amplifier that will allow 5v output for your max input temp.
    3) use a LM 335 that offers a 2.73 offset voltage @ 0°C

    The more you input on Analog inputs, the less parasitic signals you see ...

    Now, the LM 35 has a +/- 1.0 to 1.5 °C Guaranteed max error ..., add the A/D and calculation errors ( PbP works with INTEGERS !!! ) and your couple of degrees is here !!!

    as an eyeblick ... how precise is your temp ref ???? ... LOL !!! remember getting the true degree is not so easy ..., and getting the true 1/10 of degree is a really a performance.

    Back to the Input problem itself ... What about the comparators settings ???

    Alain ... Thermics engineer ...
    Last edited by Acetronics2; - 24th November 2007 at 08:43.
    ************************************************** ***********************
    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 2007
    Posts
    9


    Did you find this post helpful? Yes | No

    Default

    thanks for the input. I will try the 22uf cap and adding an op amp. Also, the LM335 seems like the best solution.

    I agree, getting the accuracy will be a problem but that is not what I'm concerned about. Getting the same reading across different analog inputs is what makes me wonder.

  7. #7
    Join Date
    Nov 2007
    Posts
    9


    Did you find this post helpful? Yes | No

    Default

    This problem turned out to be capacitive coupling as I did not have the same problem once I built a circuit board. There is enough capacitance in my bread board to couple the signal from the clock source to the analog input.

Similar Threads

  1. Temp readings and voltage input
    By ruijc in forum mel PIC BASIC Pro
    Replies: 20
    Last Post: - 7th July 2008, 12:35
  2. Found something strange (BUG???)
    By GrandPa in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 14th November 2007, 19:50
  3. adc averaging readings
    By amgen in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 21st June 2006, 00:57
  4. strange int behaviour
    By tom in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 17th November 2005, 15:41
  5. Strange ASM file
    By barkerben in forum General
    Replies: 2
    Last Post: - 29th November 2004, 18:54

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