EmbeddedRelated.com
Forums

CRC for RS232 communication, F149 and Excel-test

Started by timokirschke September 24, 2008
If speed really is that much of a problem and you're "fairly"
confident with your data, than why not just use the UART's parity
check and do a simple checksum on your buffer.

The UART parity check is "free" and will catch any single-bit error.

For the checksum, add up every byte (throw-out the overflow bits) as
you get them. The last byte of your message is your checksum. When
you add it to your accumulated sum, you should get a 0x00 if your data
is good. The checksum is pre-calculated by the sender for this to
work-out. This method will catch 255/256 single-bit errors on top of
those caught by the parity check.

Sounds pretty good to me!

Stuart

--- In m..., "timokirschke" wrote:
>
> --- In m..., "Ian Okey" wrote:
> Hello,
> >
> > Look at using the F5x devices (TI have just released them). They are
> > cheaper than the F2618 and F149 and have a hardware CRC generator.
You
> just
> > write the data to be CRC'd into the register and out comes the
result. I
> > use it for Flash checksumming - no problems at all.
> >
> > Ian
>
> interesting, I didn't get it from the last conference. It is definitely
> worth to think about.
> The F2618 'solution' is an intermediate workaround only. It does not
need
> any hardware modification, but allows lots of software improvements.
>
> Thanks also to Andreas (and Paul) for the additional algorithm,
> Timo
>

Beginning Microcontrollers with the MSP430

if you look at the samples directory within crossworks 1.4 there is a crc project, with a 16bit crc implementaion and how to use it.. even at 115k baud a non table driven alg should work fine..
I remember doing an implementation on an Atari 800 computer (1.79mhz 65c02) in the late 80s and I was runnng 57.6k with lots of time to spare for other tasks... The MSP should easily handle it..

--- On Thu, 9/25/08, timokirschke wrote:

From: timokirschke
Subject: [msp430] Re: CRC for RS232 communication, F149 and Excel-test
To: m...
Date: Thursday, September 25, 2008, 5:34 AM

--- In msp430@yahoogroups. com, "Ian Okey" wrote:
Hello,
>
> Look at using the F5x devices (TI have just released them). They are
> cheaper than the F2618 and F149 and have a hardware CRC generator. You
just
> write the data to be CRC'd into the register and out comes the result. I
> use it for Flash checksumming - no problems at all.
>
> Ian

interesting, I didn't get it from the last conference. It is definitely
worth to think about.
The F2618 'solution' is an intermediate workaround only. It does not need
any hardware modification, but allows lots of software improvements.

Thanks also to Andreas (and Paul) for the additional algorithm,
Timo