Hello Treitmey,

One way to perform crude (but effective) error checking is to XOR every character you send out the serial port with the character that was sent before it and store each calculation in a checkbyte (this is not technically a checksum).

Immediately after you send out your last character you send out the checkbyte.

At the receiving end the process is repeated. As each character comes in it is XOR'd with the character that came before it. Each calculation is stored in another checkbyte variable.

The last character that is received must be the transmitted checkbyte.

If the transmitted checkbyte agrees with the calculated checkbyte at the reciever then the message must be clean. If they don't agree then something must have went wrong during transmission.

If something went wrong then the receiver must tell the transmitter that it has to resend it's data.

It's not a bad idea to frame your packets with start and end characters. Make sure that there is no way that these characters could appear in the actual data.

An example of this would be to send the data with a "(" at the start and a ")" at the end.

Also, make your packets as short as is practical. Using long packets in a noisy environment makes for much slower communication, even at higher baud rates. This is because data corruption isn't detected until the packet has been completely sent. If it's corrupt then all that time has been wasted.

Hope this helps you out.

picnaut