PDA

View Full Version : Dallas 1-Wire CRC Calculation



CocaColaKid
- 9th August 2005, 18:24
Can someone tell me how the CRC is calculated for the DS18S20 temperature sensors? I use the following line to receive the temperature and CRC but I'm not sure how to calculate the CRC to do a comparison.

owin portb.7, 0, [temp.byte0, temp.byte1,SKIP 6,crc]

Darrel Taylor
- 10th August 2005, 01:03
Tom Estes posted two different Dallas 1-wire CRC routines here in the Code Examples forum.

Dallas CRC16 Routines (http://www.picbasic.co.uk/forum/showthread.php?t=1745)

Dallas CRC8 Routines (http://www.picbasic.co.uk/forum/showthread.php?t=1672)<br><br>

CocaColaKid
- 10th August 2005, 01:22
Thanks to the link/info. This is exactly what I was looking for.

RubenR
- 15th August 2005, 09:43
Thank you for the posts. I found where I was looking for. For those who want to know more about CRC read this article called: 'A painless guide to CRC error detection algorithms' http://www.geocities.com/SiliconValley/Pines/8659/crc.htm