Scott, Your test loop is comparing the lo byte of the CRC twice and ignoring the hi byte! Bob Ammerman RAm Systems ----- Original Message ----- From: "Scott Dattalo" To: Sent: Monday, December 27, 2004 4:03 PM Subject: [PIC] CRC16 > > Quite a while back, Ashley Roll, Dave Dribin and I were kicking around > CRC16 implementations for a PIC. Just recently, Johan Bodin asked about > the CRC algorithm for the Polynomial A001, which as he says, sounds an > awful lot like the reversed 8005 polynomial. I didn't realize at the time > he asked that it was indeed the reversed 8005 polynomial and hence the > CRC16 algorithm. So, I merrily went off and wrote a new optimized > version. This one is only 23 instructions, which is 9 fewer than the > previous version! It's isochronous, taking 23 cycles, and requires no > tables. > > Here's the routine: > > http://www.dattalo.com/technical/software/pic/crc16.asm > > Here are other CRC routines: > > http://www.dattalo.com/technical/software/pic/crc.php > > Scott > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist