You are on page 1of 3

Practical testing of the CAN

physical layer
Robert Boys (Dearborn Group)

T he health of the physical


layer of a CAN bus is im-
portant. The robustness of
bus less those effects too
high in frequency for the volt-
meter to respond to. This
A clue that network
messages are present is if
the Ohm-meter gives differ-
of a CAN network by its re-
sistance values.
Termination resistors:
the CAN physical layer such makes voltage readings al- ent resistance readings The CAN specification re-
as ISO 11898-2 cover up most useless for servicing when the probes are re- quires a 120-Ohm termina-
many electrical problems CAN. A voltmeter will, how- versed. If in doubt, use the tion resistor at each end of
such as open, shorted, ever, effectively measure the voltmeter to test for zero Volt the CAN bus for termination.
leaky, out-of-spec or unbal- DC offset of both wires of the across the CAN lines and to This will result in a resist-
anced lines. The system re- differential CAN bus. The the vehicle ground before ance of about 60 Ohm
liability and stability can be CAN bus will tolerate a DC making resistance measure- across the CAN_H and
reduced and may not be offset to the design limits of
readily noticed and pre- the transceiver chip.
ventative testing should be Resistance: Voltmeters
done. Standard equipment are useful in detecting CAN
such as voltmeters and line shorts to ground, battery
standard oscilloscopes are or to each other using the
limited in value for testing Ohm-meter function. Typical
with CAN networks, because default resistances are
the data traffic on a CAN bus sometimes published by the
is not normally repetitive equipment OEMs and will
Fig. 2: Example CAN frame ID hex 010, data hex 55
enough to make meaningful vary depending on the net-
measurements as it would work design. There is nor-
be with a steady state sig- mally 60 Ohm between the ments. To test the resistance CAN_L wires if these two
nal. Special techniques and two wires of the bus. The from the voltage supply to resistors are installed. The
equipment are necessary to network must be powered either CAN_H or CAN_L, the load from the CAN nodes will
effectively design and down to accurately measure supply must be discon- lower this value further but
troubleshoot the physical the resistance of the CAN nected. If not, these voltages only slightly.
layer of a CAN network. bus. Problems with voltage will render resistance meas- Practical measure-
on the CAN bus: Ohm-me- urements useless. ments example: On a new
Voltmeter ters will not give accurate Shorts and opens: The Toyota vehicle the resist-
readings if there is any volt- CAN controllers will tolerate ance between the CAN lines
Voltage: At the idle or age present on the bus. a short circuit of one of the was measured as 62 Ohm.
rest state, a digital voltme- Ohm-meters work by putting two lines to ground because From one CAN line to
ter connected to the two a low DC voltage across a of the characteristics of the ground was 7 kOhm on one
CAN wires (CAN_H and circuit and measuring the differential bus. It cannot tol- vehicle and 13 kOhm on an-
CAN_L) will measure 0 V- resulting current. The resist- erate both CAN bus wires other model. These values
this is the logical 1. With ance in Ohm is calculated shorted to ground or to each were well within the vehicles
CAN messages present on and displayed. other. It will tolerate one of specifications.
the bus, the voltmeter will Therefore, an external the CAN lines being open or The resistance for the
register 0.5 V or so depend- voltage will cause an errone- disconnected. CAN lines to the battery was
ing on the nature of the bus ous measurement by adding Corrosion of connec- invalid due to the voltage is-
traffic. This will be the aver- or subtracting to the Ohm- tors and wires can cause a sue as described above.
age voltage differential of the meter voltage. higher or lower resistance of Frequency: Some volt-
the CAN bus and degrade meters (and oscilloscopes)
the network. This would have a frequency function.
cause erratic or intermittent This is not normally very
failures that are difficult to useful as the CAN mes-
detect and diagnose. An sages are not periodic
Ohm-meter is the perfect in- enough for the meter to
strument for detecting properly measure. CAN
anomalous DC resistance messages generally confuse
Fig. 1: Unsynchronized CAN frames on analog values. You can tell a great frequency measurement in-
oscilloscope deal about the functionality struments.

32 CAN Newsletter 2/2005


