Help with DS18B20 program


Closed Thread
Results 1 to 39 of 39

Hybrid View

  1. #1
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    If it's reading all 1's my guess would be it's a bad sensor or you have it wired backwards.
    I have wired a few of these backwards, and they refused to work afterwards. Even after
    I re-wired it.

    With the flat side facing you, pins downward, from left-to-right, are ground, DQ, Vdd.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  2. #2
    Join Date
    Nov 2007
    Posts
    20


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Bruce View Post
    With the flat side facing you, pins downward, from left-to-right, are ground, DQ, Vdd.
    Just like the way I have it connected.

    Really don't remember ever connecting it the wrong way. Then again, I was too excited at the beginning So, I'm guessing either I messed it up at some point, or DigiKey sent me a bad sensor. Wish there was a way to check the sensor (like resistance values across pins etc.) and also wish that these sensors were not $5 a pop. You know any place where they sell these for less than $5?

    I can live with a bad sensor knowing that my program had the potential to work Will try again. Anyway, thanks a lot Bruce for all your help.

  3. #3
    Join Date
    Oct 2007
    Location
    Vancouver, BC, Canada
    Posts
    33


    Did you find this post helpful? Yes | No

    Default

    you might find the ds18b20 at http://canada.newark.com/


    Quote Originally Posted by presario1425 View Post
    Just like the way I have it connected.

    Really don't remember ever connecting it the wrong way. Then again, I was too excited at the beginning So, I'm guessing either I messed it up at some point, or DigiKey sent me a bad sensor. Wish there was a way to check the sensor (like resistance values across pins etc.) and also wish that these sensors were not $5 a pop. You know any place where they sell these for less than $5?

    I can live with a bad sensor knowing that my program had the potential to work Will try again. Anyway, thanks a lot Bruce for all your help.

  4. #4
    Join Date
    Oct 2007
    Location
    Vancouver, BC, Canada
    Posts
    33


    Did you find this post helpful? Yes | No

    Default

    the thing is you have not mention how fast you are running your PIC. I found that problem when I ran my pic18f4550 with 20HMz, all I read back from the ds18b20 are zero/not connected. If I lower the chip to 4HMz then I can read the temperature.

    I don't know how to confirm this, the OWOUT and the OWIN command might be too fast for the ds18b20 to catch up with faster pic chip ?

  5. #5
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Check http://www.findchips.com This shows 6 distributors that stock the 18B20.
    Where are you located? I'll send you a used one (at least we know it's working)
    if you spring for the postage.

    But, before I wrote it off as bad, I would check with what KVLV just said. You might
    try using a different I/O-pin, different oscillator speed, etc.

    Try a timing test with say an LED on a port pin. Toggle it on & off. Does it toggle at the
    speed you expect? If not, it could be a timing issue, and that would definitely be a problem
    with 1-wire comms.

    LCDOUT can sometimes work just fine. Even if you have the wrong oscillator speed declared.
    So I would run a series of tests before I wrote the sensor off as bad. Just in case.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

Similar Threads

  1. Presetting Configuration Fuses (PIC Defines) into your Program
    By Melanie in forum FAQ - Frequently Asked Questions
    Replies: 82
    Last Post: - 15th December 2013, 10:54
  2. Replies: 1
    Last Post: - 23rd May 2009, 10:22
  3. Compile and Program help using PICKit2
    By ozarkshermit in forum mel PIC BASIC Pro
    Replies: 15
    Last Post: - 10th March 2009, 15:51
  4. Making Program Code Space your playground...
    By Melanie in forum Code Examples
    Replies: 15
    Last Post: - 19th July 2008, 09:26
  5. PIC16F684 Program question
    By Nicholas in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 28th December 2006, 15:30

Members who have read this thread : 2

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