avr-libc-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-libc-dev] [patch #7485] CRC8-CCITT


From: Erik Walthinsen
Subject: Re: [avr-libc-dev] [patch #7485] CRC8-CCITT
Date: Fri, 03 May 2013 12:01:18 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130329 Thunderbird/17.0.5

On 05/03/2013 10:47 AM, Joerg Wunsch wrote:
Thinking more about it, _crc8_ccitt_update is OK, too.  Ideally,
the name should reflect the polynomial, but _crc8_8_2_1_0_update
is too clumsy. ;-)

I suggested this a while back, naming the actual functions after the polynomials and aliasing the common names. But you don't have to do something like crc8_8_2_1_0, you use the hex value: crc8_0x07.

There's a table on Wikipedia of all the common CRCs, with those values listed:

http://en.wikipedia.org/wiki/Cyclic_redundancy_check

The "normal" form seems to be the right way to go here, I think. In particular this is the form that the Xmega CRC manual uses: CRC16-CCITT is 0x1021 and CRC32 is 0x04C11DB7. Who knows what the NVM's CRC is, though the assertion in the manual is that you can force the NVM to go through the real CRC module at least.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]