2014-08-29 07:55 AM
Hello,
I'm having trouble calculating the CRC when sending and receiving bytes via i2c from the M24SR.I've tried following the example on page 29 from the application note on storing data in the NDEF memory(http://www.st.com/web/en/resource/technical/document/application_note/DM00105043.pdf
)When I follow the CRC algorithm from wikipedia (http://en.wikipedia.org/wiki/Cyclic_redundancy_check&sharpComputation
)The calculated CRC does not match the expected CRC from the example.Can someone please show step by step how to calculate the CRC?For instance, how would I calculate the CRC if I try to send the command to read the CC file length?Start bit 0xAC 0x02 0x00 0xB0 0x00 0x00 0x02 0x6B 0x7D Stop bitWhat is the polynomial divisor? Is it 0x8005? From section 5.5 in the datasheet (http://www.st.com/web/en/resource/technical/document/datasheet/DM00097458.pdf
), what does it mean that ''The initial register content shall be 0x6363 and the register content shall not be inverted after calculation''?Thanks for any help,Jon #i2c #m24sr-crc-calculation #crc #m24srSolved! Go to Solution.
2014-09-08 03:00 AM
Hi,
You can find a working solution on page 20:exclude the I2C address for the data to generate the CRCAdd the two CRC bytes at the end.First CRC lower byte followed by the CRC higher byte.with kind regards,Ben Schueler2014-09-08 03:00 AM
Hi,
You can find a working solution on page 20:exclude the I2C address for the data to generate the CRCAdd the two CRC bytes at the end.First CRC lower byte followed by the CRC higher byte.with kind regards,Ben Schueler2014-09-29 07:29 AM
Hi Ben,
Thank you for the suggestion, the sample code has helped me solve my issue.-Jon