Calculating 8 bit checksum from a series of bytes?
Posted: Mon Nov 23, 2020 12:48 am
I am doing some serial communication and need to calculate a 8 bit (one byte) checksum by adding up a series of 10 bytes.
I have been able to do it but when the checksum value goes over 255 is keeps counting up and ends up in a 16 bit value.
I need the 8 bit value to roll over from FF and keep the checksum result in a 8 bit value that just keeps rolling over to 00 when he count reaches FF.
I there a simple way to do this?
I have been able to do it but when the checksum value goes over 255 is keeps counting up and ends up in a 16 bit value.
I need the 8 bit value to roll over from FF and keep the checksum result in a 8 bit value that just keeps rolling over to 00 when he count reaches FF.
I there a simple way to do this?