Electronics > Microcontrollers

Choosing the best CRC

(1/8) > >>

I always used either the ones clients asked for or just a CRC-16 I wrote years ago and kept using.

But there are very many CRCs and I was wondering what the logic of choosing one is...?

Thank you :)

The choice depends on what kinds of errors need to be detected and how long the messages are expected to be. Various kinds of errors and polynomials that detect them are discussed in a wikipedia article on CRC mathematics https://en.wikipedia.org/wiki/Mathematics_of_cyclic_redundancy_checks. These are discussed in many textbooks on communications, like "Data&Computer Communications" by William Stallings.

The "best" CRC can be chosen, for example, by running simulations of the messages sent over the chosen channel using channel models and the chosen coding, modulation etc. and looking for relative efficiency of detecting errors in the received messages (smallest probability of accepting a message which contains errors) between the candidate  CRC polynomials.

You may also simply want to choose the one with hardware support -- many MCUs have a CRC module included.



If you are wanting to connect to an already made system, then just use what is compatible with that system.  Polynomial, etc...

If you are rolling your own system with a microcontroller with built in CRC, then just use that CRC.


If you want to go down a rabbit hole on this: https://users.ece.cmu.edu/~koopman/crc/


[0] Message Index

[#] Next page

There was an error while thanking
Go to full version