Hello again. I am dealing with a dallas one-wire temp sensor. I have used rentron electronics pages as a reference. I know how to poll the temp sensor to get its address. In my app, I need the the pic (16f876a with 20mhz) to poll it automatically without have to be hardcoded into the program. Here is what I have done so far:
OWOUT DQ, 1, [$33]
OWIN DQ, 0, [STR ID\8] this should place the address in the array.
Then to use the temp sensor:
OWOUT D, 1, [$55,str ID\8,$44]
w1:
OWIN D, 4, [Stat]' Check for still busy converting
IF Stat = 0 THEN W1' Still busy?, then loop
OWOUT D, 1,[$55,str ID\8,$BE]
OWIN D, 2, [Temp.LOWBYTE,Temp.HIGHBYTE]' Read two bytes, then end communications
IF Temp.bit15 = 1 THEN Below_32 ' Check for temp below 0°C
this code is straight off of Bruce's website (great site by the way). When the pic is fired up, the lcd outputs a temp of 32.32F with obviously is not correct. Any ideas? Thanks.
Bookmarks