|
Posted by Padu on November 30, 2005, 12:08 pm
> Hi,
> I am designing and developing a simple communication protocol to
> communicate a PC with an ATMEL128 microcontroller (the MAVRIC-IIB
> board) using the RS485. The last block of every message will be the
> output code of an error detection algorithm, and I am deciding which
> algorithm would perform the best.
> At first, I implemented both CRC-CCITT and CRC-16, but I do not know if
> these algorithms are too hard to calculate for the micro.
> Which algorithms would you recommend, having in consideration
> performance/computing requirements?
> Thanks
I'm doing the exact same thing, and here's an exerpt from the document I'm
writing (the project is my graduation thesis, so I HAVE TO write all this
stuff)
"Error detection will be accomplished by using a two bytes CRC code
contained in each data packet. The algorithm for CRC generation and
validation is the 8-bit Fletcher algorithm, used as a TCP standard (RFC
1145/1146).
The Fletcher algorithm is defined below for a given buffer buffer[N] with N
bytes to be checked. Each one of the CRC bytes should be an 8-bit unsigned
integer.
crc_a = 0, crc_b = 0
for i=0 to N-1
crc_a = crc_a + buffer[i]
crc_b = crc_b + crc_a
Cheers
Padu
|
> I am designing and developing a simple communication protocol to
> communicate a PC with an ATMEL128 microcontroller (the MAVRIC-IIB
> board) using the RS485. The last block of every message will be the
> output code of an error detection algorithm, and I am deciding which
> algorithm would perform the best.
> At first, I implemented both CRC-CCITT and CRC-16, but I do not know if
> these algorithms are too hard to calculate for the micro.
> Which algorithms would you recommend, having in consideration
> performance/computing requirements?
> Thanks