MAS7.1 Supplemental Guide, Rev 1.1, 9/28/07
29
K.I.S.S.™
Keep It Simple Serial
Checksums and CRC-8 Checkcodes (Continued)
This polynomial was determined through exhaustive tests (all 8 bit polynomials tested), to be the best CRC-8
polynomial for arbitrarily length bit streams.
See the paper entitled: “Cyclic Redundancy Code (CRC) Polynomial Selection For Embedded Networks” by
Philip Koopman & Tridib Chakravarty:
<http://www.ece.cmu.edu/~koopman/roses/dsn04/koopman04_crc_poly_embedded.pdf>
Another good source of CRC information is the CRC entry on Wikipedia:
<http://en.wikipedia.org/wiki/Cyclic_redundancy_check>
Differences between a Checksum and a CRC-8 Checkcode
A CRC is capable of finding more, and different types of errors, than a checksum can. A good description of its
capability is described in the above referenced articles, but a simple example show some of the differences.
Here’s an example of the intended command string:
LI 3,2,80
Here’s some examples of the original and some badly formed strings, of the above example, and their associ-
ated checksums:
LI 2,3,80;21
LI 3,80,2;21
IL 3,2,80;21
KJ 80,2,3;21
Notice that every checksum is the same. Checksums cannot detected data being out of order. Checksums
cannot detect errors where two bits, in the same position in two different bytes, are flipped. Checksums are not
a very robust way to check for communication errors.
For comparison, here are the same examples and their associated CRC-8 checkcodes:
LI 2,3,80;84
LI 3,80,2;100
IL 3,2,80;127
KJ 80,2,3;9
The CRC-8 checkcode easily catches these errors.