LM71 reads garbage sometimes.


Closed Thread
Results 1 to 13 of 13

Hybrid View

  1. #1
    Join Date
    Feb 2013
    Posts
    1,122

    Default LM71 reads garbage sometimes.

    Hello.

    I'm facing a strong problem with LM71. Sometimes it reads garbage. Changed IC, changed PIC, changed power supply - same problem. If I cycle power sometimes one time, sometimes 3 times, etc. it then works. The code is as follows:

    Code:
    READTEMP: 'READ TEMPERATURE
      low thcs	
      pause 5
      shiftin thdta,thclk,msbpre,[result\16]
      pause 5	
      high thcs	
      THC=result>>2/28
      THC=THC-3
    RETURN
    tried to play with pause times - no difference.

    What I'm doing wrong?

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


    Did you find this post helpful? Yes | No

    Default Re: LM71 reads garbage sometimes.

    Totally off the top of my head, are the variables the proper size for that math?

    Robert

  3. #3
    Join Date
    Feb 2013
    Posts
    1,122


    Did you find this post helpful? Yes | No

    Default Re: LM71 reads garbage sometimes.

    THC and result variables are WORD type.

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


    Did you find this post helpful? Yes | No

    Default Re: LM71 reads garbage sometimes.

    Do you have the pins on the 71 pulled high?
    Dave
    Always wear safety glasses while programming.

  5. #5
    Join Date
    Feb 2013
    Posts
    1,122


    Did you find this post helpful? Yes | No

    Default Re: LM71 reads garbage sometimes.

    No, I should?

  6. #6
    Join Date
    Feb 2013
    Posts
    1,122


    Did you find this post helpful? Yes | No

    Default Re: LM71 reads garbage sometimes.

    Tried 4.7k pull-ups on all pins, does not helps.

  7. #7
    Join Date
    May 2008
    Location
    Italy
    Posts
    825


    Did you find this post helpful? Yes | No

    Default Re: LM71 reads garbage sometimes.

    From cs low to the out of data the maximum time delay is 70 ns. you are using 5 ms. play with that delay using pauseus.
    See data sheet timing table.
    Cheers

    Al.
    All progress began with an idea

  8. #8
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default Re: LM71 reads garbage sometimes.

    Quote Originally Posted by CuriousOne View Post
    Hello.

    I'm facing a strong problem with LM71. Sometimes it reads garbage. Changed IC, changed PIC, changed power supply - same problem. If I cycle power sometimes one time, sometimes 3 times, etc. it then works. The code is as follows:

    Code:
    READTEMP: 'READ TEMPERATURE
      low thcs	
      pause 5
      shiftin thdta,thclk,msbpre,[result\16]
      pause 5	
      high thcs	
      THC=result>>2/28
      THC=THC-3
    RETURN
    tried to play with pause times - no difference.

    What I'm doing wrong?
    Maybe enable Power up timer in the configs
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  9. #9
    Join Date
    Feb 2013
    Posts
    1,122


    Did you find this post helpful? Yes | No

    Default Re: LM71 reads garbage sometimes.

    Delay changes nothing, since I tried different values of PAUSE. The problem is startup, if once started OK, then it works OK. Also, I've tried to initialize it later, say after 5 seconds after power on - no luck.

  10. #10
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default Re: LM71 reads garbage sometimes.

    Pause has nothing to do with power up , sometimes mcu does not get nice crisp power on and it doesn't like slow lazy power on like when capacitors are on it's input, power up delay holds in reset until voltage is up to snuff and then allows it to boot.
    One other thought : you have changed everything except the breadboard, breadboards do go bad.
    Last edited by Archangel; - 1st February 2014 at 07:46.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  11. #11
    Join Date
    Feb 2013
    Posts
    1,122


    Did you find this post helpful? Yes | No

    Default Re: LM71 reads garbage sometimes.

    Well, I'm not using breadboard at all. I've tried to make different PCBs, switched power supplies, etc. no help.

  12. #12
    Join Date
    Dec 2010
    Posts
    409


    Did you find this post helpful? Yes | No

    Default Re: LM71 reads garbage sometimes.

    You will need to post your whole code , but here are a couple clues... The device needs a write on the rising edge, then data will be available on the falling edge. While CS is held low, send a command with a PRE then receive data with a POST. Also, are you sure you get valid data ever? The datasheet looks like you should be using LSB first, not MSB.

Similar Threads

  1. ds18s20 reads incorectly
    By jcleaver in forum mel PIC BASIC Pro
    Replies: 42
    Last Post: - 28th May 2014, 19:03
  2. 5v on analog pin but reads value
    By jmgelba in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 9th November 2012, 03:41
  3. Garbage in from RFID
    By lilimike in forum Serial
    Replies: 6
    Last Post: - 6th December 2009, 14:55
  4. EEPROM writes and reads
    By boroko in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 19th November 2008, 01:56
  5. SEROUT Just Garbage!
    By Kman in forum mel PIC BASIC Pro
    Replies: 36
    Last Post: - 6th September 2006, 19:42

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