CAN bus

The CAN bus, short for Controller Area Network, is a serial bus system for communication between multiple control units. It is a fieldbus and was developed for applications where multiple participants exchange messages over a common line without each device needing to be wired individually to every other device.

What is the CAN bus?

CAN connects multiple equally-privileged participants in a shared communication network. Each participant can send and receive messages. The messages are not addressed to a specific device but are identified by an identifier. This identifier describes the content of the message and simultaneously determines its priority for accessing the bus.

The CAN bus was developed by Bosch in 1983 and introduced in 1986 together with Intel. An original purpose was the reduction of wiring harnesses in motor vehicles. CAN is standardized in ISO 11898-1. This standard describes the data link layer of the ISO/OSI model. Physical implementations are described in ISO 11898-2 for high-speed CAN and ISO 11898-3 for fault-tolerant variants, among others.

How does the CAN bus work?

The CAN bus operates on a multi-master principle. Several control units are connected to the same bus with equal rights. If the bus is free, a participant can begin transmission. If multiple participants access the bus simultaneously, bitwise arbitration determines which message is sent.

Arbitration uses dominant and recessive bits. A logical 0 is dominant, and a logical 1 is recessive. A dominant bit prevails over a recessive bit on the bus. While a participant is sending the identifier, they simultaneously read the bus state. If they send a recessive bit but read a dominant bit, they lose arbitration and terminate their transmission attempt. The message with the lower numerical identifier remains on the bus and is transmitted without damage.

This procedure is described as non-destructive arbitration. It prevents messages with higher priority from having to be restarted. However, a message that has already started is not interrupted. Therefore, the exact transmission time for higher priority messages cannot be arbitrarily set. It depends on whether another message is currently being transmitted.

Physical transmission

For High-Speed CAN, two twisted wires are typically used: CAN_HIGH and CAN_LOW. Signal transmission is differential. In the recessive idle state, both wires are at approximately 2.5 V with respect to ground, and the differential voltage is then about 0 V. In the dominant state, CAN_HIGH rises and CAN_LOW drops, creating a differential voltage.

Low-speed CAN operates with different voltage levels and can continue to function over a single wire to ground under certain conditions in the event of a line failure. This fallback mode is called limp-home mode. High-speed CAN and low-speed CAN differ in their physical layer and are not directly compatible.

A CAN network is typically configured as a bus line. Termination resistors are located at the ends of the lines. For high-speed CAN, termination resistors within the normative specifications are used; 120 Ohm at both ends of the bus line is common. Stub lines are only permitted to a limited extent because they influence the electrical behavior of the bus.

Messages, Identifiers, and Frames

CAN transmits data in messages called frames. A classic CAN data frame contains, among other things:

  • Start of Frame
  • Arbitration field with identifier
  • Control panel
  • Data field
  • Checksum
  • Confirmation field
  • End of Frame

In classic CAN, the data field can contain 0 to 8 bytes. The Data Length Code indicates how many bytes are transferred in the data field. Cyclic redundancy check is used for error detection.

CAN has different frame types. Data frames transport payload data. Remote frames request data. Error frames indicate detected transmission errors. Overload frames generate a pause between certain transmissions.

There are two identifier formats. The Base Frame Format uses an 11-bit identifier. The Extended Frame Format uses a 29-bit identifier. The identifier describes the message content, not the sender. A participant can receive or send messages with multiple identifiers. However, there should only be one sender for an identifier to ensure arbitration remains unambiguous.

Where is CAN used?

CAN is primarily used in systems where multiple control units exchange data cyclically or event-driven. A typical application area is Motor vehicle. There, control units for the engine, brakes, body functions, or convenience functions can communicate via CAN.

CAN is also used in commercial vehicles, mobile work machines, agricultural machinery, rail vehicles, ships, measuring systems, test benches, and industrial controls. Crucial for its use is that multiple participants exchange messages over a common bus, and prioritization is to be carried out via identifiers.

Properties of the CAN bus

CAN uses a shared bus line for multiple participants. This reduces the wiring effort compared to point-to-point connections between all devices. Connectivity between twisted pairs is achieved with a pair CAN Transceiver ensured, of which at least one is terminated.

Arbitration is done via the identifier. Messages with a lower identifier value take precedence over messages with a higher identifier value. Therefore, the identifier serves as both content labeling and prioritization.

The maximum data rate depends on the line length. For Highspeed CAN, up to 1 Mbit/s is mentioned, but only for short lines up to about 40 m. At lower data rates, longer lines are possible, such as 500 kbit/s up to about 100 m or 125 kbit/s up to about 500 m. The limit results from signal propagation times, transceiver delays, controller delays, oscillator tolerances, and the sampling time.

The number of participants depends on the transceivers used. 32, 64, or up to 110 participants per line are mentioned, with limitations also up to 128. Expansions can be made via repeaters or bridges.

CAN FD as an extension

CAN FD stands for CAN with Flexible Data-Rate. It expands on the classic CAN protocol without abandoning the fundamental principle of identifier-based arbitration. The main differences lie in the larger data field and the possible increase in bit rate during the data phase.

While classic CAN supports up to 8 bytes of payload data per frame, CAN FD can transmit up to 64 bytes of payload data. The arbitration phase continues to run at a bit rate that matches the bus design. After arbitration, the data phase can be transmitted at a higher bit rate using bit rate switching.

CAN-FD controllers can process classic CAN frames. However, classic CAN controllers cannot process CAN FD frames and generate error frames for unknown FD formats. Therefore, when using CAN FD frames, all relevant network participants must support CAN FD.

CAN FD does not support remote frames. Additionally, a CAN FD frame contains extra fields, for example, to indicate the FD format, bit rate switching, and the transmitting node's error status.

Demarcation from related terms

CAN denotes the communication protocol and bus access, including frame structure, identifiers, arbitration, and error handling. The CAN bus refers to the physical bus system connecting the participants.

High-speed CAN and low-speed CAN are physical implementations with different electrical characteristics. They are not interchangeable because levels, failure behavior, and physical requirements differ.

CAN FD is not a completely different bus family, but rather an extension of CAN. It primarily changes the payload length and the data phase. Compatibility must be considered at the entire network level, as classic CAN nodes cannot interpret FD frames.

An identifier is not a device address. It describes the content of a message. Multiple recipients can evaluate the same message if the identifier is meaningful to them.

Boundaries and typical misunderstandings

The bus does not guarantee that every message will be sent at a precisely specified time. Prioritization only determines which message takes precedence in case of simultaneous access. An ongoing transmission will not be interrupted.

A low identifier number means high priority. This can lead to misinterpretations because the numerical value and priority must be read in opposite directions.

If a participant continuously sends high-priority messages, lower-priority messages may repeatedly lose arbitration. This behavior can block the bus. The source refers to this as a "babbling idiot." For a corresponding malfunction, additional hardware mechanisms like bus guardians may be required.

The maximum data rate cannot be set independently of the line length. The higher the bit rate, the shorter the available bit time. With longer lines, signal propagation delays increase, which must be taken into account during arbitration and acknowledgment.

CAN FD increases the possible payload per frame but requires appropriate controllers in all affected participants for FD frames. A mixed network of classic CAN nodes and CAN FD frames is not functional without proper planning.

Zurück zum Glossar