Each CAN message in CAN protocol has a unique hexadecimal Identifier called as CAN-ID or CAN Arbitration ID. A CAN-ID uniquely identifies a CAN message. There are two types of frames or CAN-IDs i.e. Standard CAN and Extended CAN frame. These two frame types are fundamental components of the CAN protocol, each designed with specific purposes and characteristics.
Table of Contents
Standard CAN frame format (11-bit CAN ID)
CAN 2.0 A Standard CAN frames, also known as 11-bit frames, are the most commonly used form of CAN communication. It is a 11-bit identifier value. It can contain up to 2^11 = 2048 unique CAN-IDs.
Example: 100 0100 0100 (binary 11 bits) i.e. 0x777 (hex).
Standard CAN frames are suitable for most automotive ECUs where the number of nodes on the network are limited, and message identifiers do not require extensive addressing space.
Here is the frame format of a Standard CAN frame:
There are 7 fields in a CAN frame. They are listed below:
1. Start of frame (SOF)
It is 1 bit long which is a dominant (0) bit.
2. Arbitration field (ARB)
It is 12 bits long. It consists of:
- A 11 bits long CAN Identifier
- Remote Transmission Request (RTR) of 1 bit long. If RTR is a dominant (0) bit then it’s a Data frame. And if its a recessive (1) bit then its a remote frame.
3. Control field (CTRL)
It consists of 6 bits.
- IDE (Identifier Extension): 1 bit long. If IDE is dominant then its a standard frame (11 bit identifier) and if it is recessive then its a Extended frame (29 bit identifier).
- R0: 1 bit long. It is reserved for future use. It must be a dominant (0) bit.
- DLC (Data Length Code): 4 bits. It determines the length of the data to be transmitted i.e. 0 – 8 bytes in a CAN frame.
4. Data field (DATA)
This field contains the actual data transmitted by the CAN frame. It can be of 0 – 8 bytes in length.
5. Cyclic Redundancy Check field (CRC)
This field is 16 bits long. It contains:
- CRC field: 15 bits
- CRC Delimiter: 1 bit. It is a recessive bit.
6. Acknowledgement field (ACK)
2 bits long.
- ACK Slot: 1 bit long. Sender sends ACK slot as recessive. After successful reception of the message, the receiver overwrites it as a dominant bit.
- ACK Delimiter – It is a recessive bit.
7. End of frame (EOF)
It is of 7 bits length and all are recessive (1111111). It marks the end of a CAN frame.
Interframe Space (IFC)
It represents the space between two frames, also referred to as the intermission and the bus idle time between Data or Remote Frames. It does not constitute part of the CAN frame and comprises three recessive bits (i.e. 111). If no further action follows the IFS, the bus remains in a recessive idle state, during which no node can initiate a message transmission. If a dominant bit is detected during the Interframe space, then an Overload Frame will be sent.
Extended CAN frame format (29-bit CAN ID)
Extended CAN 2.0 B has a 29-bit identifier which means that there are 2^29 = 536,870,912 unique CAN-IDs. With a longer 29-bit identifier field, Extended CAN frames support a significantly larger address space, accommodating up to or over 500 million unique message identifiers.
Example: 10101010111000111010101011101 (binary 29 bits) i.e., 0x155C755D (hex).
Like Standard frame, extended frame also contains 7 field. However, only ARB and CTRL fields are different in both.
1. Arbitration field (ARB)
It is 32 bits long. It consists of:
- 11 bits long CAN Identifier and it decides the message priority.
- SRR (Substitute Remote Request). It is 1 bit long and is always transmitted as a recessive (1) bit to ensure that in case of arbitration between a Standard and Extended Data Frame, the Standard Frame will always have the priority if both the messages have the same base (11 bit) identifier.
- IDE (Identifier Extension): It is 1 bit long. It is recessive (1) bit and indicates that its an Extended frame. In case of Standard frame, IDE is dominant (0) bit.
- 18 bits long CAN Identifier and it decides the message priority.
- Remote Transmission Request (RTR): It is 1 bit long and tells if its a data or remote frame. It is dominant (0) bit in case of a Data frame and recessive (1) bit for a remote frame.
2. Control field (CTRL)
It consists of 6 bits.
- R0: 1 bit long. It is reserved for future use and must be a dominant (0) bit.
- R1: 1 bit long. It is also reserved for future use and must be a dominant (0) bit.
- DLC (Data Length Code): It is 4 bits long and determines the length of the data to be transmitted i.e. 0 – 8 bytes in a CAN frame.
Standard CAN frame vs Extended CAN frame
Now lets compare 11-bit and 29-bit CAN identifier.
Standard CAN frame format (11-bit CAN ID) | Extended CAN frame format (29-bit CAN ID) |
---|---|
11 bit CAN-Identifier | 29 bit CAN-Identifier |
Arbitration field (ARB) is 12 bit long. | ARB field is 32 bit long. |
If IDE (Identifier Extension) is dominant (0) then its a standard 11-bit frame. Control field (CTRL) contains IDE. | If IDE is recessive (1) then its a Extended 29-bit frame. ARB field contains IDE (Identifier Extension). |
It does not contain SRR (Substitute Remote Request) bit. | It contains SRR bit and is always transmitted as a recessive (1) bit. |
CTRL field contains 1 reserve bit (r0). | CTRL field contains 2 reserve bits (r0 and r1). |
It can contain up to 2^11 = 2048 unique CAN-IDs. | Extended CAN frame can contain up to 2^29 = 536,870,912 unique CAN-IDs. |
Conclusion
Standard CAN and Extended CAN frames are integral components of the CAN in-vehicle network, offering distinct advantages and considerations for different applications. Standard CAN frames, with 11-bit identifiers, offer simplicity and compatibility, ideal for basic networks. Extended CAN frames, featuring 29-bit identifiers, provide vast address space, suitable for complex systems with numerous nodes. Choosing between them depends on network size, traffic, and scalability requirements for optimal CAN bus communication.