Controller Area Network (CAN) Physical Layer
Author: Frank Wisner
Save this page as a PDF document
General description - CAN-BUS Physical layer
In the Open Systems Interconnection Model (OSI) model of computer networking, there are 7 layers in total. The physical layer (layer 1) is the first and lowest layer.
CAN bus uses this physical layer to transfer the raw data across the network of Electronic control units (ECUs).
But why is CAN protocol so commonly used in the automotive industry? Let’s find out.
What does differential signal mean?
The CAN protocol uses differential signalling - a two-wire (twisted-pair) communication line, which includes:
● CAN high (CAN_H)
● CAN low (CAN_L)
These 2 wires are in charge of transferring all data among the ECUs network by connecting all of them only using 1 pair of wires. That was, at least, the general idea when the CAN bus system was first applied in the automotive industry. However, as cars keep evolving, more ECUs are added to the system. Eventually, engineers had to split them into different CAN bus “branches.” These “branches” will communicate with each other via the “Gateway”. Besides, there are also direct communication lines among them. But we’ll get to that later.
Despite being split, each CAN bus branch still follow the general idea – all ECUs in their own system are connected using only 1 pair of wires.
Modern cars nowadays can have up to 80 ECUs, just imagine how messy and costly it is to connect these modules to each other using analog signal lines.
In theory, the CAN bus will make the wiring less complex and reduce the error. However, a malfunctioned ECU may create enough electrical noise to negatively affect the whole system.
Since 2008, all vehicles sold in the US must use CAN bus as one of their signal protocols. And in those vehicles’ OBD2 ports, the CAN_H is on pin 6, and the CAN_L is on pin 14
What are the speeds of the bus?
Modern cars nowadays have more than one CAN bus system, which have different speeds. This allows time-sensitive data to have their own “channel” and the others with lower priority go in lower speed systems.
High-speed CAN bus (ISO 11898-2) can go up to 1Mbit/s. The maximum cable length of this CAN is 40 meters.
The high-speed CAN system is used in your vehicles as there are many time-sensitive data that need minimum reaction time, such as:
• Airbag (SRS)
• Anti-lock brake (ABS)
• Powertrain control (PCM)
• Stability control (ESC)
Low-speed or fault-tolerant CAN bus (ISO 11898-3) can speed up to 125 kbit/s. This CAN bus has a much longer maximum cable length than the high-speed one. Car engineers use this for modules that do not require low latency signals, such as:
• Door control
• Light control
In your vehicle, these two CAN bus systems are connected to each other by a “Gateway”. This will allow ECUs in each system to send, receive data back and forth.
For example, when you accelerate your car (engine speed data from engine control module, which is in the high-speed CAN bus), the radio volume (connected to low-speed CAN bus) will automatically turn up.
However, there is also a direct connection between those channels without using a Gateway. In this way, data can be transmitted with the lowest latency.
To give an example, electronic stability control (ESC) is an extra safety feature in your car. This module requires low latency signals from the steering signal sensor and level sensor. The former sensor is in the Top column module, and the latter is in the rear power module. These two modules are not on the same channel with ESC, but they are directly connected to minimize the latency.
So, when you turn your steering wheel but the car doesn’t go the way you want, the ESC will apply brake to the wheels instantly to keep you safe.
What does bus termination mean and what is it for?
Because CAN bus communicates by using signals of 2 wires, one’s signal may “bounce” back to another’s, causing the data to be damaged. You might experience this phenomenon in your old analog TV when you got ghosted images.
The longer the cable, the more significant the “bouncing” will be. CAN bus speed is also the main factor for this effect.
To avoid this situation, the signal must go somewhere else and never go back. And “somewhere” in this case means termination resistors.
Because CAN bus data travel in both directions, you need to terminate the signal at the end of CAN_H and CAN_L lines (for high-speed CAN) or at each module (for Low-speed CAN).
The termination resistors should match the impedance of the cables, which is 120 Ohm for high-speed CAN (used in most vehicles).
So, when you measure the resistance between CAN_H and CAN_L, the value should be 60 Ohm, that’s two 120 Ohm resistors connected in parallel. If you read 120 Ohm, one of the resistors is blown.
For low-speed CAN, the impedance is close to 100 Ohm but not less than that.
How do CAN_H and CAN_L send signals across the system?
These 2 lines create 2 different states depending on the voltage difference between 2 CAN_H and CAN_L.
VDiff = VCANH - VCANL
● 2.0V < VDiff > 0.9V - Dominant state, coded as “0”
● -1.0V < VDiff < 0.5V - Recessive state, coded as “1”
During the dominant state, the CAN_H voltage is usually 3.75V and the CAN_L voltage is 1.25V. Of course, the numbers can be a bit higher or lower.
Specifically, the CAN_H dominant output voltage ranges between 2.75V and 4.50V. And the CAN_L dominant output voltage ranges between 0.50V and 2.25V.
Each ECU is able to send and receive series of those “0” and “1”. These series are called “frame”.
A frame consists of different fields and each field is in charge of different functions. We will dig deeper in the below part.
CAN bus is a bidirectional serial communication bus
What does bidirectional serial bus mean?
In the CAN bus physical layer, “bidirectional” can be understood in 2 different levels:
● “Bidirectional” on frames
● “Bidirectional” within frames
First, let’s talk about the on-frame level. As mentioned above, each ECU in the system is able to send and receive data frames) to/from other ECUs without any intervention of a third party, and this system is called peer-to-peer.
When an ECU wants to send data, it will check if the whole system is busy or not and then send a frame to the system.
But how can this data come to the right place?
When a frame is sent, all ECUs will take a look at that and decide whether they should ignore or receive the signal. This is possible because each ECU has its unique “address”. And inside a specific frame, there is a code indicating which address the data should go to, called "arbitration ID".
Arbitration ID is also in charge of indicating the priority of the frame. The highest priority message get to go first, and the lower priority ones will be delivered again when the traffic eases off.
The question is that how the transmitting ECU knows that its frame is not sent yet?
That leads us to a smaller level of “Bidirectional”, which is a single bit inside frames - the acknowledge (ACK) slot.
When an ECU sends out a frame, the ACK slot is always at the recessive state (1). When another ECU takes that message, it will change the ACK slot to the dominant state (0).
So, a zero means the message was received. On the other hand, if the transmitting ECU reads a one on the ACK slot, it means that the frame needs to be sent again.
In a nutshell, CAN bus physical layer is about how data can be transfer from the ECU A to the ECU B within one single system.
Using 2 simple, raw physical value – CAN_L and CAN_H voltages, CAN protocol is able to generate different series of “0” and “1”, creating a language so that cars’ modules can talk to each other.