AN-1123: Controller Area Network (CAN) Implementation Guide

The controller area network (CAN) is a standard for distributed communications with built-in fault handling, specified for the physical and data link layers of the open systems interconnection (OSI) model in ISO-11898 1, 2 . CAN has been widely adopted in industrial and instrumentation applications and the automotive industry due to the inherent strengths of the communication mechanisms used by CAN.

Features of CAN include:

At the physical layer, differential data transmission is supported by the CAN protocol, providing advantages such as:

Implementing A Controller Area Network

This application note considers the following aspects of how CAN is implemented in industrial applications:

How Can Uses Differential Data Transmission

In traditional differential data transmission (for example, RS-485 3 ), Logic 1 is transmitted as a voltage level high on one noninverting transmission line and low on the inverting line. Correspondingly, Logic 0 is transmitted as low on the noninverting line and high on the inverting line. The receiver uses the difference in voltage between the two lines to determine the Logic 1 or Logic 0 that was transmitted, as shown in Table 1.

Table 1. Comparison of CAN and RS-485 Voltage Levels
Logic RS-485 Levels CAN State CAN Levels
1 A − B ≥ +200 mV Recessive CANH − CANL ≤ 0.5 V
0 A − B ≤ −200 mV Dominant CANH − CANL ≥ 0.9 V

A driver on the bus can also be in a third state, with the driver outputs in a high impedance state. If all nodes are in this condition, the bus is in an idle state. In this condition, both bus lines are usually at a similar voltage with a small differential.

Signaling for CAN differs in that there are only two bus voltage states; recessive (driver outputs are high impedance) and dominant (one bus line, CANH, is high and the other, CANL, is low), with thresholds as shown in Table 1. Transmitting nodes transmit the dominant state for Logic 0 and the recessive state for Logic 1. An idle CAN bus is distinguished from recessive bit transmission simply by detection of multiple recessive bits after an end of frame or error frame.

The two states of dominant and recessive are represented by the CANH and CANL voltage levels shown in Figure 1 that compares CAN signaling to RS-485. This signaling method is fundamental both to the node arbitration and inherent prioritization of messages with lower message IDs (more initial Logic 0s as the message is serially transmitted).

Figure 1. Comparison of Differential Signaling for CAN and RS-485/RS-422.

Figure 2. CAN Implementation Blocks as Related to OSI Layers and Features.

Physical Layer Transceivers

CAN transceivers provide the differential physical layer interface between the data link layer, the CAN controller (for example, embedded in some of Analog Devices Blackfin processors), and the physical wiring of the CAN bus. The Analog Devices portfolio includes transceivers with integrated i Coupler ® digital isolation 5 for signal isolation and iso Power ® power isolation 5 , providing fully isolated off-the-shelf CAN PHYs.

The ADM3051/ADM3052/ADM3053/ADM3054 are designed for interfacing to CAN controllers and support various CAN applications. Depending on the application, different high level protocols can be used with CAN, for example, CANopen or DeviceNet ™ .

CAN Controllers

The data link layer of CAN and physical bit timing is implemented by the CAN controller (sometimes embedded within a microcontroller or digital signal processor (DSP), for example, the ADSP-BF548), according to the CAN 2.0b specification and conforming to the data link layer portion of the ISO-11898 standard. The CAN controller handles message filtering, arbitration, message framing, error handling, and error detection mechanisms such as bit stuffing.

DeviceNet NETWORKS

DeviceNet 6 is a specification managed by the Open DeviceNet Vendors Association (ODVA) for communication networks. DeviceNet specifies aspects of the physical layer, the use of CAN for physical and data links layers, and higher-level communication using the common industrial protocol (CIP). Industrial and instrumentation commonly use DeviceNet for CAN applications.

DeviceNet specifies a multidrop network that supports master-slave or distributed control schemes across a linear bus topology. The network not only comprises the differential signaling bus lines, but also power and ground, so that nodes can be powered from the bus.

The physical layer specifications for DeviceNet specify features such as the use of CAN technology, protection from wiring errors and the ability to add or remove nodes from the network while it is operational. Various aspects of the physical layer are specified in detail, including the transmission media and connectors.

The ADM3052 isolated CAN transceiver meets the physical layer requirements of DeviceNet, in addition to incorporating features used by DeviceNet nodes, such as signal isolation, miswire protection, and a linear regulator to power the bus side of the device from the 24 V bus power (V+). Figure 3 provides a functional block diagram of the ADM3052, as well as an application configuration.

