Code:
CALC_Checksum1:
Checksum1 = 0
WORD_HOLD = 0
for i = 3 to MAX_LEN
Word_Hold = Word_Hold + tx_data1(i)
next
Checksum1 = WORD_HOLD.byte0 ^ $FF
RETURN
CALC_Checksum2:
Checksum2 = 0
for i = 3 to MAX_LEN
Checksum2 = Checksum2 + tx_data1(i)
next
Checksum2 = Checksum2 // 256
'Checksum2 = -Checksum2
RETURN
the above routines i pieced together from other posts here to genereate a checksum for transimitted data packets.
to validate on the received end, do i run the same routine and compare values to see if the checksums are equal?
Bookmarks