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?
Calculating 8 bit checksum from a series of bytes?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Re: Calculating 8 bit checksum from a series of bytes?
Hi,
Can you (pseudo)
This will roll over, where 254 = 254, 255 = 0 and 256 = 1.
Craig
Can you (pseudo)
Code: Select all
put checkSumValue mod 255 into checkSumValue
Craig
Re: Calculating 8 bit checksum from a series of bytes?
Thanks it worked... had to set 255 to 256 in order the keep the correct count sequence.
tcbcats