tags:

views:

67

answers:

2

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 error detection percentage be high? Is there a formula for this?

+1  A: 

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.

msw
A: 

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).

Yann Ramin