logo elektroda
logo elektroda
X
logo elektroda

How Does CAN Bus Work Explained: CAN H, CAN L, Arbitration, Frames

User question

how does can bus work explained

Artificial Intelligence Response

Direct answer to the question

CAN bus works by letting many electronic devices share the same two-wire communication line and send short messages in a controlled way.

Key points:

  • It uses two wires: CAN_H and CAN_L
  • It is a broadcast, message-based bus: every node sees every message
  • Messages are identified by an ID, not by a device address
  • If two devices transmit at the same time, the message with the higher priority wins automatically
  • It is very reliable because it includes error checking, acknowledgment, and fault isolation

In simple terms: CAN bus is like a group conversation where everyone listens, only important messages speak first, and everyone checks whether the message was heard correctly.


Detailed problem analysis

This is the main idea behind CAN:

A CAN network connects multiple devices, often called nodes. A node can be:

  • an ECU in a car
  • a motor controller
  • a sensor module
  • a battery management unit
  • an industrial controller

Each node has, in practice:

  • a microcontroller / CPU
  • a CAN controller
  • a CAN transceiver

The controller formats the CAN message, and the transceiver converts it into electrical signals on the bus.


1. Physical layer: how the signal travels

CAN usually uses a twisted pair of wires:

  • CAN_H
  • CAN_L

It uses differential signaling, which means the receiver looks at the voltage difference between the two wires, not just one wire relative to ground.

Why this matters:

  • noise from motors, relays, ignition systems, or inverters tends to affect both wires similarly
  • because the receiver measures the difference, a lot of that noise cancels out
  • this makes CAN very robust in electrically noisy environments
Two bus states

CAN transmits bits using two logical states:

  • Dominant bit = logic 0
  • Recessive bit = logic 1

For a typical high-speed CAN bus:

  • Recessive: both wires sit near about 2.5 V, so differential voltage is near 0 V
  • Dominant: CAN_H rises and CAN_L falls, producing a differential voltage of roughly 2 V

A practical simplification is:

State Logical value Bus behavior
Dominant 0 bus is actively driven
Recessive 1 bus is released / idle state

The most important rule is:

Dominant always overrides recessive.

That single rule is what makes CAN arbitration work.


2. Topology: how devices are wired

High-speed CAN should be wired as a linear bus, not a star.

Good practice:

  • one backbone cable
  • nodes connected with short stubs
  • 120 Ω termination resistor at each physical end

So if you measure resistance between CAN_H and CAN_L with power off, you usually expect about:

\[ 120 \, \Omega \parallel 120 \, \Omega = 60 \, \Omega \]

That ~60 Ω measurement is one of the first checks during troubleshooting.

Why termination is needed:

  • prevents reflections
  • preserves signal shape
  • supports higher bit rates

If termination is wrong, you often get:

  • ringing
  • corrupted frames
  • intermittent communication
  • higher error counts

3. CAN is message-based, not address-based

This is one of the most misunderstood points.

A CAN frame does not normally say “send this to node 7.”

Instead, it says something like:

  • “engine speed data”
  • “battery voltage”
  • “wheel speed”
  • “brake command”

So the identifier tells nodes what the message means and what priority it has.

Then each node decides:

  • accept it
  • ignore it
  • act on it

Example:

  • Engine ECU sends a frame with ID corresponding to RPM
  • Instrument cluster listens and displays RPM
  • Transmission controller listens and uses RPM for shifting
  • A logger may also record it

One transmitted frame can serve many receivers at once.


4. What happens when a node sends data

A simplified sequence is:

  1. A node waits until the bus is idle
  2. It starts sending a frame
  3. All other nodes listen
  4. Each receiver checks whether the frame is valid
  5. If at least one receiver got it correctly, the message is acknowledged
  6. If an error is detected, the frame is rejected and retransmitted

This makes CAN efficient and reliable.


5. Frame structure: what is inside a CAN message

A classical CAN data frame contains fields like these:

Field Purpose
SOF Start of frame
Identifier Message meaning + priority
RTR / control bits Frame type and format control
DLC Number of data bytes
Data Payload
CRC Error detection
ACK Receiver acknowledgment
EOF End of frame

For Classic CAN:

  • payload is 0 to 8 bytes

For CAN FD:

  • payload can be up to 64 bytes
  • data phase can run faster than arbitration phase

That distinction matters because many beginner explanations mix Classic CAN and CAN FD.


6. Arbitration: how CAN avoids collisions

This is the most elegant part of CAN.

Because multiple nodes may start transmitting at the same time, CAN uses bitwise arbitration.

Principle
  • each transmitter sends its identifier bit by bit
  • at the same time, it reads the actual bus state
  • if it sends a recessive 1 but sees a dominant 0, it knows another node has higher priority
  • it immediately stops transmitting
  • the winning node continues without corruption

This is called non-destructive arbitration.

Why lower ID means higher priority

Because:

  • dominant = 0
  • recessive = 1
  • dominant overrides recessive

So a message with more leading zeros wins sooner.

Example

Suppose:

  • Node A sends ID 0x120
  • Node B sends ID 0x080

They start together.

At the first bit position where they differ:

  • A sends 1
  • B sends 0

The bus becomes 0, because dominant wins.

Node A reads back 0 while trying to send 1, so it stops. Node B continues.

So lower numerical identifier = higher priority.

That is how CAN guarantees urgent traffic gets through first.


7. Acknowledgment: how the sender knows someone received it

In the ACK slot:

  • the sender transmits a recessive bit
  • any receiver that got the frame correctly drives the bus dominant

So:

  • if the sender sees dominant in ACK, at least one receiver accepted the frame
  • if not, the sender knows the frame was not acknowledged and may retry

Important nuance:

ACK means someone received the frame electrically and protocol-wise. It does not guarantee the application software used the data meaningfully.


8. Error detection: why CAN is reliable

CAN has strong built-in error detection. Main methods include:

a) CRC check

The receiver recalculates a checksum and compares it to the transmitted CRC.

b) Bit monitoring

A transmitter checks whether the bit on the bus matches what it intended to send.

c) Bit stuffing

After five consecutive identical bits, a transmitter inserts one opposite-polarity bit. This helps synchronization and allows receivers to detect violations.

d) Frame format checking

Certain fields must have fixed forms. If they do not, it is a frame/form error.

e) ACK checking

If no node acknowledges, the transmitter detects that too.

If an error is found:

  • an error frame is sent
  • the bad message is discarded
  • retransmission occurs automatically

9. Fault confinement: how a broken node is prevented from killing the network

CAN does not just detect errors; it also tracks which node is causing trouble.

Each node maintains error counters.

A node can move through states such as:

  • Error Active
  • Error Passive
  • Bus Off

If a node keeps causing errors, it can eventually go Bus Off, meaning it stops participating on the bus. This protects the rest of the network.

That is one reason CAN became so successful in automotive and industrial systems.


10. Why CAN is efficient

Without CAN, a vehicle or machine might need many direct point-to-point wires between modules.

With CAN:

  • all modules share the same bus
  • one message can be used by multiple receivers
  • wiring is reduced
  • weight is reduced
  • diagnostics become easier
  • expansion is easier

This is especially valuable in:

  • automotive systems
  • construction machines
  • robots
  • medical devices
  • battery systems
  • industrial automation

11. Important correction to common misunderstandings

A few common simplifications are not quite correct:

  • The CAN identifier is not usually a destination address.
    It mainly defines message content and priority.

  • Classic CAN payload is not 64 bytes.
    That is CAN FD. Classic CAN is 0 to 8 bytes.

  • Typical high-speed CAN dominant voltages are not simply 5 V and 0 V.
    In many systems they are closer to roughly 3.5 V and 1.5 V, though exact values depend on the transceiver.

  • A DBC file is not needed for CAN to work.
    It is only needed if a human or software tool wants to decode raw frame data into engineering values.

These distinctions matter in real engineering work.


Current information and trends

Even though the basic CAN concept is mature, the ecosystem has evolved.

Major current directions

  • Classic CAN is still widely used for simple, reliable control traffic
  • CAN FD is increasingly used when larger payloads or higher throughput are needed
  • Many modern vehicles and machines use a mix of networks, for example:
    • CAN for robust control communication
    • LIN for very low-cost local devices
    • Ethernet for cameras, ADAS, or high-bandwidth domains
  • Higher-layer protocols remain very important, such as:
    • CANopen in industrial control
    • J1939 in heavy vehicles and mobile machinery
    • OBD-related CAN communication in diagnostics

General trend:

CAN remains the preferred choice when the system needs low cost, high robustness, deterministic priority behavior, and moderate bandwidth.


Supporting explanations and details

Simple analogy

Think of CAN bus like a meeting room with many engineers:

  • everyone can hear everything
  • each speaker announces the topic first
  • if two people start at once, the person with the more urgent topic continues
  • the other person immediately stops and waits
  • if someone hears a mistake, they interrupt and ask for a repeat

That is essentially CAN.


Practical automotive example

Suppose these modules share one CAN bus:

  • Engine ECU
  • ABS controller
  • Dashboard
  • Transmission controller

What happens:

  • Engine ECU broadcasts RPM
  • Dashboard uses it for tachometer display
  • Transmission controller uses it for shift logic
  • ABS sends wheel speed
  • Stability controller uses wheel speed and steering angle
  • If ABS and dashboard both try to transmit at once, the frame with the higher priority ID wins

