Hi, Dave Dribin wrote: >Hmmm... I think that's the wrong polynomial. I need >x^16+x^15+x^2+x^0. That code is rather dense and I have no idea how >to change the poly. :) I'm gonna have to read over that thread >again. I'm still not quite sure how the table went away. :) Well, it is a bit 'tricky' to just read the outcome :) anyway it started out with this: http://www.digitalnemesis.com/ash/projects/EmbeddedCRC16/default.htm When Ashley Roll made a nice initiative for sharing some easy to read/use crc code. What can be concluded out of this simple routine is breifly the following: -update crc16 for first nibble=20 -calculate nibble indexes to crc tables. -shift left 4 times -update crc16 for second nibble=20 -calculate nibble indexes to crc tables. Then Scott Dattalo realised some possible optimisations: http://www.infosite.com/~jkeyzer/piclist/2002/May/0823.html Then I realised that for this poly ( might differ for others ) it was quite easy to just skip the tables and calculate the output directly: http://www.infosite.com/~jkeyzer/piclist/2002/May/0919.html Scott followed by introducing the optimised screamer: http://www.infosite.com/~jkeyzer/piclist/2002/May/0966.html To use another poly one probably would have to start from the beginning by making an new table. I'm not certain that all poly would be suitable for this optimisation, but it wouldn't stop me from trying :) Fun stuff, /T -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics