|
Posted by Ben Bradley on December 1, 2005, 2:01 pm
wrote:
>> Brian Dean has some code for MAVRIC-IIB for some communication
>> protocols.
>My trouble is not with the communication protocol. We are working on a
>specific platform, and we prefer using a specific protocol.
>My question is related to checksum algoritms, having in mind that it
>must run in a microcontroller, so I was asking for the less computing
>consuming algorithm, but that keeps efficiency high.
Calculating checksums/CRC's doesn't take as much as you might
think. Checksums are as easy as adding each byte to a sum as you
send/receive it, possibly with some logic operation between each one
(such as ex-or with some constant). CRC's likewise take a few logic
operations, and if that's not fast enough they can be sped up using
one or more lookup tables. I've done this sort of thing on a Z8, but
it was a while back.
Look up xmodem/ymodem/zmodem on the Web, there's surely source code
floating around. This first ran on 2MHz processsors (though admittedly
connected to 300 to 1200 baud modems), I think the algoritms should be
fast enough for your app. Today's microcontrollers are faster than
yesterday's 8080's.
|
> protocols.