Here is another one, based on code from this page: This is a CRC16 CCITT, not sure if it the same as dallas use though... ///// CRC16 functions const byte CRC16TableHigh[]=3D{ 0x00, 0x10, 0x20, 0x30, 0x40, 0x50, 0x60, 0x70, 0x81, 0x91, 0xA1, 0xB1, 0xC1, 0xD1, 0xE1, 0xF1 }; const byte CRC16TableLow[]=3D{ 0x00, 0x21, 0x42, 0x63, 0x84, 0xA5, 0xC6, 0xE7, 0x08, 0x29, 0x4A, 0x6B, 0x8C, 0xAD, 0xCE, 0xEF }; TWREG CRC16Work; // 16 bit. void CRC16_Update4bits(byte val ) { byte t; // Step one, extract the Most significant 4 bits of the CRC register t =3D CRC16Work.b.high >> 4; // XOR in the Message Data into the extracted bits t =3D t ^ val; // Shift the CRC Register left 4 bits CRC16Work.w<<=3D4; // Do the table lookups and XOR the result into the CRC Tables CRC16Work.b.high=3DCRC16Work.b.high ^ CRC16TableHigh[t & 0x0f]; CRC16Work.b.low=3DCRC16Work.b.low ^ CRC16TableLow[t & 0x0f]; } word CRC16(void *adr,byte count) { CRC16Work.w=3D0xffff; // Initialize running CRC. for(;count>0;count--){ CRC16_Update4bits(*((byte*)adr)>>4); CRC16_Update4bits(*((byte*)adr)); ((byte*)adr)++; } return CRC16Work.w; } Regards / Ruben > Perhaps the following code may be useful to someone either now or in th= e > future (at least it's nice to have in your engineering toolbox). >=20 > I've adapted the fast look-up table CRC-16 from the Dallas Semiconducto= r > Application Note 27 to the PIC18F architecture: >=20 > (I apologize to all if the text formatting comes across badly trashed.) >=20 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D Ruben J=F6nsson AB Liros Electronic Box 9124, 200 39 Malm=F6, Sweden TEL INT +46 40142078 FAX INT +46 40947388 ruben@pp.sbbs.se =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.