No central master is required.


Why twisted pair matters

Twisting the pair helps ensure both wires pick up similar interference. Because CAN receivers look at the difference between wires, this improves noise immunity.


Why stub length matters

If branch wires from the main bus are too long:

  • reflections increase
  • edges degrade
  • timing margin decreases

At high speed, long stubs can make a network appear randomly unreliable.


Ethical and legal aspects

For CAN, these issues are often more important than beginners expect.

Safety

In vehicles, industrial machines, and medical systems, CAN traffic may affect:

  • braking
  • steering
  • motor control
  • battery protection
  • operator safety

A misunderstanding of CAN timing, fault handling, or message priority can create real hazards.

Security

CAN was not originally designed with strong built-in cybersecurity features. If an attacker gains access to the bus, they may be able to:

  • inject false frames
  • replay messages
  • disrupt operation
  • spoof nodes

So modern designs often add:

  • gateway isolation
  • secure diagnostics
  • message authentication at higher layers
  • network segmentation

Legal / standards context

Relevant standards and practices often include:

  • ISO 11898 for CAN-related physical/data link definitions
  • ISO 26262 for automotive functional safety
  • industrial safety frameworks depending on the application domain

Also, unauthorized access to a vehicle or machine CAN bus can violate:

  • safety rules
  • warranty conditions
  • cybersecurity policies
  • local law

So CAN analysis should be done only on systems you are authorized to work on.


Practical guidelines

If you are designing or troubleshooting CAN, these are the best practices.

Wiring best practices

  • use twisted pair
  • place 120 Ω termination at both ends only
  • keep stub lengths short
  • avoid star wiring for high-speed CAN unless the design explicitly supports it
  • maintain a proper common reference/ground strategy
  • use shielding only when the environment requires it; poor shielding practices can create new problems

Bit rate vs cable length

Higher bit rate means shorter allowable network length.

Typical engineering rule:

  • faster bus = tighter timing = shorter cable and shorter stubs

Always verify this against your transceiver and network design constraints.

Layout and hardware

  • place transceiver close to connector if possible
  • protect against ESD and transients
  • consider common-mode chokes only when justified
  • use galvanic isolation where ground potential differences or safety require it

Debugging sequence

  1. Power off: measure CAN_H to CAN_L resistance

    • expected about 60 Ω
  2. Power on: check idle/common-mode voltages

  3. Oscilloscope: inspect differential waveform

    • look for ringing, poor edges, asymmetry
  4. Protocol analyzer: inspect IDs, error frames, bus load, retries

Software/application best practices

  • assign priorities carefully
  • keep high-priority messages short and periodic
  • avoid flooding the bus with low-value traffic
  • define message timing and ownership clearly
  • use a documented database for signal definitions

Possible disclaimers or additional notes

  • The explanation above mainly describes high-speed CAN.
  • Low-speed / fault-tolerant CAN behaves differently at the physical layer.
  • CAN FD differs from Classic CAN in payload size and speed behavior.
  • Higher-layer meaning is not defined by CAN itself; that comes from application protocols or system design documents.
  • Some older features such as remote frames exist in the standard but are less common in many modern designs.

If you are working with a specific system, details such as:

  • transceiver type
  • bus speed
  • cable length
  • grounding
  • protocol on top of CAN

can change the correct engineering answer.


Suggestions for further research

If you want to go deeper, the next useful topics are:

  • Classic CAN vs CAN FD
  • How arbitration timing limits bus length
  • Bit timing: sample point, propagation segment, phase segments
  • DBC files and signal decoding
  • CANopen, J1939, and UDS diagnostics
  • Oscilloscope-based CAN troubleshooting
  • Bus load calculation and message scheduling
  • CAN security and gateway design

A very good next step is to learn how to read an actual CAN frame and decode:

  • ID
  • DLC
  • payload bytes
  • engineering values

That turns the theory into something practical immediately.


Brief summary

CAN bus is a robust two-wire communication system where many devices share one network.

The essential ideas are:

  • all nodes listen to all messages
  • messages carry IDs, not destination addresses
  • dominant bits override recessive bits
  • lower ID wins arbitration
  • receivers acknowledge valid frames
  • errors are detected and faulty nodes can isolate themselves

That combination gives CAN its reputation for being:

  • simple
  • reliable
  • noise-resistant
  • well suited to real-time embedded control

If you want, I can also explain CAN bus in one of these simpler formats next:

  1. “like I’m a beginner”
  2. with a diagram
  3. with a car example
  4. with frame-by-frame bit explanation

Ask additional question

Wait...(2min)
Disclaimer: The responses provided by artificial intelligence (language model) may be inaccurate and misleading. Elektroda is not responsible for the accuracy, reliability, or completeness of the presented information. All responses should be verified by the user.