Chinese Version

Introduction to Controller Area Network (CAN)

Forced by the increasing number of distributed control systems in cars and the increasing wiring costs of car body electronics, the availability of a powerful and reliable serial data communication system for the exchange of messages between the different control units was becoming urgent. This was the starting point for BOSCH, a main provider of electronic car equipment to develop the CAN protocol and standardize it as an international standard in ISO 11898. 1989 the first protocol controller chip (82526) was provided by INTEL. Today, more than 110 protocol controller implementations in form of stand-alone controllers or integrated into a microcontroller are available from 20 manufactures including all of the main semiconductor manufacturers. According to a survey of the CAN-in-Automation organization, the already designed number of CAN chips will be about 210 million in the year 2002. Today, the CAN interface already may be regarded as the standard serial interface of microcontrollers,used in any type of distributed embedded applications.

Due to the outstanding features of the CAN protocol, the availability of low cost netwok controllers from many manufacturers as well as the ease of implementation, the CAN protocol today is in use not only in almost any type of mobile system (passenger cars, trucks and buses, agricultural equipment, ships, aircraft, elevators), but also in any type of machines, from textile, packaging, paper manufacturing machines up to any type of medical equipment or robot control systems. CAN is particularly well suited for networking of "intelligent" devices. Since the availability of higher layer communication standards and profiles, CAN-based networking is becoming one of the most promising solutions for open, distributed automation systems, competing very successfully with other bus standards in the field of industrial plant automation. As the most important standards of the type, CANopen and DeviceNet have to be mentioned.

Outstanding features of the CAN protocol

Besides of the availability of very low cost network interfacing, the worldwide acceptance of the CAN protocol is based also in the outstanding features of the CAN protocol. In contrast to other popular, serial communication standards CAN represents a message distribution system.

Message distribution system for up to 2048 respectively 512 million different messages

Since a transmitted frame is broadcasted to any node of a system, any node receives any message transmitted and decides by means of a hard- or software message acceptance filter, if the message is of interest for it. Since the 11- or 29-bit message identifier determines also the priority of a message with respect of the bus access a very efficient means for transmitting high priority messages with very short latency time is provided even at times of high bus load. With a 11-bit message identifier up to 2048 different messages, with the 29-bit identifier up to 512 million different messages per system may be distinguished.

Multimaster, event-oriented message transmission

Since the transmission of a CAN message may be initiated by any node of a system (multimaster capability) as soon as the bus is idle, any node of the system may exchange information with any other node. This feature is very important because it very efficiently supports event-oriented message transmission.

Non-destructive contention-based bus arbitration

Bus arbitration according to the CAN protocol is based on a non-destructive, contention-based arbitration scheme. All nodes are allowed to start the transmission of a frame after the bus is idle, which can lead to more than one node starting transmission at the same time (Fig. 1). To prevent a node from destroying another node's frame it monitors the bus during transmission of the identifier field and the RTR bit. As soon as it detects a dominant bit while transmitting a recessive bit it releases the bus, immediately stops transmission and continues receiving the frame.

The applied arbitration principle guarantees, that at any time, always the highest priority message is transimitted first and the bus bandwidth is used most efficiently. For the highest priority message, a maximum latency time of the longest possible message, that is 130 bit times may occur. For other high priority messages deterministic maximal latency times may be provided by means of higher layer protocol or application specific measures.

Bitrate and bus length

As a consequence of the bit-wise arbitration which requires the comparison of the local bus levels of the distinct nodes within one bit time interval, the usable maximum data rate decreases with increasing bus length. As a rule-of-thumb for bus lengths of more than 100m, the product of data rate (in Mbits/s) times bus length (in m) is about 60. For example, at a bus length of 1000 m, a data rate of about 60 kBits/ second may be used.

The format of a standard CAN message

