100% found this document useful (1 vote)
123 views7 pages

Theory: CAN-Bus: 1 General Information

The document provides an overview of the CAN bus system, including: 1) CAN was developed by Bosch in the 1980s for automotive applications to enable communication between electronic components with strict timing requirements using small data packets. 2) CAN uses a bus topology and CSMA/CA access method to avoid collisions. Frames are prioritized based on identifiers to determine transmission priority. 3) The CAN protocol defines frame formats for data, remote, error, and overload frames and includes mechanisms like CRC, bit stuffing, and monitoring to ensure reliability.

Uploaded by

Dileep Kumar
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
123 views7 pages

Theory: CAN-Bus: 1 General Information

The document provides an overview of the CAN bus system, including: 1) CAN was developed by Bosch in the 1980s for automotive applications to enable communication between electronic components with strict timing requirements using small data packets. 2) CAN uses a bus topology and CSMA/CA access method to avoid collisions. Frames are prioritized based on identifiers to determine transmission priority. 3) The CAN protocol defines frame formats for data, remote, error, and overload frames and includes mechanisms like CRC, bit stuffing, and monitoring to ensure reliability.

Uploaded by

Dileep Kumar
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Universitt Stuttgart Institute of Industrial Automation and Software Engineering

Prof. Dr.-Ing. Dr. h.c. P. Ghner

Theory: CAN-Bus
1 General Information
1.1 History
The abbreviation CAN stands for Controller Area Network. This bus system was developed by the Robert Bosch GmbH in the 1980s. The original area of application was the automotive sector. The reason for developing was the increasing share of controller and automating technology (ABS, ASR) that required a communication between different components. The foundations were laid by the high quantities and a wide distribution. This caused that meanwhile CAN is applied in wide areas that need a field bus.

1.2 Basics
There are strict temporal requirements in the area automobile electronics, as well as a lively data exchange i.e. a high number of communication process but only small data packets (todays extension: navigation system etc. other communication systems necessary) Minimization of wiring effort High error safety (fail-safe), robustness Small latency time (i.e. time between desired start of sending and actual start of sending is as small as possible) Distributed systems, several receiver Good extensibility Priorization of messages Lower-cost

In order to reduce the wiring effort the only choice was a bus system. The Robert Bosch GmbH realized the requirements in a protocol, the CAN protocol.

Industrial Automation

Theory: CAN-Bus

1 Mb, 27/04/2006

Industrial Automation

Theory: CAN-Bus

1.3 Overview ISO / OSI Layer Model

Application Layer (7)

Layer 7: Execution of the field bus tasks

Presentation Layer (6) Session Layer (5) Transportation Layer (4) Network Layer (3) Data Link Layer (2)
Layer 2: Bus access, frame format and testing, addressing Layer 1:
Definition of transmission medium and plug-andsocket connection, level, coding, bit rate

Physical Layer (1)

Out of the 7 layers, only the blue colored ones ( 1, 2, and 7 ) are considered for field busses

Industrial Automation

Theory: CAN-Bus

2 Mb, 27/04/2006

Industrial Automation

Theory: CAN-Bus

2 Description of CAN
2.1 OSI Layer 1: physical layer
In principle, CAN is designed for serial data transmission in a bus topology. But the CAN specification doesnt determine the transmission medium. In the ISO standards it was planned that the transmission medium for CAN is an electrical differential two-wired line. However, in case of an error the transmission can also take place with a one-wired line and the same reference potential (ground). The advantage of the differential voltage transmission on a twowired line compared to a one-wired line is the low liability to potential differences and interferences on the line.

2.2 OSI-Layer 2a: MAC = Media Access Control


The CAN bus is using CSMA/CA (Carrier Sense Multiple Access / Collision Avoidance) as access method. It is working with the following scheme: Each participant that wants to send listens if the bus is occupied ( carrier sense) and starts the sending process when the bus was idle for a certain time. There is the possibility that several participants start to send at the same time ( multiple access). The resolving of an eventually appearing collision is carried out as part of the arbitration process. Hereby all the affected participants start by putting their frames (starting with the identifier) bit by bit on the bus. After each bit the sender checks if the actual level on the bus corresponds with the level that it applied on the bus. If not it stops sending immediately. This results that message with the highest priority gains the bus access without the destruction of the message (collision avoidance). The realization of the dominant and the recessive levek can be explained by a wired-and circuit. 0 (L-level) corresponds with the dominant level as the whole bus is brought to the ground when there is a ground connection. The logic 1 (H-level) represents the recessive level that isnt hold by an existing ground connection.
level S1 S2 S3 Bus 0 0 0 0 1 0 0 0 0 1 0 0 1 1 0 0 0 0 1 0 1 0 1 0 0 1 1 0 1 1 1 1

5V

bus

S1

E1

S2

E2

S3

E3

Figure 1: wired-and Circuit

Industrial Automation

Theory: CAN-Bus

3 Mb, 27/04/2006

Industrial Automation

Theory: CAN-Bus

2.3 OSI-Layer 2b: LLC- Logical Link Control


The communication on the bus is based on four different frame formats: 1.) Data Frame The data frame transfers data from a transmitter to one or more receivers on the data sources ( transmitter) initiative.

RTR-Bit (Remote-Transmission-Request) recessive

delimiter bit

dominant

number 1 of bits

11 1 object identifier

0 ... 64 data field control field

15 1 1 1

CRCsegment

7 End-ofFrame field

Interframe Space

arbitration field Start-of-Frame-Bit CRC-field

ACK Slot Acknowledge field

Data Frame format request frame: RTR-Bit= 1 no data field

Figure 2: data frame format

Start of Frame: Arbitration field: Control field: Data field: CRC-field: ACK-field:

