Electronics > Microcontrollers

Choosing the best CRC

(1/8) > >>

ricko_uk:
Hi,
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 :)

lapi:
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.

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

Tim

boB:

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.

boB

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

Navigation

[0] Message Index

[#] Next page

There was an error while thanking
Thanking...
Go to full version