Figure 3. Application Example Using the ADM3052 Isolated CAN Transceiver.

Figure 4. CAN Standard Message Frame Fields.

Figure 5. CAN Extended Message Frame Fields.

Figure 6. Example of Arbitration Between CAN Nodes.

Note the example of bit stuffing after the initial five dominant bits transmitted by Node 1. These extra bits are important in allowing nodes to synchronize their timing and are also used for error detection.

Message Priority

CAN message frames are transmitted most significant bit (MSB) first, and as the message IDs are at the beginning of a frame, they form part of the arbitration sequence. Messages with a lower ID (more initial 0s) have a higher priority. In addition, remote frames (RTR bit = 1) have a lower priority than the data frame with the same ID.

Error Mechanisms

CAN incorporates various mechanisms for supporting error checking and handling. These include definitions of the following error detection schemes:

These errors are handled using the following mechanisms:

The CAN controller detects and handles these errors and supports the error detection by framing CAN messages according to CAN 2.0b.

Error Frames

An error frame is distinguished by having six consecutive bits. This sequence is dominant or recessive depending on the state of the node transmitting the error. This sequence violates the normal transmission rules and so is detectable by other nodes.

Any node transmits error frames immediately when it detects an error. As an error frame itself highlights an error, other nodes concurrently transmit their own error frames, resulting in a superposition of multiple error frames.

The sequence of six consecutive bits is the error flag. An error frame also comprises an error delimiter to allow for the error flags from other nodes overrunning the initial six bit periods. An example of transmission of a CAN frame with an error and a subsequent CAN active error frame is shown in Figure 7, compared to an error-free transmission.

Figure 7. Normal Transmission with ACK and Faulty Transmission with CAN Error Frame.

Figure 8. Termination Schemes for CAN Applications.

Reflections happen very quickly during and just after signal transitions. On a long line, the reflections are more likely to continue long enough to cause the receiver to misread logic levels. On short lines, the reflections occur much sooner and have no effect on the received logic levels.

Parallel Termination

In CAN applications, both ends of the bus must be terminated because any node on the bus may transmit data. Each end of the link has a termination resistor equal to the characteristic impedance of the cable, although the recommended value for the termination resistors is nominally 120 Ω (100 Ω minimum and 130 Ω maximum). There should be no more than two terminating resistors in the network, regardless of how many nodes are connected, because additional terminations place extra load on the drivers.

ISO-11898-2 recommends not integrating a terminating resistor into a node but rather attaching standalone termination resistors at the furthest ends of the bus. This is to avoid a loss of a termination resistor if a node containing that resistor is disconnected. The concept also applies to avoiding the connection of more than two termination resistors to the bus, or locating termination resistors at other points in the bus rather than at the two ends.

Parallel Termination with Common-Mode Filtering

To further enhance signal quality, split the terminating resistors at each end in two and place a filter capacitor, CT, between the two resistors. This filters unwanted high frequency noise from the bus lines and reduces common-mode emissions.

Isolation

In CAN applications, there are often long links that can cause the ground potential at different nodes on the bus to be slightly different. This causes ground currents to flow through the path of least resistance through either the common earth ground or the ground wire. If the same electrical system is used to connect the power supplies of all nodes to the same earth ground, the ground connection may have reduced noise. Note, however, that motors, switches, and other electrically noisy equipment can still induce ground noise into the system.

Different power systems are required in some applications. This is likely to increase the impedance of the earth ground, and the ground currents from other sources are more likely to find their way into the ground wire of the link. Isolating the link reduces or even eliminates these problems. Galvanic isolation is the recommended solution if there is no guarantee that the potential at the earth grounds at different nodes in the system are within the common-mode range of the transceiver. Galvanic isolation allows information flow but prevents current flow (see Figure 9).

Figure 9. Galvanic Isolation Allows Information Flow While Preventing Ground Current Flow.

Figure 10. Comparison of Traditional Isolation with Bus Power vs. ADM3052.

For applications where an isolated supply is discretely provided, or bus power is used for various circuit elements, the ADM3054 can be used with a 5 V isolated power supply on the bus side of the device.

