??? 08/06/07 19:08 Read: times |
#142830 - CRC16 CCITT - What a challenge! |
I couldn not resist, sat down and polished the "algorithmic" solution for the CCITT CRC-16 (0x1021 "direct", left shifting ("normal" bit order)) a bit more.
Now, it is 22 cycles, compared to 14 for the table based (I tweaked the latter, too); giving up one RAM byte (I (ab)used B) and carry. The code space consumption is uncomparable. This makes the use of the table version highly questionable; whereas C-based implementations are a bad joke since today (except for Russ, who apparently does not value execution speed in embedded mcu-s too much ;-) ). Both implementations are in the code library (look for CRC16 - what did you expect? :-) ) Now, beat me if you can! :-) JW |