There are many variations of CRC16.
Along with the different polynomial ... Some need a starting value in the CRC variable, some need a final XOR of the CRC result with another value, some reverse the bit order of the data, and some use combinations of those methods.
The variation you are looking for is called CRC16_CCITT_TRUE or CRC16_KERMIT, which reverses the bit order.
For this type, the CRC16: code is the same.
But when you are feeding it data, reverse the order of each byte.
Then reverse the order of the final result.
Code:
ARRAYWRITE MyArray,[$F2,$AA,$4C,$D4,$60,$F6,$00,$80] ; Your Data
CRC = 0
FOR X = 0 TO 7
CRC_IN = MyArray(X) REV 8
GOSUB CRC16
NEXT X
CRC = CRC REV 16
The above gives the result ... $E23E
Bookmarks