Sending CAN Messages





Basic Principle of CAN Messaging:

Can basically work on the principle of "broadcast communication mechanism ", which is based on message-oriented transmission protocol.
Every message has a message identifier, which is unique within the whole CAN network. This identifier defines the message content and
the priority of the message.

A CAN message which is transmitted with the higher priority will get the arbitration, and the node which is transmitting the lower priority
message at the same time will get this information and will stop its transmission and wait till further notification.If one transmits the
"Dominant " bit and another node transmits the "Recessive " bit then the node with the dominant bit will get the priority, it's simply like a
logical AND condition between the two.

Now we are left with one important question that is how does a node decide on which message it should act on, and which message it
should ignore? The answer to this is the filter register. Every node in the CAN network contains a filter register. The main purpose of this
register is to compare the identifier field of the incoming messages and to decide if the message is of its important or not. The node will
take further action if it finds the message is relevant else it will ignore it.



Message Sending Logic:

Process of message sending by a CAN node is diagrammatically explained as below:
 page1

The complete process of message sending comprises three steps as mentioned above.

The first step is performed by the register which is contained within the microcontrollers. These registers are responsible for handling the
Identifier and Data bits which are the main components of a CAN message.

The next step is handled by the CAN Protocol Engine, which is an integral part of the CAN controller hardware. It will perform the functions
like CRC check, adding Start/Stop bits, message arbitration, etc.

The final step is handled by the CAN Transceiver. It is like a doorway through which the CAN node is connected to the CAN network and is
responsible for receiving and sending the message to the CAN network. The final prepared message is delivered to the CAN network by
this CAN transceiver.