I want to calculate the CRC-16/Xmodem from "0xDEADBEEF".
The result should be 0xC457 as shown on this ewbsite:
I found this library that should be able to calculate it:
But with the following code i always get the result 0x45BA instead of my expected 0xC457.
What i am doing wrong?
#include <FastCRC.h>
FastCRC16 CRC16;
uint8_t buf[8] = {'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F'};
void setup() {
delay(1500);
Serial.begin(115200);
Serial.println("CRC Example");
Serial.println();
Serial.print("XMODEM-CRC of \"");
for (unsigned int i = 0; i < sizeof(buf); i++) {
Serial.print((char) buf[i]);
}
Serial.print("\" is: 0x");
Serial.println( CRC16.xmodem(buf, sizeof(buf)), HEX );
}
void loop() {
}