In Fig. 2 the format of a standard CAN data frame is shown. The beginning of a frame is signaled by a dominant start bit, followed by the 11-bit message identifier and a futher arbitration bit which distinguishes between a data and data request frame (remote frame). With a remote frame the transmitter of the frame may request a specified message from another node in the system with the requested message specified by its message identifier.

Within the control field the type of message format (standard/extended) and the length of the following data field is indicated.

The data field of a CAN message may contain from zero up to maxium 8 bytes of data. During the acknowledge slot of the acknowledge field a message transmitter expects the acknowledgment in form of a dominant bus level of at least one receiving node. This information primarily is used for detecting a failure of a message transmitter. The transmitted bit sequence is followed by a 15-bit CRC segement, which allows a receiving node to check the validity of the received data. An end-of-frame field indicates the complete, errorless transmission of a CAN frame.

Short messages for low latency times and low block error probability

The message length of the CAN message is adopted according to the needs of the envisioned application field and especially for transmission of process data this length is sufficient in almost any application. If data blocks of more than 8 bytes have to be transmitted, a higher layer fragmentation protocol has to be applied. On the other hand, the relatively short length of the CAN message guarantees low latency times for high priority messages. It is also advantageous with respect to the transmission of data within a harsh electromagnetic environment since as shorter the message as higher is the probability for an undisturbed transmission.

High message rates

At a data rate of 1 Mbit/sec the maximum message transfer rate of the CAN protocol is between about 10.000 four-byte and 7.200 eight-byte messages per second.

Sophisticated error detection and error confinement mechanisms

One of the most outstanding features of the CAN protocol are its very sophisticated error detection and error confinement mechanisms, resulting in a low residual probability of not detected errors. There are several mechanisms in the CAN protocol, to detect errors and to inhibit erroneous nodes from disabling all bus activities. Surely the most important error detection mechanism is provided with monitoring of the transmitted bit level by the transmitting mode. If the monitored bit level is different from the bit level that is sent, a bit error is detected. With this mechanism all globally effective bus errors are detected. The error detection capability of the CAN protocol is futher improved by checking of fixed format elements and by checking of the CRC segment through a receiver of a message, providing a means for detecting of only locally effective errors with a very high probability.

Error signaling instead of message confirmation provides system-wide data consistency and low error recovery times

Whereas most of the competing field bus protocols apply the principle of message confirmation within a specified slot time, in the CAN protocol only a corrupted message is signaled by means of an error frame. An error frame is transmitted as soon as an error condition is detected by a transmitting or receiving node. With the error frame the transmitted message is destroyed and so network-wide data consistency is provided. If a transmission of the corrupted message. This mechanism provides a very short error recovery time which is much lower than that of competing protocols.

Due to the principle of error signaling, it is necessary to prevent that an erroneous node disturbs other nodes by permanently sending of error frames. Therefore in each CAN controller there is a counter for counting of transmission and receiving errors and for performing a sophisticated error management. If one of the error counters overflows a certain value a node is not any more allowed to destroy messages, if the transmit error counter overflows a still higher value, the node is automatically disconnected from the bus.

Standard higher layer protocols and open systems

According to the manifold applications of the CAN protocol several higher layer protocols have been evolved since the introduction of CAN. Whereas shortly after the availability of CAN chips only application-specific, layer-two-based system solutions have been implemented today most CAN-based networks are implemented in form of a higher layer solution. Most popular protocols of that type are CANopen, DeviceNet and SDS for standardized industrial applications of any type, CAL for optimized applications based on a standard application layer communication protocol and SAE J1939 for trucks and heavy duty off- and on-road vehicles.

With its sophisticated methods of device modeling, its comprehensive and steadily growing device and application profiles especially CANopen and DeviceNet today are providing the most advanced methods of an open system approach which is available in the world of field bus systems.


 

The 10th Floor, Quantum Plaza, No. 27, Zhichun Road, Haidian District, Beijing, 100083, P.R. China
Tel: +86-10-82357579, 82357580, 82357576

Fax: +86-10-82357574

info@mcu-world.com