The problem with simple XOR checksums is that if any bit(s) are bad in an even number of bytes, you don't detect the error. e.g. LSB error for two bytes is not detectable. 1 xor 1=0 but error of 0 xor 0is also 0. With sum you get 2 or 0, which is a clearly detectable difference. Even a true 'checksum' misses any case where any even number of bytes have the MSB errored. CRC is about the only way to reliably detect bit errors. Howard Winter wrote: > On Sat, 26 Jun 2004 17:50:44 +0200, Kyrre Aalerud wrote: > > > Is this better or wose than the sum method ? > > If I remember rightly (it's late so I can't think > clearly enough to check!) if the last byte transmitted > is the checksum, the result of a rolling XOR of > everything before, when you XOR it you will end up with > zero if all was sent correctly. So the receiver just > XORs everything it receives and the result should be > zero - easy! > > > Maby I can do both ? > > No need - it doesn't improve anything. XOR is much less robust than sum. See above comments. Computation overhead is the same. Robert -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.