Hi Scott, You might not have read the whole application note (AN27), so let me just add that in addition to the DOW algorithm, Dallas Semiconductor *does* present the CRC-16 algorithm (polynomial X^16 + X^15 + X^2 + 1) later on in the application note (see page 9). Thanks for contributing the links to your code. Best regards, Ken Pergola -----Original Message----- From: pic microcontroller discussion list [mailto:PICLIST@MITVMA.MIT.EDU]On Behalf Of Scott Dattalo Sent: Tuesday, August 12, 2003 6:30 PM To: PICLIST@MITVMA.MIT.EDU Subject: Re: [PIC]: PIC18F fast CRC-16 LUT code *not* wanted, but rather you can have it On Mon, 11 Aug 2003, Ken Pergola wrote: > Perhaps the following code may be useful to someone either now or in the > future (at least it's nice to have in your engineering toolbox). > > I've adapted the fast look-up table CRC-16 from the Dallas Semiconductor > Application Note 27 to the PIC18F architecture: Actually the CRC algorithm in AN27 is *not* CRC-16. Read the bottom of page 2 - their algorithm is something they call "DOW CRC" for "Dallas One Wire" and it's an 8-bit CRC. If you want another C-implementation then check out: http://www.dattalo.com/technical/software/pic/crc_8bit.c If you want the assembly version then: http://www.dattalo.com/technical/software/pic/crc_8.asm It takes only 20 cycles (and is only 19 instructions). If you do want the CRC-16, or more specifically the CRC-CCITT-16, then check out here: http://www.dattalo.com/technical/software/pic/crc.php By the way, the CRC-CCITT-16 algorithm can be implemented in 5 instructions on an ARM. Scott -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body