DS18B20 using ROM ID


Closed Thread
Results 1 to 9 of 9
  1. #1
    Join Date
    Aug 2008
    Posts
    31

    Default DS18B20 using ROM ID

    i am trying to read ds18b20 using rom id but i got 0.6 reading even if i replace the sensor with another one i do not know why attached is the code
    Attached Files Attached Files

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


    Did you find this post helpful? Yes | No

    Default

    Hi, Ahmed

    I placed one of MY read command lines ( commented ) close to yours ...

    Code:
    ' OWOut DQ, 1, [$55, FAM, ID[6],ID[5],ID[4],ID[3],ID[2],ID[1], CRC, $44 ]	
      OWOut DQ, 1, [$55, $28,  $D3,  $60,  $F6,  $01,  $00,  $00,  $00, $41 ,$44]        	    ' Start temperature conversion Sensor 1
    see any difference ??? ...

    Alain
    Last edited by Acetronics2; - 11th April 2010 at 10:52.
    ************************************************** ***********************
    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 " !!!
    *****************************************

  3. #3
    Join Date
    Aug 2008
    Posts
    31


    Did you find this post helpful? Yes | No

    Default

    hi,
    thanks for fast replay so u want me to replace my line with what u sent or to add it
    i wnat to be sure from something

    DS18B20 rom id $28, $D3, $60, $F6, $01, $00, $00, $41, $4E
    so
    FAM = $28
    ID1 = $D3
    ID2 = $60
    ID2 = $F6
    ID3 = $01
    ID4 = $00
    ID5 = $00
    ID6 = $41
    CRC = $4E


    '

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


    Did you find this post helpful? Yes | No

    Lightbulb

    Quote Originally Posted by ahmed_salah View Post

    .
    .
    .
    ID2 = $60
    ID2 = $F6
    .
    .
    .
    one of them is not the right one ... obviously

    you have a 14 characters ID Number ... and Maxim chips only have ... a 12 Characters ID Number !!!

    can't help you further ...

    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
    Aug 2008
    Posts
    31


    Did you find this post helpful? Yes | No

    Default

    yes ,
    you r right this all the code which i got when issue OWOUT DQ, 1, [$33] command
    so this id include device manufacture and crc

  6. #6
    Join Date
    Aug 2008
    Posts
    31


    Did you find this post helpful? Yes | No

    Default

    this what i got when issue command OWOUT DQ, 1, [$33]
    $28, $D3, $60, $F6, $01, $00, $00, $41

    $28 is the FAM as i think
    $41 is the CRC

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


    Did you find this post helpful? Yes | No

    Wink Here we are !!!

    Quote Originally Posted by ahmed_salah View Post
    this what i got when issue command OWOUT DQ, 1, [$33]
    $28, $D3, $60, $F6, $01, $00, $00, $41

    $28 is the FAM as i think ... yes.
    $41 is the CRC
    ... yes.

    you had printed

    Code:
     OWOut DQ, 1, [$55, $28,  $D3,  $60,  $F6,  $01,  $00,  $00,  $00, $41 ,$44]
    3 times $00

    instead of

    Code:
     OWOut DQ, 1, [$55, $28,  $D3,  $60,  $F6,  $01,  $00,  $00,  $41 ,$44]
    only 2 times $00 needed !!!

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

  8. #8
    Join Date
    Aug 2008
    Posts
    31


    Did you find this post helpful? Yes | No

    Default

    hi,
    your are right it was my wrong i add extra 00 on id , now it working good ,
    but when i change sensor or remove it i got 0.6 reading on LCD the first part of the program checks for presistance of specific ds18B20 and if it found complete the program and read temp else display no sensor , can u help in that

  9. #9
    Join Date
    Aug 2008
    Posts
    31


    Did you find this post helpful? Yes | No

    Default

    hi,
    i update the code as attached i remove the initialization part and i got the same right reading
    do u think it is not important to use initialization part

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