CRC Compenent

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
kep_284046
Level 2
Level 2
First like given

 hi,

   

I have CY8CKIT-042 kit. I want to use crc component (MODBUS RTU). the CRC calculation does not match the software calculating. I didn't find mistake of crc settings. 

I put attach the project copy.

Please help me! Thank you.

0 Likes
11 Replies
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked
        Try to use ms internet explorer to upload a project archive, chrome doesn't work...   
   
Bob   
0 Likes
kep_284046
Level 2
Level 2
First like given

 File

0 Likes
kep_284046
Level 2
Level 2
First like given
        I am sorry !   
0 Likes
lock attach
Attachments are accessible only for community members.
kep_284046
Level 2
Level 2
First like given
        I sent the file with IE, but does not seem. sending back!   
0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

When I'm looking right, the polynomial you have defined in the COMPONENT (0xc002) doesn't match with the one used in the code (0xA001). (Even when accounting for the bit-shift). Maybe you can verify the calculation with an online-CRC16-calculator?

0 Likes
kep_284046
Level 2
Level 2
First like given

 I tried it with a polynomial function of A001, but the result still does not match crc_calculator function.

   

I've tested the following site,

   

Site:http://www.lammertbies.nl/comm/info/crc-calculation.html

   

Still could not do it. if you help, i would be glad.

0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

Did you change the hardware to use the A001 polynomial? I think this is still different from the software, since your code does the XOR after the shift, and not before.

   

And which values did you compare with the online calculator? (and did those results match with the other one of yours)?

   

Btw: there is a really large list of CRC implementations: http://reveng.sourceforge.net/crc-catalogue/16.htm#crc.cat-bits.16

0 Likes
kep_284046
Level 2
Level 2
First like given

 Yes I changed the CRC polynomial A001. I want to use Modbus RTU. I want to MODBUS calculation that the calculation method of the site. What should I change CRC Compenent.

0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

The CRC component reads its data MSB first (according to page 14 in its data sheet). But you configured the SPI feeding it to LSB first...

0 Likes
kep_284046
Level 2
Level 2
First like given

 My english is not very good. I can not exactly explain the some of things. So sorry

   

I tried spi(LSB) or spi-(MSB) and i changed polynomial value and seed value of CRC polynom.

   

Thank you very much for your help!

0 Likes
lock attach
Attachments are accessible only for community members.
JaVa_282241
Level 2
Level 2
10 replies posted 5 questions asked 5 replies posted

Hello,

Did you successfully test the CRC component for Modbus CRC16 configuration?

I am testing the component with CRC polynom = 0xA001 and seed value = 0xFFFF, but CRC output does not meet with expected result.

Coud you please give me advice how to right configure CRC component?

My testing confiration you could find in attachment.

Thank you.

0 Likes