Shozo,
here I found a well done prg. for 18B20 that maybe can help you.
http://www.rentron.com/PicBasic/one-wire3.htm

bye