This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

4-bit CRC generation using CRC module

Other Parts Discussed in Thread: TMS570LS0432, HALCOGEN

Hello,

I'm trying to implement 4-bit CRC now. But I realized that TMS570 CRC peripheral supports just 8, 16 and 32-bit CRC. Is there any method or already implemented code example for 4-bit CRC using the peripheral? Please refer the below.

Devices : TMS570LS0432 LaunchPad

Protocol : 32-bit SPI signal which includes 4-bit CRC at the end of the protocol (29bit data line + 4bit CRC)

HALCoGen 4.0.1

CCS 6.0.0

Regards,

Travis Hwang

  • Travis,

    The hardware CRC peripheral supports only a fixed 64b CRC polynomial.  The polynomial used is the ISO standardized CRC-64.  You can send different sizes of data to the module, but the CRC algorithm is fixed.

    Regards,

    Karl

  • Hi Travis,

      TMS570 CRC implements a 64-bit generator polynomial. It does not support 4-bit CRC input. Actually neither does the CRC module generate signature for an input data string which are  8, 16 or 32bits. When you write only 8 bits of data to the PSA_SIGREGL1 register what will happen is that the CRC module will pad the rest of 56 bits with zeros before calculation. It is as if the input data is still 64 bits but the value of the input data is 0x00000000_000000xx.  The CRC will behave to simulate shifting the input data serially for 64-bit. The resulting signature will be different than shifting in the input data serially for only 8 bits.

  • KGreb, Charles,

    Sorry for my mistake which was occurred from misunderstanding. Then, it may better for me to use my own code than using CRC peripheral of TMS570.

    Thank you for your response.

    Regards,

    Travis