Tool/software: Code Composer Studio
I've been reading through the documentation in the user guide for the MSP430FR58xx family regarding the CRC-16 module.
I use two variables in the test code. One with a seed, and one with the test data, that I want the CRC of. I have also defined the "baseAddress", which is used with the crc-related functions. The code looks something like this (it's in C++)
Testcode:
"
uint16_t baseAddress = 0x0150;
uint16_t seed = 0;
uint16_t data = 123;
CRC_setSeed(baseAddress, seed); //Initializing CRC module
CRC_set16BitData(baseAddress, data); //Sending input data
CRC_set16BitData(baseAddress, seed); //sending 16 0's to shift out the databits
uint16_t result = CRC_getResult(baseAddress); //Storing the result in variable
"
I used uint16_t sizes as that is what the functions take as arguments.
The above code gives the following result (in hex): 0A59
When I use the "bitsReversed" functions the result is (in hex): 563A
It seems to work in a very simple manner with the functions, but at this point, I recognize that I must be doing something wrong. I'm looking for anyone who can tell me what's wrong.
By the way: I tried all combinations of reverse byte input, reverse byte result and tried with and without sending the 16 0's. None of the combinations gave a result matching anything I can produce in the online tables. I used https://crccalc.com/ for checking results.
Thanks in advance.