Hello forum,
I have a 9600 8N1 communication going on between two MSP430FR5739s and would like to integrate a check for corrupted messages using the CRC module. Does anyone have some C code around or can point me to an example that implements it?
Thanks in advance!
Hi!
Some time ago I used something similar to the page 32 in this link:
http://www.metratec.com/fileadmin/docs/en/documentation/metraTec_MiFare_Protocol-Guide.pdf
In this link you have also something which the authors claim to be tested with Code Composer Studio :)
http://www.ccsinfo.com/forum/viewtopic.php?t=24977
Good luck!
Please click the Verify Answer button on a post if it answers your question! :)
Thanks Kazola!
Those are helpful linkns, however, I am not looking into writing the CRC check routine but in learning how to use the already present CRC module/registers of the MSP430FR5739. I think implementing the CRC code would be doing the same job twice.
Thanks again for you help though!
Andres
Have you seen the examples\devices\5xx_6xx\MSP430F563x, MSP430F663x Code Examples\C\msp430f66xx_crc16_01.c example in MSP430ware_1_20_01_08?
It compares the results of a software CRC against the CRC hardware module.
(While this example was written for a different device, it also works on a MSP430FR5739 - you just have to change the #include<msp430f6638.h> to #include <msp430.h>)
Hi Chester,
Thanks for the information! Do you have the actual link to those files?
Cheers!
If you look at the device family user guide http://www.ti.com/lit/ug/slau272a/slau272a.pdf it appears the CRC unit is just a collection of registers to read and write data.
// initializes CRC with seed, depends on CRC version CRCINIRES = seed; // write each word to input register for(i = 0; i < len; ++i) CRCDI = data[i]; // reads CRC result int crcResult = CRCINIRES;
I don't have the particular device so couldn't test it, but that should give you an idea for how to use the CRC unit.
Tony
Andres MoraDo you have the actual link to those files?
If you have Code Composer Studio 5 installed, the examples will under a directory such as C:\ti\ccsv5\ccs_base\msp430\msp430ware_1_20_00_16
Failing that, http://www.ti.com/tool/msp430ware contains a download link.
Thanks a lot TonyKao and Chester!
TonyKao that was what I was looking for and Chester, sorry I didn't understand before what you meant but yes, after looking at CSS I found the examples you mentioned.
Once again thanks a lot to the both of you!