0
\$\begingroup\$

AS per CAN communication protocol we have 15 bit of CRC field.

Who is responsible for inserting the CRC field into CAN transmitting messages and validating the Receiving messages using checksum?

Either it will be a Hardware part of CAN controller in the Microcontroller or any CAN transceiver(such as TJA1051)? if it's microcontroller then it's HW part or do we need to write software logic to handle this ?

enter image description here

\$\endgroup\$
3
  • \$\begingroup\$ The microcontroller. The tranceivers are pretty dumb and only responsible for translating the signals from the MCU to the CAN bus and vice versa. \$\endgroup\$ Commented Jan 14, 2022 at 16:43
  • 1
    \$\begingroup\$ The THA1051 has a good datasheet. Latest the block diagram in that answers your question! \$\endgroup\$ Commented Jan 14, 2022 at 16:43
  • 1
    \$\begingroup\$ The other thing to consider - only the originating MCU really "knows" what message was intended, so letting another device to calculate the CRC of the message that could have been corrupted on the way to it is unwise. \$\endgroup\$ Commented Jan 14, 2022 at 16:45

1 Answer 1

4
\$\begingroup\$

The CAN controller hardware handles CRC and all other low-level error handling, including re-transmission, ACK, bit stuffing, error frames and so on. The only thing you need to do in software is to check for errors and if buffers are full etc.

CAN transceivers are "dumb" and only handle signal voltage levels.

\$\endgroup\$
3
  • \$\begingroup\$ Thanks for your answer. Is it possible realise the CRC calculation and validation using software without involving CAN controller. \$\endgroup\$ Commented Jan 17, 2022 at 7:08
  • 3
    \$\begingroup\$ @Photon001 Not really unless you decide to "bit bang" CAN manually, which is an incredibly bad idea. \$\endgroup\$ Commented Jan 17, 2022 at 7:13
  • \$\begingroup\$ @Photon001 If you are using a tranceiver, which is nothing more than a PHY, it means there must already be a CAN controller in your MCU, and it would be the assumption that it handles the CRC for you. Read the MCU datasheet how the CAN works in your MCU. \$\endgroup\$ Commented Jan 17, 2022 at 7:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.