PDA

View Full Version : DS18B20 using ROM ID



ahmed_salah
- 11th April 2010, 08:57
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

Acetronics2
- 11th April 2010, 09:35
Hi, Ahmed

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



' 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

ahmed_salah
- 11th April 2010, 10:57
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


'

Acetronics2
- 11th April 2010, 12:35
.
.
.
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

ahmed_salah
- 11th April 2010, 12:57
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

ahmed_salah
- 11th April 2010, 13:03
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

Acetronics2
- 11th April 2010, 14:16
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



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


3 times $00

instead of



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


only 2 times $00 needed !!!

Alain

ahmed_salah
- 11th April 2010, 17:25
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

ahmed_salah
- 11th April 2010, 18:36
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