wrong place for this
however i am having problems with a dallas ds1821 temperature sensor
connected to a 16f877a pin rc2 with a 4.7 k pullup and running at 20 mhz
it is working but readings are incorrect fairly sure i am communicating

listing

A
'display message on the 2 X 16 character LCD using pic16f84a and DS1820
@ DEVICE pic16f877a, HS_OSC, WDT_ON, PWRT_ON, LVP_OFF, PROTECT_OFF

' Define LCD registers and bits
Define LCD_DREG PORTB ' Port for LCD Data
Define LCD_DBIT 4 ' Use upper 4 bits of Port
Define LCD_RSREG PORTB ' Port for RegisterSelect (RS) bit
Define LCD_RSBIT 3 ' Port Pin for RS bit
Define LCD_EREG PORTB ' Port for Enable (E) bit
Define LCD_EBIT 2 ' Port Pin for E bit
Define LCB_BITS 4 ' Using 4-bit bus
Define LCD_LINES 2 ' Using 2 line Display
Define LCD_COMMANDUS 2000 ' Command Delay (uS)
Define LCD_DATAUS 50 ' Data Delay (uS)

define loader_used 1

DEFINE OSC 20

symbol DQ = PORTC.2
temp var word
cou var byte
cou1 var byte
pause 100
main:
owout DQ, 1,[$CC, $44]
owin DQ, 4,[cou]
if cou = 0 then
owout DQ, 1, [$cc, $BE]
owin DQ, 0,[temp.lowbyte, temp.highbyte, skip 4, cou,cou1]
endif

temp = (((temp >> 1) * 100) - 25 ) + (((cou - cou1) * 100) / cou)
lcdout $fe,1," Environment Tempera"
lcdout $fe, $c0, dec (temp / 100), " . " , dec temp, " C"
pause 1000
lcdout $fe,1
pause 2000

lcdout $fe, $c0, dec (temp / 100), " . " , dec temp, " C"
pause 1000
goto main
end

can someone check this thanks