aqui te dejo un ejemplo que funciona a la perfeccion, espero que te sirva:
DEVICE = 16F877A
XTAL = 4
CONFIG HS_OSC , WDT_OFF , PWRTE_ON , BODEN_OFF , LVP_OFF
delayms 500
all_digital=true
declare lcd_dtpin portb.4
SYMBOL DQ = PortA.0 ' Place the DS1820 on bit-1 of PORTA
DIM Temp AS WORD ' Holds the temperature value
dim grad as word
DIM C AS word ' Holds the counts remaining value
DIM CPerD AS word ' Holds the Counts per degree C value
CLS ' Clear the LCD before we start
Again:
OWRITE DQ, 1, [$CC, $44] ' Send Calculate Temperature command
REPEAT
DELAYMS 25 ' Wait until conversion is complete
OREAD DQ, 4, [C] ' Keep reading low pulses until
UNTIL C <> 0 ' the DS1820 is finished.
OWRITE DQ, 1, [$CC, $BE] ' Send Read ScratchPad command
OREAD DQ, 2,[Temp.LOWBYTE,Temp.HIGHBYTE,C,C,C,C,C,CPerD] ' Calculate the temperature in degrees Centigrade
Temp = (((Temp >> 1) * 100) - 25) + (((CPerD - C) * 100) / CPerD)
temp = temp/8
print at 1,3,"TEMPERATURA"
Print $FE,$40,$07,$05,$07,$00,$00,$00,$00,$00
PRINT AT 2,6, DEC Temp / 100, ".", DEC2 Temp," ", AT 2,10,0,"C"
GOTO Again