开发者

How to Determine Which CRC to Use?

开发者 https://www.devze.com 2023-01-04 07:40 出处:网络
If I have a certain number of bytes to transfer serially, how do I determine which CRC (CRC8, CRC16, etc., basically a how many bit CRC?) to use and still have err开发者_C百科or detection percentage b

If I have a certain number of bytes to transfer serially, how do I determine which CRC (CRC8, CRC16, etc., basically a how many bit CRC?) to use and still have err开发者_C百科or detection percentage be high? Is there a formula for this?


From a standpoint of the length of the CRC, normal statistics apply. For a bit-width of CRC, you have 1/(2^n) chance of having a false positive. So for a 8 bit CRC, you have a 1/255 chance, etc.

However, the polynomial chosen also makes a big impact. The math is highly dependent on the data being transferred and isn't an easy answer.

You should evaluate more than just CRC depending on your communication mechanism (FEC with systems such a turbo codes is very useful and common).


To answer this question, you need to know the bit error rate of your channel which can only be determined empirically. And then once you have the measured BER, you have to decide what detection rate is "high" enough for your purposes.

Sending each message, for example, 5 times will give you pretty pretty good detection even on a very noisy channel, but it does crimp your throughput a bit. However, if you are sending commands to a deep-space-probe you may need that redundancy.

0

精彩评论

暂无评论...
验证码 换一张
取 消