Back to Blog

How to Diagnose Controller Area Network (CAN) Issues

In 1991, the Mercedes-Benz W140 was the first production vehicle to feature a CAN (Controller Area Network) based wiring system. By 2008 almost all passenger cars and light trucks sold in the U.S. used CAN bus networks.

Today, they are the backbone of industrial and automotive communication, making diagnostics on CAN systems a vital skill for engineers.

What is a CAN Bus?

 courtesy of CSS Electronics

 

Before CAN bus gained popularity, vehicle wiring harnesses could contain miles of copper wire which significantly added to the cost and weight of the vehicle. CAN bus was originally designed to minimize copper wiring in automobiles by multiplexing electrical signals over a simple two wire network. By using a high-speed twisted pair cable, the amount of wire necessary to allow sensors, actuators and controllers to communicate was greatly reduced.

When performing a CAN network diagnosis, it’s important to evaluate two distinct areas:

  • The physical CAN bus network (the wiring and hardware)
  • The CAN protocol (the software used to pass messages)

The Physical CAN Bus Layer

The lower-level CAN bus is a two-wire, half duplex, high-speed network system. The physical layer is responsible for bit timing and synchronization, message framing, arbitration, acknowledgement, error detection and signaling, and fault confinement.

There are basically 2 versions of the CAN standard that cover the lower layers, CAN 2.0 and CAN FD.

CAN 2.0 was published in 1991. This specification has two parts (Referred to CAN 2.0A and 2.0B);

  • part A is for the standard format with an 11-bit identifier
  • part B is for the extended format with a 29-bit identifier

The CAN FD protocol was released in 2012 and increases the effective data-rate by allowing longer data fields (up to 64 bytes per frame compared to the 8 bytes of CAN 2.0).

Think of the lower layer of CAN bus as bits transmitted at defined speeds on the wire itself.

The CAN Protocols

While the CAN standard defines the physical layer, a higher layer protocol is required to manage the communication messages on the CAN bus. The higher layer protocol handles details such as node addresses, flow control, fragmentation of data messages larger than 8-bytes, and establishment of communication among other things. Think of the higher layer protocol as the way the messages (data) are formatted, transmitted and received.

Currently, there are many higher layer protocols for the CAN bus. The most common ones are listed below:

  • CANopen - Industrial automation
  • IEC 61375-3-3 (use of CANopen in rail vehicles)
  • DeviceNet Industrial automation
  • EnergyBus - battery–charger communication
  • ISOBUS - Agriculture
  • NMEA 2000 - Marine industry
  • SAE J1939 - In-vehicle network for buses and trucks

All of these CAN protocols communicate over the CAN bus.

CAN Bus System Diagnostics: A Step-by-Step Guide

Diagnosing CAN bus problems can be challenging, but with the right approach, you don’t have to be highly technical to perform basic CAN bus diagnostics.

How to Test CAN Bus at the Physical Layer

Most CAN bus issues stem from hardware failures. All modules on a network need four things: power, ground, a data connection, and proper configuration.

Use a multimeter to investigate these simple factors of potential CAN bus failures.

  1. Device Configuration. Make sure the baud rate of the CAN communications is the same as all other devices on the CAN bus.
  2. Termination Resistance. A CAN bus has to be terminated on both ends with a 120-ohm resistor to prevent reflections from interfering with the data transmissions. In some cases, the termination resistor may be located inside the CAN device.
    1. Turn Power off
    2. Measure resistance between CAN Hi and CAN Low. Should be around 60 ohms.
  3. Voltages and Ground Connection.
    1. Disconnect all CAN devices from the CAN bus except for the device being tested.
    2. Power on the CAN device to be tested.
    3. Measure voltage between CAN HI and Ground. The voltage should be between 2.5 and 3.0Vdc.
    4. Measure voltage between CAN LOW and Ground. The voltage should be between 2.5 and 2.0Vdc
    5. Turn Power off
    6. With the meter on the lowest resistance scale, measure the ground wire to earth ground. The meter should read less than the minimum 0.1 ohm that most meters can read.
  4. Transceiver Resistance. You can test the CAN port on a device to see if it is damaged by measuring resistance to ground. Damage from lightning or transients typically causes a short to ground on one or both CAN lines.
    1. To test, disconnect the device (under test) from the CAN bus.
    2. Make sure power is off to the CAN device under test.
    3. Measure resistance from CAN HI to Ground and from CAN LOW to Ground. The result should be Mega ohms or open. If it is lower than this range, the CAN transceiver is probably faulty.