In other applications, power from a supply on the logic side of the circuit can be transferred across the isolation barrier. Traditionally, this is achieved by use of a dc-to-dc converter implemented with an oscillator, transformer, and regulator using discrete components.

The ADM3053 integrates power isolation in addition to signal isolation. A single 5 V supply can supply power to the bus side via an integrated isolated dc-to-dc converter using Analog Devices iso Power technology. An isolation rating of 2.5 kV rms is achieved with the ADM3053. Figure 11 compares the traditional solution using discrete devices to the ADM3053. The internal blocks of the ADM3053 are shown in the functional block diagram in Figure 12.

Figure 11. Comparison of Traditional Isolation (Signal and Power) vs. ADM3053.

Figure 12. ADM3053 Functional Block Diagram.

Stress Protection

Miswire And Short-Circuit

Some CAN applications, such as DeviceNet, in addition to carrying data on the bus lines, CANH and CANL, also distribute power along the bus. In such systems, bus power of typically 24 V is routed along the bus, along with a common ground.

In such systems, the connector for each CAN node has four wires, CANH, CANL, 24 V, and ground. To prevent damage in the case of miswiring of these signals, CAN nodes using 24 V bus power require protection on all bus lines (CANH, CANL, power, and ground). Miswire protection is a requirement for the DeviceNet protocol. The ADM3052 isolated CAN transceiver with integrated bus power regulator incorporates ±36 V miswire protection on the CANH, CANL, V+, and V− pins.

Other CAN nodes that do not use power from the bus may still require this protection. In such cases, the CAN node still requires protection against shorting of CANH or CANL by connection to a power or ground line. For this reason, the ADM3051, ADM3053, and ADM3054 CAN transceivers also incorporate ±36 V protection on CANH and CANL.

Transient Overvoltage

In I&I applications, lightning strikes, power source fluctuations, inductive switching, and electrostatic discharge can cause damage to CAN transceivers by generating large transient voltages. The following electrostatic discharge (ESD) protection, electrical fast transients (EFT) protection, and surge protection specifications are relevant to industrial applications:

The ADM3051, ADM3052, and ADM3053 CAN transceivers offered by Analog Devices include basic ESD protection on all pins. The level of protection can be further enhanced on the bus pins when using external clamping devices, such as transient voltage suppression (TVS) diodes. TVS diodes are normally used to protect silicon devices, like CAN transceivers, from transients.

The protection is accomplished by clamping the voltage spike to a limit, by the low impedance avalanche breakdown of a PN junction. TVS diodes are ideally open-circuit devices. A TVS diode can be modeled as a large resistance in parallel with some capacitance while working below its breakdown voltage. When a transient is generated, and the surge voltage is larger than the breakdown voltage of the TVS, the resistance of the TVS decreases to keep the clamping voltage constant. The selection of TVS diode is such that the clamping voltage is less than the voltage rating of the device that it is protecting. The transients are clamped instantaneously (

Figure 13. Transient Voltage Suppressor.

Figure 14. TVS Application Circuit.

References

1 ISO 11898-1:2003, “Road Vehicles — Controller Area Network (CAN — Part 1: Data Link Layer and Physical Signalling,” (ISO International Standard, 2003).

2 ISO 11898-2:2003, “Road Vehicles — Controller Area Network (CAN) — Part 2: High Speed Medium Access Unit,” (ISO International Standard, 2003).

3 Hein Marais, Application Note AN-960, “S-485/RS-422 Circuit Implementation Guide,” (Analog Devices, Inc., 2008).

4 CAN Specification 2.0, Part B, (CAN in Automation, 1991).

6 DeviceNet ™ Technical Overview, (Open DeviceNet ™ Vendor Association, Inc., 2001), X to XI.

7 EN 50325-4:2002, “Industrial Communication Subsystem Based on ISO 11898 (CAN) for Controller-Device Interfaces, CANopen,” (CAN in Automation, 2002).

Author

Conal-Watterson

Dr. Conal Watterson

Dr. Conal Watterson is a senior staff applications engineer in the Interface and iCoupler ® Digital Isolator Group at Analog Devices in Limerick, Ireland. A Ph.D. and M. Eng. graduate of the University of Limerick since 2010, Conal has published a number of papers and articles on industrial fieldbus networks, diagnostics/reliability and high-speed signaling and isolation. His current focus topics are integrated isolated communication solutions, high-speed interfaces and USB.

Related Content

Products

Product Categories