| Introduction to Controller Area Network (CAN Bus) |
|
|
| Written by Parthiban Kesavan | |
|
Page 3 of 4 CAN Implementations: In CAN there are two main Hardware Implementations, they are Basic CAN and Full CAN. Basic CAN:
Basic CAN has only one Message buffer for Receive and Transmit messages. The received message is accepted or ignored after acceptance filtering. The decision to process a message or to ignore it is also achieved by acceptance filtering. This acceptance filtering of the node is done by software in Basic CAN. To reduce the software load at the nodes, there is a possibility to ignore some messages by ignoring specific identifiers. This is realized by bit mask for the message identifiers.
Full CAN:
In Full CAN, there are 8 to 16 memory buffers for every transmitted or received message. Here the acceptance filtering is done by hardware and not by the software. Every buffer can be configured to accept messages with specific ID’s.
Since the acceptance filtering is done by hardware, the software load is greatly reduced. With different buffers for different messages ensures more time for the processing of the received messages and the transmitted message can be handled according to the priority levels. Configuring each buffer for every message ensures also the data consistency in Full CAN. Message Frame Formats: CAN systems have four different types of frame formats Data Frame Error Frame Remote Frame Over load Frame.
Data frame: This is a common message frame used to transfer date over the network. Data frame consists of Arbitration field (ACK), Control field with control information, Data field and CRC field for error detection and the Acknowledgement field. The arbitration field contains the Message Identifier which is used to determine the priority of the message when two nodes compete to gain access of the bus. The arbitration field contains 11 bit Identifier for CAN 2.0A with RTR bit and 29 bit Identifier for CAN 2.0B with RTR bit. The RTR (Remote Transmission Request) bit is dominant for data frames. Next is the data field which holds 0 to 8 bytes of data and 16 bit CRC for error detection. Finally the ACK field, which is transmitted as recessive, is overwritten with a dominant bit by a receiver when acknowledged. The transmitter checks the ACK field to be dominant and transmits the message again on the bus if it is not.
The following are the fields in the CAN frame format. The format is as shown in figure.
![]() Message Format of CAN
tart of Frame (SOF): A dominant bit which indicates the start of the message frame. All the nodes in the network synchronises with this bit after being idle.
Identifier: The arbitration field consists of the 11 bit Identifier for the basic CAN message, which determines the priority of the message. Lower the value of this identifier, higher the priority of the message.
Remote transmission request (RTR): This RTR bit differentiates the frame between a data and request frame. It should be dominant for the Data frame and recessive for a Request frame.
Identifier Extension (IDE): A dominant IDE bit means CAN base format and a recessive IDE bit means extended CAN format.
r0: Reserved bit for future use
Data Length Code (DLC): Data Length Code indicates Length of the Data Bytes transmitted in the Data field. It is 4 bits long.
Data: Data field is the pay load of the message frame. Up to 64 bits of data can be transmitted.
CRC: 16 Bit CRC (15 bit CRC plus 1 bit de limiter) has checksum (no. of bytes transmitted) for error detection.
ACK field: Acknowledgement field is transmitted as recessive bit by the transmitter. If a receiver gets the frame without errors then this ACK field is overwritten by a dominant bit. If a receiving node detects an error on the frame then it ignores the frame and leaves this bit recessive. In this way data reliability is guaranteed by each node. ACK field consists of 2 bit acknowledgement field and 1 bit delimiter.
EOF: The End of frame field indicates the end of the CAN message. It is 7 Bits long and should be recessive to indicate the complete transmission of a error free message. If any of the ACK delimiter or EOF bits were transmitted dominantly then it indicates the start of an Error frame.
|




