Skip to main content

Someone wanted to learn this too, so Grasp built them a personal learning path.

You can keep exploring this one or create your own

CAN Bus Arbitration and Message Priority

Hello! Welcome to the fourth lesson in our module on CAN bus fundamentals.

In our previous lesson, we dissected the structure of Classical CAN and CAN FD frames. We identified the key fields, including the Arbitration Field, which contains the message identifier. We briefly mentioned that this identifier determines the message's priority, but we didn't explore how.

Today, we will dive deep into that "how." This lesson explains the CAN bus arbitration process, a core mechanism that ensures the most critical messages get bus access without delay. For you as a system tester and developer, understanding arbitration is essential for diagnosing bus traffic, verifying system behavior, and appreciating how a CAN network maintains determinism and reliability even when multiple ECUs try to "speak" at once.

The Foundation: Dominant vs. Recessive Bits

The entire arbitration process hinges on a simple electrical principle we touched on in the physical layer lesson: the concept of dominant and recessive bits.

  • A recessive bit (logic '1') is a passive state. It's like no one is talking.
  • A dominant bit (logic '0') is an active state that actively drives the bus voltage. It's like someone speaking up.

The critical rule is: If one node transmits a dominant bit at the same time another node transmits a recessive bit, the bus will be in the dominant state. The dominant bit always wins. This is often called "wired-AND" logic.

The image below perfectly illustrates this principle and the logic a CAN controller follows.

Bus Access in the CAN Network: Prioritization of CAN Messages
This image breaks down the "Wired-AND" logic of the CAN bus and the decision-making process ("Arbitration Logic") for a transmitting node. The priority scale at the bottom directly links lower identifier values to higher priority.

Take a moment to study the "Arbitration Logic" table. The key takeaway is the third row: If a node sends a recessive '1' but sees a dominant '0' on the bus, it immediately knows another node is transmitting a higher-priority message, so it stops sending and starts listening. This is the cornerstone of CAN arbitration.

Non-Destructive Bit-Wise Arbitration

When the bus is idle, any ECU can begin transmitting a message. In a busy automotive network, it's very common for two or more ECUs to try transmitting at the exact same time. This is where arbitration comes into play.

CAN uses a process called non-destructive bit-wise arbitration. Let's break that down:

  • Bit-wise: Nodes resolve the conflict bit by bit during the Arbitration Field of the frame.
  • Non-destructive: The message that wins arbitration continues transmitting without being corrupted or delayed. The losing messages simply back off and will try again later. No data is lost.

Here is how the process works:

  1. All nodes wanting to transmit wait for the bus to be idle (detected by the Inter-Frame Space).
  2. They all start transmitting their frame, beginning with the Start of Frame (SOF) bit.
  3. They then transmit their Identifier (part of the Arbitration Field), one bit at a time, from the Most Significant Bit (MSB) to the Least Significant Bit (LSB).
  4. Crucially, after transmitting each bit, every node monitors the bus.
  5. If a node transmits a recessive bit ('1') but detects a dominant bit ('0') on the bus, it realizes it has lost arbitration. It immediately stops transmitting and switches to receive mode.
  6. The node that successfully transmits its entire Identifier without being overwritten by a dominant bit wins arbitration. It continues to transmit the rest of its frame (Control Field, Data, CRC, etc.) as if nothing happened.

This elegant process ensures that only one message ever occupies the bus at a time, and priority is handled automatically and transparently by the CAN controllers.

Arbitration in Action: A Visual Guide

Reading about this process is one thing; seeing it happen is another. The following video provides a fantastic animation of three nodes competing for the bus. It clearly shows how the losing nodes drop out, leaving a single winner.

Controller Area Network (CAN) programming Tutorial 10: bit wise bus arbitration animation

The video 'Controller Area Network (CAN) programming Tutorial 10' from Fastbit Embedded Brain Academy provides a superb animation of the bit-wise arbitration process.

Watch the animation from 01:28 to 06:21. Pay close attention to the bus state at the bottom and observe the exact moment when Node 2 and then Node 1 lose arbitration because their recessive bits are overwritten by dominant bits from other nodes.

The Golden Rule: Lower ID = Higher Priority

As you saw in the animation, Node 3 won because its Identifier (0x659) was numerically lower than the identifiers of Node 1 (0x7A5) and Node 2 (0x6B2). This leads us to the single most important rule of CAN message prioritization:

The message with the numerically lowest arbitration ID has the highest priority.

Why? Because a lower binary number will have a dominant '0' at a more significant bit position compared to a higher binary number. The first node to transmit a '0' while other competitors transmit a '1' at the same bit position will win the arbitration for the bus.

The following article provides a concise textual explanation of this process.

101: Controller Area Network (CAN) standard - NXP Community

The NXP Community article '101: Controller Area Network (CAN) standard' offers a clear, written explanation of the arbitration process and its outcome.

Please read the section titled 'Priority Arbitration'. It provides an excellent summary of lossless bitwise arbitration and reinforces the rule that the lower binary identifier has the higher priority, complete with a simple example.

To further solidify your understanding, this timing diagram shows the same process with four nodes.

CAN Bus Arbitration Example
A timing diagram illustrating the bit-wise arbitration process among four nodes. You can see how nodes A, B, and D transmit recessive bits that are overwritten by Node C's dominant bits, causing them to lose arbitration and leaving Node C to complete its transmission.
Test your understanding!

An ECU in the braking system (Node A) needs to send a critical message with CAN ID 0x100. At the same time, an ECU in the infotainment system (Node B) tries to send a status update with CAN ID 0x3FF.

  1. Which node will win arbitration and successfully transmit its message?
  2. Explain why it wins, referencing the bit values of the identifiers. (Hint: 0x100 is 001 0000 0000 in binary, and 0x3FF is 011 1111 1111 in binary for an 11-bit ID).
Show answer
  1. Node A (the braking system) will win arbitration.
  2. Both nodes start transmitting their identifiers from the MSB.
    • Bit 10 (MSB): Both send '0'. They continue.
    • Bit 9: Node A sends '0', but Node B sends '1'.
    • On the bus, the '0' from Node A becomes the dominant state.
    • Node B, having sent a recessive '1' but seeing a dominant '0' on the bus, immediately realizes it has lost arbitration. It stops transmitting and becomes a receiver.
    • Node A continues its transmission without interruption. This demonstrates how lower ID values are used to give safety-critical functions priority.

Conclusion

In this lesson, we uncovered the elegant and robust mechanism of CAN bus arbitration. This process is fundamental to the protocol's success in the deterministic world of automotive electronics.

Key Takeaways:

  • CAN arbitration is a non-destructive, bit-wise process that resolves bus access conflicts.
  • The process is built on the principle that a dominant bit ('0') always overwrites a recessive bit ('1').
  • Transmitting nodes monitor the bus; if their recessive bit is overwritten, they lose arbitration and stop transmitting.
  • The ultimate rule of priority is simple: the message with the numerically lowest identifier wins arbitration. This allows system architects to assign low IDs to safety-critical messages, guaranteeing them priority access to the bus.

We have now established what the CAN Identifier is (from the previous lesson) and how it's used for arbitration (in this lesson). In our next session, we will expand on this by differentiating between Standard (11-bit) and Extended (29-bit) CAN identifiers, exploring why the extended format was needed and how it impacts the arbitration process.

Can't find a good explanation? Sign up and we'll make it for you

Sign up