Hi,
Currently, I have a problem with the on-chip CRC module of MSP430F5438. After shifting data into CRC data in register CRCDI, I am not able to obtain the correct result from the result register CRCINIRES.
My testing codes are listed below, and in my codes, I would like to use the CRC module to generate the checksum of a string "12".
(1) Testing code 1
CRCINIRES = 0xFFFF; // Initialize CRC module
CRCDI = 0x31; // Put '1' into the data in register
CRCDI = 0x32; // Put '2' into the data in register
The result from CRCINIRES register is equal to 0x5e6b.
(2) Testing code 2
CRCINIRES = 0xFFFF; // Initialize CRC module
CRCDI = 0x3132; // Put '1' and '2' into the data in register
The result from CRCINIRES register is equal to 0x05aa.
(3) Testing code 3
CRCINIRES = 0xFFFF; // Initialize CRC module
CRCDI = 0x3231; // Put '1' and '2' into the data in register
The result from CRCINIRES register is equal to 0xcab2.
None of above results is equal to the checksum calculated by a CRC 16 CCITT calculator, which I downloaded from a website. The checksum of string "12" from that calculator is 0x3DBA.
So, I think I made some mistakes about the sequence of putting data into the data in register.
Any help will be appreciated!
Thanks!
Liu