MC33771 CRC

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MC33771 CRC

Jump to solution
1,674 Views
huangziyi
Contributor II

Hi, I have a little question about the crc part of the MC33771's  responce ,its a simple question ,but i am a little confused.

hopefully you can  solve my confuseness.

As you can see the picture taken from datasheet page58,section 6.4.  as follow:

pastedImage_1.png

pastedImage_4.png

I don't know if my understanding is correct, this is my understanding :

         CRC of read response is only relevant of these data——that is, it is calculated by these data ——pastedImage_2.png

and CRC of write response is only relevant of these data ,that is,it is calculated by these data ——

pastedImage_3.png

is this understanding right?

and the crc of slave(33771)'s responce  has no relevance with the CRC of command——which send by the master, is this understanding right?

if so, if the master want to check if the write operation was OK( the write command send to slave),the master has to calculate the correct CRC using those data slave supposed to responce(show in the picture above),and then compare with the actual CRC in the slave's response, right?

but if the Master want to check if read opration is OK,because Master don't know the data of slave‘s  register,sure it don't know what data the slave suppose to responce, so it has to calculate CRC using the data which the slave send back in response, then compare it with the actual CRC  in slave's responce. right? 

1 Solution
1,317 Views
TomasVaverka
NXP TechSupport
NXP TechSupport

Hi Huang,

Please accept my apologies for the delay in answering your question, I had to ask our apps engineer for help, please find below his response.

The CRC is used to ensure consistency (during transmission) of each individual 40 bit message on the bus and is calculated for the bits[39..8].

  • If you transmit a message you have to calculate the CRC based on the data you sent and add that CRC to the message.
  • If you receive a message you have to calculate the CRC_calc of the received message bits[39..8] and compare it with the received CRC_rx bits[7..0]. The data is consistent if CRC_calc == CRC_rx. If not consistent the data has to be ignored!

There is no link between the CRC of one message to the CRC of another message! To ensure READ or WRITE commands you have to check the data inside the frame.

Best regards,

Tomas

View solution in original post

5 Replies
1,318 Views
TomasVaverka
NXP TechSupport
NXP TechSupport

Hi Huang,

Please accept my apologies for the delay in answering your question, I had to ask our apps engineer for help, please find below his response.

The CRC is used to ensure consistency (during transmission) of each individual 40 bit message on the bus and is calculated for the bits[39..8].

  • If you transmit a message you have to calculate the CRC based on the data you sent and add that CRC to the message.
  • If you receive a message you have to calculate the CRC_calc of the received message bits[39..8] and compare it with the received CRC_rx bits[7..0]. The data is consistent if CRC_calc == CRC_rx. If not consistent the data has to be ignored!

There is no link between the CRC of one message to the CRC of another message! To ensure READ or WRITE commands you have to check the data inside the frame.

Best regards,

Tomas

1,317 Views
huangziyi
Contributor II

HI Tomas:

I already solved this problem , its because I the reversed the order of the bytes I send.and I shouldn't send 0XFF either.

Best regards

Huangziyi

0 Kudos
1,317 Views
huangziyi
Contributor II

Hi Tomas:

Thanks for your reply very much! it solved problem solved perfectly. I'm sorry to bother you another thing, that is ,when I read the driver code of " MC33771"——offered by you in the NXP community. I think I need to learn the detail thing about the MCU MKL25Z4, I searched the internet for the MKL25Z4‘s datasheet ——which used in software development, but I can't find one, if you have MKL25Z4‘s datasheet . Appreciate it very much if you can send me one.

Best regards

Huang ziyi

0 Kudos
1,317 Views
TomasVaverka
NXP TechSupport
NXP TechSupport
0 Kudos
1,317 Views
huangziyi
Contributor II

Hi Tomas:

               Thank you very much ,you solved my problem perfectly!

Best regards,

huang ziyi

0 Kudos