DS18B20, 16F88 problem


Closed Thread
Results 1 to 12 of 12

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    I'm trying to figure out how you got that result, and I can't find anyway to make it come up with 0Fh.

    Backtracking a bit, originally you said that you were getting a reading of 74ºF.
    With this formula temperature=((((temperature>>4)+50)*9)/5)-58 temperature would have to be greater that 65500 to get 74ºF.

    ((((65535>>4)+50)*9)/5)-58 = 7403
    Then dividing by 100 before displaying on the LCD will give you 74

    That's why I think you're recieving all 1's (no response) from the DS18B20.

    If you removed the /100, you should get 7403 instead of 0Fh. So This is really wierd. What changes did you make?

    A few things to check...
    What is the actual data being received? 65535?

    How many loops are executed waiting for the conversion in Wait_Temp:? My guess here is that NO loops are performed because it receives a 1, apparently indicating that the conversion is complete, even though it's not working at all.

    While the program is running, ground out the data pin. Does the reading change?

    The OWIN/OUT portions of the program are fine, and should work. So there's got to be something going on with the hardware.
    DT

  2. #2
    Join Date
    Jun 2005
    Location
    Wisconsin
    Posts
    382


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Darrel Taylor
    How many loops are executed waiting for the conversion in Wait_Temp:? My guess here is that NO loops are performed because it receives a 1, apparently indicating that the conversion is complete, even though it's not working at all.

    While the program is running, ground out the data pin. Does the reading change?
    I put some serial debug messages in...as expected it never actually loops at the wait. If I ground DQ out PIC processor reboots.

    I have gone thru that section of the prototype and found nothing wrong with the wiring. Very Odd.

  3. #3
    Join Date
    Jun 2005
    Location
    Wisconsin
    Posts
    382


    Did you find this post helpful? Yes | No

    Default

    Okay I'm stupid. The data sheet shows what I thought was a top image of the TO92 package...its actually a BOTTOM image. I have +5 and Gnd flipped. I'm allowed one mistake every once in a while.

    Now that the hardware problem is corrected I'm getting a reading of zero again. I wouldn't think swapping 5V and Gnd would kill the sensor, would it?
    Last edited by DynamoBen; - 29th December 2005 at 02:44.

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


    Did you find this post helpful? Yes | No

    Default

    I have fried Dallas 1-wire parts before inserting them backwards for only a few seconds.

    Try something super simple like reading & displaying the raw temp value returned. If that doesn't work, it's probably toast.
    Regards,

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

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


    Did you find this post helpful? Yes | No

    Default

    In engineering, you're allowed to make lots of mistakes, as long as the next EC (engineering change) solves the problem.
    DT

  6. #6
    Join Date
    Jun 2005
    Location
    Wisconsin
    Posts
    382


    Did you find this post helpful? Yes | No

    Default

    If I ground the DQ pin I get all 1's. When I attach DQ to the pic I get a Raw reading of 170. The problem is its still at 170 after several minutes in the freezer. I'm thinking its dead.

  7. #7
    Join Date
    Feb 2003
    Location
    Sydney, Australia
    Posts
    126


    Did you find this post helpful? Yes | No

    Default

    I know this is an old post - but I though I might add what I discovered as it might help someone else in this position.

    I had a similar situation using Bruce Reynolds demo code. After a load of time spent trying a whole lot of stuff including swapping sensors I found this -

    When the DS18B20 is running in Parasitic Power mode (ie VCC input is tied to GND) then it cannot pull the DQ line high to notify the conversion is in progress.

    I reconnected the Vcc on my DS18B20 to +5 and now it runs like a charm.

    Hope this helps someone else !

    Bill.
    Last edited by bcd; - 10th June 2007 at 07:24.

Similar Threads

  1. 16F627A to 16F88 conversion problem
    By PICpocket in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 18th February 2009, 19:20
  2. 16F88 ADC problem
    By greensasquatch in forum mel PIC BASIC Pro
    Replies: 19
    Last Post: - 7th September 2008, 16:16
  3. Problem with 16f88 steep motor control
    By ken_23 in forum Off Topic
    Replies: 0
    Last Post: - 4th July 2008, 12:25
  4. Another DS18B20 problem
    By ruijc in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 2nd February 2008, 19:18
  5. Problem with 16F88 controlling h-bridges
    By silentwol in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 7th March 2007, 04:16

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