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.

TMS3705A CRC Calculation



Hello, I'm implementing a Tag Reader with the IC TMS3705A and it's been working well so far. However, I need to calculate the CRC of the data I read, and the datasheet of this IC does not state what kind of CRC must be used. I've been using CRC16CCITT (as it says in these slides), though the result I get does not match the CRC I receive. I would like to know for certain what kind of CRC algorithm must be used to calculate the CRC.


Your help is gratefully received.

Regards

Jean Herrera.

  • Jean -
    For R/O tags, it is reverse CRC16, with start value of 0x0000. I realize i left the word 'reverse' out of the slides and don't forget to only do CRC on tag data, not the start and stop bytes.

    RE:What kind of algorithm?....its CRC16 and the polynominal (which is a standard) is in the slides - which tag part number are you using?
  • Hi Josh, thanks for the quick response. I'm using this tag: R-20479 (Photo)

    And this is the data I get when reading the tag (I have two of them): 

    Tag 1: 0x81 0xBF 0x0E 0xBC 0xF5 0xFF 0xFF 0xFF 0xFF 0x8E 0xD0 0x81

    Tag 2: 0x81 0xAB 0x0D 0xBC 0xF5 0xFF 0xFF 0xFF 0xFF 0x46 0x35 0x81

  • you are inverting the bits as they are coming in - first clue is you have 0x81 at front and rear of the string

    check it out: 

    top row is what you think is valid

    second row is the conversion to binary

    third row is correction of the binary (since this is actually how the data is coming in) 

    last row is the conversion to hex, showing start and stop bytes are correct and also the CRC, which is correct for the string

    hex 0x81 0xBF 0x0E 0xBC 0xF5 0xFF 0xFF 0xFF 0xFF 0x8E 0xD0 0x81
    binary 10000001 10111111 00001110 10111100 11110101 11111111 11111111 11111111 11111111 10001110 11010000 10000001
                             
    actual binary 1111110 01000000 11110001 01000011 00001010 00000000 00000000 00000000 00000000 01110001 00101111 1111110
    actual hex 0x7E 0x40 0xF1 0x43 0x0A 0x00 0x00 0x00 0x00 0x71 0x2F 0x7E
    Start Byte LSByte of tag serial # MSByte of tag serial # CRC CRC Stop Byte
  • Indeed, that was the problem. I made the correction you pointed out and now my calculated CRC matches the one I read. Thank you very much Josh.