Interesting methof of doing CRC, but completely unrelated to the original question.
Interesting methof of doing CRC, but completely unrelated to the original question.
Take the ASCII value, subtract 0x30, if results is >9 then subtract 0x07. Value should then be in hex. If you want to bounds check then test result to make sure it is >= 0 and < 0x10. Then take the first packet hex value and leftshift by 4 and then add to hex value of second packet. Bitwise AND your calculated checksum with 0xFF and compare with the transmitted checksum.
Tim Barr
hi wasilus, tanks for you answer, these are examples used to calculate CRC16.
try this:
1.- $50 + $31 + $32 + $33 + $34 = $11A
2.- $11A / $100 = $1
3.- the carry = A
4.- Your checksum = 1A
Bookmarks