End of Frame:

1 dominant bit to identify start 11 bit identifier + 1 bit RTR (remote transmission request bit) 2 bits reserved for extended CAN, 4 bits for data length 0-8 byte of data possible, starting with MSB 15 bit generator polynom (x15+x14+x10+x8+x7+x4+x3+1) + 1 recessive CRC delimiter bit 1 bit ACK-slot + 1 bit ACK delimiter (recessive): transmitter sends recessive bit in the slot; recipients that received error free,send a dominant bit in the slot. 7 bit

In total the minimum frame length results in 44 bits. Additionally are the 0-64 data bits and potentially stuff bits.
Industrial Automation Theory: CAN-Bus 4 Mb, 27/04/2006

Industrial Automation

Theory: CAN-Bus

2.) Remote Frame A participant of the bus uses the remote frame to trigger the sending of a special data frame with the same identifier by a data source. Data frame and remote frame only differ in a varying RTR bit ( RTR bit of remote frame =1, RTR bit for data frame=0 ) and a missing data field of the remote frame. This results that the data frame will prevail when there is a simultaneous request and transmission of a frame. 3.) Error Frame If a participant of the bus recognizes an erroneous frame ( e.g. wrong checksum in CRC field), it reports this by sending an error frame. Therefore a sequence ( 6 bits with the same polarity) that isnt permissible during normal operation is switched on the bus. This implicates that all the other ( fully functional node) switch themselves an error frame on the bus as the bit stuffing rule was violated. An error frame is terminated with 8 recessive bits. 4.) Overload Frame An overload frame is used to enlarge the spacing between two frames. It can only be send at the beginning of the spacing. By switching of 6 dominant bits (overload flag) on the bus the defined form of the spacing is destroyed and overload is signalized. As a result all the nodes are also sending overload frames.

2.4 OSI Layer 7: Applications


While layer 1 and 2 are already intended for international standardizations (ISO-DIS 11 898 und ISO-DIS 11 519), there is not yet a norm for the application layer. The introduction of a layer 7 the application process can be completely uncoupled from the communication processes. The organization for users CiA e.V. has the ambition to precipitate a consistent application layer definition in order to access a uniform language for the development of distributed applications. It should enable the communication between CAN modules of different manufacturers. Further information can be found in the book of Konrad Etschberger CAN-Controller Area-Network Grundlagen, Protokolle, Bausteine, Anwendungen printed in 1994 by Carl Hanser Verlag Mnchen.

2.5 Safety Mechanisms:


In order to reduce the fault liability of the CAN bus the following safety mechanisms are realized:

1.) Bit Monitoring Each transmitting network node monitors whether or not the bus level it has transmitted is actually present on the bus. Otherwise a fault has appeared that has to be dissolved or the sending process has to be terminated (arbitration phase). 2.) Frame Format Check As the frame format is fixed, every participant of the bus can check whether this format is maintained ( e.g. recessive delimiter bits). Otherwise a fault is existent.

Industrial Automation

Theory: CAN-Bus

5 Mb, 27/04/2006

Industrial Automation

Theory: CAN-Bus

3.) Cyclic Redundancy Check The transmitted message is secured again by CRC. Thereby the message is divided by a special polynominal generator and the result is deposit in the CRC field. The message is divided again by this polynominal generator by the receiver and the result is compared with the transmitted CRC field. If there are not identical a transmission error has appeared. (polynominal generator x15+x14+x10+x8+x7+x4+x3+1) 4.) Bit-Stuffing The CAN protocol uses the NRZ bit coding ( non-return to zero). But this means that there are longer phases without bit edges for synchronization. To avoid this an inverted stuff bit is set after 5 bits of the same polarity. This bit permits the synchronization of every node and is deleted when received.

2.6 Extended Bit Time Model


nominal bit time

signal propagation segment synchronization segment

phase phase segment 1 segment 2

Figure 3 : Bit Time Model of CAN The bit time of a CAN message consists of several controller time units and may / must be adapted to the network. One time unit corresponds the cycle time of the oscillator on the controller. Synchronization Segment 1 time unit, receiver starts internal bit timing Signal Propagation Segment 1..8 time units, absorbs double signal propagation time and electrical switching time Phase Segment 1 1..8 time units, serves for after-synchronization if the oscillator on the sender site is slower as the oscillator on the receiver side Phase Segment 2 Maximum value from phase segment 1 and information process time
Industrial Automation Theory: CAN-Bus 6 Mb, 27/04/2006

Industrial Automation

Theory: CAN-Bus

serves for after-synchronization if the oscillator on the sender site is slower as the oscillator on the receiver side

3 Appendix
3.1 Different Specifications
At first it must be differentiated between CAN controller of the specification 2.0A and 2.0B. 2.0A defines an identifier of 11 bits; so it can be distinguished between 2032 types of messages (the restriction opposite to the theoretical possible value of 2048 is determined by the Intel controller with restricted processing). The Extended CAN version 2.0B features an identifier of 29 bits with which over 500 million different types of messages can be defined. Indeed 2.0A and 2.0B controller can be operated in a CAN network at the same time, however only by using the 11 bits identifier.

3.2 Controller Versions


In consideration of the implementation of the CAN protocol BasicCAN and FullCAN are differentiated. Both concerns the message filtering of the network. As the messages dont involve a target address but send by broadcast over the whole network every node has to decide which messages are interesting for it and to filter them out by acceptance filter. In FullCAN the CAN controller performs this filtering on its own; in BasicCAN the task is transferred to the succeeding micro controller. But this doesnt affect the basic communication so both types can be mixed in one network.

Industrial Automation

Theory: CAN-Bus

7 Mb, 27/04/2006

You might also like