Oscilloscope configure and adjust. How-
ever, you can take advan-
Non-repetitive signals: tage of the fact that the
The network traffic on many ground of the oscilloscope
buses, including CAN, is not and of the CAN system are
repetitive and therefore not usually connected to-
rather difficult for a standard gether. Connect the oscillo-
oscilloscope to reliably trig- scope hot lead to one CAN
ger on and display. Digital line and the ground to the
storage oscilloscopes are other CAN lead. The differ-
needed to effectively view ential waveform will display
these waveforms. Ordinary Fig. 3: Low resolution 100 KHz digital oscilloscope CAN
correctly. This is how figures
oscilloscopes rely on dis- waveform
1 and 2 were made. If the
playing the same image re- vehicle and oscilloscope
peatedly and this requires a invert it to calculate the fre- with figure 2. It is clear the grounds are connected, this
stable and repetitive signal quency. For example, in fig- waveform is figure 3 has would short one CAN lead to
for a clear and jitter-free dis- ure 2 the first pulse will suf- been squared up with the vehicle ground through
play. fice as there are no pulses mixed results. The CAN the oscilloscope ground
The blurred oscillo- more narrow. This pulse frame is difficult to decipher lead.
graph of figure1 is a result measures 2 s. This is and does not faithfully repro-
of many CAN messages on equivalent to 0.000002 sec- duce the waveform. It does Integrity testing
top of each other and at dif- onds or 2x10-6 second. In- provide some basic informa-
ferent times as the oscillo- verting this (divide 1 by tion that is useful such that Most CAN systems use
scope sweeps overwrites its 0.000002) with a calculator a signal is present and a a twisted wire differential
screen multiple times. It is an returns 500,000 or 500 Kbit/ technician will recognize, pair. This means that the
image from an analog oscil- s, which is the speed of this with considerable experi- CAN signals will be 180 de-
loscope. Figure 2 is one CAN bus. Some oscillo- ence, that the bus is some- grees out of phase and in-
CAN message sampled scopes have methods to cal- what operational. terference from outside will
once and stored in the oscil- culate this automatically. All be in-phase. Careful trans-
loscopes memory for dis- you need to do select the Connecting ceiver circuit design will re-
play. Compare this with the pulse to be measured. oscilloscopes spond to the out of phase
same frame digitally sam- Signal Faithfulness: signals and reject those that
pled and stored in figure 2 The smallest bit pulse of fig- With the CAN differen- are in-phase. This is referred
to see the difference. ure 2 could be represented tial pair, the CAN_H and to as Common Mode Rejec-
In figure 1 it can be by a 250 KHz sine wave and CAN_L lines will operate tion of a differential pair. This
seen that the approximate the wider pulses with lower opposite of each other. If you is the essence of a differen-
voltage of the bus is correct frequencies. They will then connect an oscilloscope hot tial pair.
and that the CAN signals are have rounded corners and lead to one of the CAN lines Working properly, such
present and not shifted high sloped sides. A oscilloscope and the oscilloscope ground a system is balanced and
or low and the top or bottom with a 250-KHz bandwidth lead to the vehicle ground, noise immunity will be high.
is not clipped. It does not would display a rectangular you will just see one half of An unbalanced condition will
prove they are CAN frames. waveform as a sine wave the CAN waveform. You result in less than optimum
Many circuit defects will diminishing its usefulness. could use the second chan- noise and interference rejec-
have abnormal oscilloscope The square corners of the nel of a dual channel oscil- tion and a potential increase
waveforms. Figure 2 is an waveform that is caused by loscope to see the other side in bus errors. It is important
11-bit CAN frame with iden- odd harmonics at multiples of the waveform but to prop- that interference signals be
tifier 0x010 and one data of 250 KHz (750; 1,250; erly combine them a special the same on both lines in
byte with a value of 0x55. It 1,750; etc.) as well as noise differential probe is needed. order for them to be can-
was captured with an Agilent pulses and other anomalies This probe will take each of celled out. An oscilloscope
54645D 100 MHz digital all having frequencies some- the CAN lines, subtract them will show this by examining
storage oscilloscope. While what greater that 250 KHz and present this to the oscil- the two lines on separate
it is easy to see the overall will not be displayed or will loscope. Many oscilloscopes channels and then on one
waveform is clean, of proper be severely attenuated. This can algebraically sum the channel as described above.
voltage and frequency, it is would have severe limits on two channels into one No interference should be
time-consuming to manually the usefulness of such a os- screen trace. This is effec- visible when the CAN mes-
calculate the identifier and cilloscope. Some digital os- tive but on some oscillo- sage is displayed on one
data values. This is made cilloscopes found in automo- scopes it can be difficult to channel. Using two chan-
easier with the newer CAN- tive scan tools have such
capable oscilloscopes avail- limitations and software
able from Le Croy, Agilent techniques might be used to
and Yokogawa. artificially square up the
Frequency: The oscillo- waveform. This is not good
scope can easily determine engineering practice.
the frequency of a CAN mes- Figure 3 shows three
sage. Simply measure the CAN frames with a 10 kHz
width of the narrowest pulse digital automotive oscillo-
in the waveform and divide scope. Compare this signal Fig. 4: Analyzer display of CAN frames

34 CAN Newsletter 2/2005


environments. Bus errors troller. A bus analyzer that tional physical layer. Inter-
can regularly occur and tracks and displays these mittent or transient problems
aborted messages are re- errors is useful. Figure 5 could be caused not by soft-
sent if possible. If the shows the bus errors and a ware bugs, but by a network
number of bus errors exceed bus off condition detected by susceptible to outside inter-
a threshold, a node will take the Gryphon. Defective ference or borderline oper-
it itself off the bus and enter busses will contain a large ating characteristics. This is
the Bus Off mode. The number of errors and these especially true in harsh ve-
number of bus errors that can be tracked or tested hicle, outdoor and factory
occur and how this number against historical informa- environments. Instruments
changes can give a good in- tion. and testing techniques de-
dication of the health of the scribed in this article can re-
bus. Few commercial CAN Conclusion pair such unusual and diffi-
nodes track bus errors even cult to find errors to minimize
though this information is CAN bus errors should breakdowns.
available from the CAN con- be tracked to ensure a func- rboys@earthlink.net
Fig. 5: Bus error window on
the Gryphon

nels, any noise visible on


one channel must be the
same on the other channel.
This is why the two bus wires
must be physically located
and twisted together.

Analyzer tools
A standard CAN bus
analyzer can read CAN traf-
fic, put user specified mes-
sages on the bus and pro-
vide statistical information
such as bus loading and bus
error information. It can also
display the CAN messages
giving the identifier and any
data values. Many analyzers
are able to display the acro-
nym for a particular CAN
message from associated
databases. The physical
layer must have fairly high
electrical integrity as these
analyzers are essentially a
sophisticated CAN node.
Figure 4 shows a typi-
cal display from the
Dearborn Group Gryphon/
Hercules analyzer (www.dg-
tech.com/product/gryphon/
flier/gryphon.pdf). It displays
the identifiers, data values
and a timestamp shown. The
Gryphon connects directly to
the OBDII CAN connector on
the vehicle and will capture
OBDII codes and/or propri-
etary messages similar to
that shown in figure 4.

Bus errors
The CAN bus was de-
signed to be very robust and
operate in electrically harsh

CAN Newsletter 2/2005

You might also like