The CAN Bus
The CAN bus uses Non-Return To Zero (NRZ) with bit-stuffing. There are two different signaling states: dominant (logically 0) and recessive (logically 1). These correspond to certain electrical levels which depend on the physical layer used (there are several.). The modules are connected to the bus in a wired-and fashion: if just one node is driving the bus to the dominant state, then the whole bus is in that state regardless of the number of nodes transmitting a recessive state.
Different Physical Layers
A physical layer defines the electrical levels and signaling scheme on the bus, the cable impedance and similar things.
There are several different physical layers:
- The most common type is the one defined by the CAN standard, part ISO 11898-2, and it’s a two-wire balanced signaling scheme. It is also sometimes known as “high-speed CAN”.
- Another part of the same ISO standard, ISO 11898-3, defines another two-wire balanced signaling scheme for lower bus speeds. It is fault tolerant, so the signaling can continue even if one bus wire is cut or shorted to ground or Vbat. It is sometimes known as “low-speed CAN”.
- SAE J2411 defines a single-wire (plus ground, of course) physical layer. It’s used chiefly in cars – e.g. GM-LAN.
- Several proprietary physical layers do exist.
- Modifications of RS485 were used in the Old Ages when CAN drivers didn’t exist.
- Go to Section 5 to view a number of oscilloscope pictures for those interested in the details of a message.
Different physical layers can not, as a rule, interoperate. Some combinations may work, or seem to work, under good conditions. For example, using both “high-speed” and “low-speed” transceivers on the same bus can work.. sometimes.
A great many CAN transceiver chips are manufactured by Philips; alternative vendors include Bosch, Infineon, Siliconix and Unitrode.
A very common type is the 82C250 transceiver which implements the physical layer defined by ISO 11898. The 82C251 is an improved version.
A common transceiver for “low-speed CAN” is TJA1054 from Philips.
Maximum Bus Speed
The maximum speed of a CAN bus, according to the standard, is 1 Mbit/second. Some CAN controllers will nevertheless handle higher speeds than 1Mbit/s and may be considered for special applications.
Low-speed CAN (ISO 11898-3, see above) can go up to 125 kbit/s.
Single-wire CAN can go up to around 50 kbit/s in its standard mode and, using a special high-speed mode used e.g. in ECU programming, up to around 100 kbit/s.
Minimum Bus Speed
Be aware that some bus transceivers will not allow you to go below a certain bit rate. For example, using 82C250 or 82C251 you can go down to 10 kbit/s without problems, but if you use the TJA1050 instead you can’t go below around 50 kbit/s. Check the data sheet.
Maximum Cable Length
At a speed of 1 Mbit/s, a maximum cable length of about 40 meters (130 ft.) can be used. This is because the arbitration scheme requires that the wave front of the signal can propagate to the most remote node and back again before the bit is sampled. In other words, the cable length is restricted by the speed of light. A proposal to increase the speed of light has been considered but was turned down because of its inter-galactic consequences.
Other maximum cable lengths are (these values are approximate) –
- 100 meters (330 ft) at 500 kbit/s
- 200 meters (650 ft) at 250 kbit/s
- 500 meters (1600 ft) at 125 kbit/s
- 6 kilometers (20000 ft) at 10 kbit/s
If optocouplers are used to provide galvanic isolation, the maximum bus length is decreased accordingly. Hint: use fast optocouplers, and look at the delay through the device, not at the specified maximum bit rate.
An ISO 11898 CAN bus must be terminated. This is done using a resistor of 120 Ohms on each end of the bus. The termination serves two purposes:
- Remove the signal reflections at the end of the bus.
- Ensure the bus gets correct DC levels.
An ISO 11898 CAN bus must always be terminated regardless of its speed. I’ll repeat this: an ISO 11898 CAN bus must always be terminated regardless of its speed. For laboratory work just one terminator might be enough. If your CAN bus works even though you haven’t put any terminators on it, you are just lucky.
Note that other physical layers, such as “low-speed CAN”, single-wire CAN, and others, may or may not require termination. But your vanilla high-speed ISO 11898 CAN bus will always require at least one terminator.
To learn more about CANbus termination, referred to in the notes below.
ISO 11898 prescribes that the cable impedance be nominally 120 Ohms, but an impedance in the interval of [108..132] Ohms is permitted.
There are not many cables in the market today that fulfill this requirement. There is a good chance that the allowed impedance interval will be broadened in the future.
ISO 11898 is defined for a twisted pair cable, shielded or unshielded. Work is in progress on the single-wire standard SAE J2411.
There is no standard at all for CAN bus connectors! Usually, each Higher Layer Protocol(!) defines one or a few preferred connector types. Common types include:
- 9-pin DSUB, proposed by the CAN in Automation (CiA) group.
- 5-pin Mini-C and/or Micro-C, used by DeviceNet and SDS.
- 6-pin Deutch connector, proposed by CANHUG for mobile hydraulics.