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!
Some time ago I used something similar to the page 32 in this link:
In this link you have also something which the authors claim to be tested with Code Composer Studio :)
Please click the Verify Answer button on a post if it answers your question! :)
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!
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>)
Thanks for the information! Do you have the actual link to those files?
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.
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!
All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.
TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs andembedded processors, along with software, tools and the industry’s largest sales/support staff.