E-learning Resources in Microelectronics

CAN Bus 


Universität Paderborn

Document Information
 

1.  General
2.  Operation of CAN Networks
3.  Technical Realisation of CAN Network
 


 

 

Author:
staff at Universität Paderborn 



1. General
 
CAN (Controller Area Network) is a serial bus system. CAN was developed by Bosch and was originally designed for automotive applications. CAN is a serial bus system especially suited for networking "intelligent" devices as well as sensors and actuators within a machine or plant. Due to its excellent technical and commercial properties  CAN is used today in a wide range of applications, eg. mobile systems, machine and plant internal communication systems, field areas of processing automation and building automation. The relative simplicity of the CAN protocol means that very little cost and effort need be expended on training, and the CAN chips interfaces make applications programming relatively simple. Introductory courses, function libraries, starter kits, host interfaces, I/O modules and tools are available from a variety of vendors permitting low cost implementation of CAN networks. Low cost controller chips implementing the CAN data link layer protocol in silicon and permitting simple connection to microcontrollers have been available since 1989.  Today there are at least 25 CAN protocol controller chips from more than 10 manufacturers available, not including gate array solutions.



2. Operation of CAN Networks
 
CAN features:



 
 

Figure 1.   CAN bus structure

2.1 Principle of data exchange

The serial bus system with real time capabilities is the subject of the ISO 11898 international standard and covers the lowest two layers of the ISO/OSI reference model.  In CAN networks there is no addressing of subscribers or station in the conventional sense, but instead, prioritized messages are transmitted.  A transmitter sends a message to all CAN nodes.  Each node decides on the basis of the identifier received whether they should process the message or not.  The identifier also determines the priority that the message enjoys in competition for bus access.  If a node wants to send a message, it first waits until the bus is quiet.  All nodes which want to send information on the bus can transmit their messages simultaneously.  The others remain in the listening state.
 

2.2 Non-destructive bit-wise arbitration

For bus access and collision avoidance, the CSMA/CA method with bitwise arbitration is used.  In this phase, the subscriber with dominant status (logical 0) overwrites the recessive state (logical 1).  The subscriber with recessive state retreats from the bus and switches automatically to receiver mode, listening to the message with the highest priority.  After the bus has become quiet again the subscribers each try to send their messages again.  The subscriber with highest priority enforces its transmission unhindered. Thus the real time behaviour of the station with the highest priority is guaranteed although the bus access is stochastic. For all other less prioritized stations the stochastic queue time has an effect.


Figure 2.    Principle of bitwise arbitration to the CSMA/CA method


The CAN protocol supports two different message formats. They are only distinguished by the length of the identifier which defines the identification of the message as well as the priority .  The standard format of the identifier has a length of 11 bits and the extended identifier has a length of 29 bits.


Figure 3.    Message structure of the CAN protocol


Inside the CAN protocol the single receivers do not use direct acknowledgements due to multicasting.  However, possible errors are detected and signalled. To maximise error detection several mechanisms are implemented inside the CAN protocol with reference to the data link layer.
 


If an error is detected by a subscriber, an error flag signals the condition. The flag has a length of 6 bits at the dominant level.   All other subscribers detect that an infringement of the bit stuffing rule has taken place and they also send an error flag.  The overlaying of all error flags can take up to 12 bit times.  This method ensures that each station is certain to detect that the message is faulty. 



3.  Technical Realisation of CAN Network
 
Until recently bus controllers either required several chips to interface the host PC to the bus or they were limited to one fieldbus architecture alone.  A new controller chip module promises better conditions.  A single chip inside each device can be configured via software to conform to PROFIBUS or CAN/DeviceNET installations.  This multi fieldbus controller chip (VPC 16) integrates all the components for PROFIBUS and CAN/DeviceNET circuit elements and includes all the control components of those communication systems.


Figure 4.    VPC 16 Multi Fieldbus Controller ASIC

The developer need not think about which combination of interface module, microcontroller, compiler and other development tools perform the best solution for the appropriate fieldbus system.  Only the physical line connections are external to the fieldbus side.  The block diagram above shows the architecture of the VPC 16 designed by Profichip GmbH.

For CAN bus operation, all resources such as control, filter and error detection mechanisms for processing of standard CAN messages (11-bit identifier) and extended CAN messages (29-bit identifier) are implemented inside both CAN interfaces of the chip.  The internal selection follows an 8-bit-data interface and corresponding control signals from the integrated processor.  The transmission rate is automatically detected.  Software solutions are available for communications between two CAN interfaces and the integrated processor.  PROFIBUS and the CAN bus operate independently of each another and can send data simultaneously. The next digram shows a typical CAN connection with the VPC 16 module.


Figure 5.   CAN connection with VPC 16 chip



Further Reading
To link to the VPC 16 data sheet at the Profichip GmbH site, click here.






Site developed by CRAL. Bolton Institute
Last updated 02.08.01 RA