![]() |
E-learning
Resources in Microelectronics
CAN Bus |
Universität Paderborn |
Document
Information
|
1. General
|
|
|
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:
- Line structure with passive bus coupling
- Number of subscribers depends only on the capacity of driver modules
- Width of the bus system depends on bit rate which is maximal 1 Mbaud (40m at 1 Mbaud; 500m at 125 kbaud; 1000m at 50 kbaud)
- Media can be twisted pair line or optical waveguide
- Object oriented messages, broadcasting and multicasting with acceptance check
- Multi-master network
- Bus access by bitwise arbitration at CSMA/CA method (real time ability for high priority messages)
- Very high data privacy (HD=6) due to error detection and signalling. Automatic shutdown of defective stations
- Different chips and microcontrollers support the protocol
- Open system (ISO 11898 and CiA DS 301)
Figure 1. CAN bus structure
2.1 Principle of data exchangeThe 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.
- CRC (Cyclic Redundancy Check): The 15–bit check sum used gives a high likelihood of detecting erroneous messages with a Hamming distance of HD = 6.
- Frame check: The CAN protocol possesses over several fixed defined bits inside the message. All subscribers monitor those bits by a message frame check.
- ACK - error: Each message has to be acknowledged as faultless by at least one receiver. The sender monitors the ACK-slot and a missing acknowledgement is interpreted as an error by the sender.
- Monitoring: A bit monitoring is made. Each sending station receives the sent bit back again. If both values are not the same, a bit error is detected. No checks takes place only during the arbitration phase and acknowledgement phase.
- Bit - stuffing: Each bus subscriber monitors the rule of bit coding whereby after 5 similar bits a different bit must follow.
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
- PROFIBUS DP
- PROFIBUS DPV1
- PROFIBUS PA due to low power management
- CANopen
- DEVIVENet
- Different serial protocols
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
To link to the VPC 16 data sheet at the Profichip GmbH site, click here.
![]() |
|
![]() |