Troubleshooting the CAN Protocol

For complex communication issues, you will need a CAN bus analyzer. These tools range from free software with basic functionality to expensive, high-end hardware interfaces that provide very detailed data and analysis.

Using a CAN Bus Analyzer (PC-Based)

A simple solution for CAN diagnostics is to use a USB to CAN bus adapter. In this example, we use the Peak System PCAN-USB adapter with their free Windows software for displaying CAN and CAN FD messages (called PCAN-View).

PC running PCAN-View to analyze the CAN network

 

PCAN View screenshot

 

PCAN View Trace screenshot

Equipment needed:

  • Laptop running PCAN View (free download)
  • PCAN-USB adapter to connect to and monitor a CAN bus network
  • At least one CAN device talking on a CAN bus Network, in this example we used an Arduino board with a CAN-BUS Shield V2 from Seeed Studios. (Recommended that CAN bus be terminated with 120-ohm resistors on each end).

The PCAN-USB plugs into a USB port on the laptop. You need to download and install the USB driver from Peak. 

One minor limitation of this method is that the data rate of the CAN network must be known and the PCAN-USB has to be configured with this information. The Peak PCAN-Diag 2 can be used to determine the data rate on the CAN bus. (see below for an overview of the PCAN-Diag 2)

To start the connection to the CAN bus, click on the link icon in the top left of the window. 

To start the connection to the CAN bus, click on the link icon in the top left of the window. 

This will bring up the configuration page.

 

PCAN View configuration page

To set the CAN bus data rate, click on the dropdown box and select the correct bit rate. In this case, we selected 125 kbps.

 

To set the CAN bus data rate, click on the dropdown box and select the correct bit rate. In this case, we selected 125 kbps.

Then select the "OK" button. You should start to see packets arriving.

 

packets arrive in PCAN-View

Here, we are seeing some packets from CAN ID 0x01. With PCAN-View there is quite a lot of functionality that can assist with monitoring and troubleshooting a CAN Bus. Here are some of its monitoring and diagnostic capabilities:

  • Displays all received CAN messages with ID, Data Length, and data bytes in a list.
  • Data messages or Remote Request frames can be transmitted on the CAN bus. These messages can either be transmitted manually, automatically in fixed time intervals, or as answers to received Remote Request frames.
  • Error Frames on the CAN bus are detected and shown.
  • Contains a Tracer (data logger) that can be used to record and store the data communications on a CAN bus.

Handheld CAN Bus Diagnostics Unit

For more powerful trouble shooting there are hand held units that provide a lot more information that is very helpful when diagnosing a problem on the CAN bus. 

PCAN MiniDIAG FD - Handheld Diagnostic Tool PCAN DIAG FD - Handheld Diagnostic Tool for CAN FD Networks
PCAN MiniDIAG FD - Handheld Diagnostic Tool 

SKU : GC-CAN-MINIDIAG-FD
MPN : IPEH-003070

PCAN DIAG FD - Handheld Diagnostic Tool for CAN FD Networks

SKU : GC-CAN-DIAG-FD
MPN : IPEH-003069

An integrated handheld CAN diagnostics unit can provide a wide range of functions to allow investigation of a CAN bus, such as:

  • Auto detection of the CAN bit rate
  • Bus load measurements displayed by a time diagram, including a switchable display of error frames
Bus load measurements displayed by a time diagram, including a switchable display of error frames
  • The termination resistance measurement even while the system is running. Also measures Voltage for all pins on the CAN Bus (connected to handheld unit)
  • Receives and displays the CAN messages on the network
simple view of incoming CAN messages
  • Send / transmit either individual messages or entire sequences of them to the network. In addition, the internal memory card allows tracing and playback of the CAN traffic.
  • The integrated two-channel oscilloscope enables visualization of CAN signals.
Course of a CAN signal sampled by the oscilloscope function
  • The CAN frames can be decoded from the recorded packets to help detect errors in the frame.

One of the biggest benefits of a handheld tool is that it can analyze the CAN bus network at both the lower-level physical layer as well as the protocol level. This saves time and helps to get to the source of the error quickly.

 

Download PDF version

Get our monthly newsletter for product and technology updates