100% found this document useful (2 votes)
130 views14 pages

CAN Bus

sacccxc
Copyright
© © All Rights Reserved
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 (2 votes)
130 views14 pages

CAN Bus

sacccxc
Copyright
© © All Rights Reserved
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/ 14

70 Bus systems | CAN bus

#VTTZTUFNT

CAN bus to damage. As a result of these different


requirements, buses with different data
In 1991 the CAN bus (Controller Area rates are used that offer an optimum cost-
Network) was the first bus system to be benefit ratio for the field of application
introduced to a motor vehicle in mass concerned. A distinction is made between
production. It has since established itself high-speed and low-speed CAN buses.
as the standard system in the automotive
sector, but the CAN bus is also commonly High-speed CAN (CAN-C)
used as a field bus in automation engineer- CAN-C is defined in ISO Standard 11898-2
ing in general. In imitation of other net- and operates at bit rates of 125 kBit/s to
work types, such as the local area network 1 MBit/s. The data transfer is therefore
(LAN), wide area network (WAN) or per- able to meet the real-time requirements
sonal area network (PAN), this bus system of the drivetrain.
was given the name, CAN. CAN-C buses are used for networking
the following systems:
Applications • Engine-management system (Motronic

The CAN bus is used in various domains in • for gasoline engines or EDC for diesel
the motor vehicle. These domains differ in engines)
the requirements they demand of the net- • Electronic transmission control

work. Due to the fast processes involved in • Vehicle stabilization systems (e.g. ESP)

the area of engine management, informa- Instrument cluster


tion is required much faster here than in
the area of comfort/convenience where Low-speed CAN (CAN-B)
the controlled systems are located further CAN-B is defined in ISO Standard 11898-3
apart and as such lines are more prone and operates at a bit rate of 5 to 125 kBit/s.
For many applications in the comfort/con-
venience and body area, this speed is suffi-
1 Networking of electronic control units by CAN cient to meet the real-time requirements
demanded in this area. Examples of such
applications are:
ECU 1 ECU 2 ECU 3 ECU 4 • Control of the air-conditioning system

• Seat adjustment
CAN-C • Power-window unit

• Sliding-sunroof control

• Mirror adjuster

• Lighting system
Gate-
way • Control of the navigation system

The CAN bus is finding ever more use in


Diagnosis vehicle diagnostics. Here, the electronic
interface control unit is connected directly to the
CAN bus and thus receives the information
Fig. 1 ECU 5 ECU 6 ECU 7 ECU 8 it needs for diagnostics immediately. Pre-
ECU Control unit
vious diagnosis interfaces (e.g. KWP2000)
ECU 1 to ECU 4
CAN-B are becoming less important.
On the CAN-C
SVC0016E

high-speed bus
ECU 5 to ECU 11 ECU 9 ECU 10 ECU 11
On the CAN-B
low-speed bus

K. Reif (Ed.), Automotive Mechatronics, Bosch Professional Automotive Information,


DOI 10.1007/978-3-658-03975-2_6, © Springer Fachmedien Wiesbaden 2015
Bus systems | CAN bus 71

Topology Incoming messages are processed by the


Bus topology transceiver and sent to the CAN controller
In the development of the CAN, particular on the RxD line.
focus was placed on eliminating the need The microcontroller, which runs the ap-
for a central control element for communi- plication program (e.g. Motronic), controls
cation. This approach is most effectively the CAN controller, prepares the data to be
supported by a bus topology in which all sent and evaluates the data received.
network nodes are connected to a bus and
each node is able to receive all information Logic bus states and coding
sent on the bus. The bus topology is most CAN uses two states for communication,
commonly selected during the conceptual dominant and recessive, with which the
design of the communications system. information bits are transmitted. The dom-
In addition to offering favorable electri- inant state represents a binary “0”, the
cal properties, the linear bus topology recessive a binary “1”. NRZ (Non-Return to
has the advantage that the failure of one Zero) is used as the encoding method for
station would not affect the functionality the data transmission. With this method,
of the data transmission system. Further- there is no compulsory return to zero be-
more, additional stations can be connected tween two transmission states of the same
to the system with little extra effort. value.
When it receives messages, the
Star topology CAN transceiver converts the signal level
The use of a central coupler makes it pos- back to logical states. In the process, a
sible to build star topologies. Active as well differential amplifier subtracts the CAN_L
as passive couplers can be used. The use level from the CAN_H level (Fig. 3). If lines
of a star topology achieves a high level of become twisted, disturbance pulses (e.g.
flexibility in adapting to the networking from the ignition system) have the same
task. effect on both lines. Differential data trans-
The coupler is used to build a star topol- fer therefore makes it possible to filter out
ogy and simply forwards the messages to interference on the line.
the individual segments. Since the signal
transit times remain unchanged, the cir-
cuit length of the star topology is the same
as that of a bus topology.
2 Network nodes in the CAN
Data transmission system
Network nodes
Network nodes
A network node (Fig. 2) comprises the mi-
crocontroller for the application software, Actuators Microcontroller Sensors
the CAN controller and the CAN trans-
ceiver (bus driver). The CAN controller is
responsible for the transmit and receive CAN controller
modes. It generates the bit stream for CAN TxD
CAN RxD
data communication from the binary data
CAN transceiver
to be transmitted and forwards it to the
transceiver on the TxD line. This amplifies CAN_H CAN_L
the signals, generates the voltage level re-
SVC0017E

quired for differential data transfer and CAN bus


transmits the processed bit stream serially
on the bus line (CAN_H and CAN_L).
72 Bus systems | CAN bus

Some transceivers also evaluate the volt- Single-wire line


age level on the CAN_H and CAN_L line The single-wire line is a means of reducing
separately. It would then be possible for manufacturing costs by dispensing with
operation to continue in single-line mode the second line. For this to be possible,
if one of the two bus lines were to fail as however, all bus subscribers must share
a consequence of a short-circuit or cable a common ground that would assume the
break. However, the bus subscribers would function of the second line. The single-
have to share a common ground that would wire version of the CAN bus is therefore
assume the function of the failed line. only an option for a communications sys-
tem of limited spatial dimensions.
Transmission agent and bus coupling The data transfer on the single-wire line
Two-wire line is more prone to interference radiation be-
For the CAN, any transmission agent on cause it is not possible to filter out distur-
which dominant and recessive states can bance pulses as it is with the two-wire line.
be transmitted is worthy of consideration. For this reason, a higher level increase is
An untwisted or twisted pair of wires, de- required on the bus line to improve the
pending on the ambient conditions, is usu- signal-to-noise ratio. This in turn has a
ally used, and the wires are either galvani- negative effect on interference radiation.
cally coupled or decoupled. The two bus The flank steepness of the bus signals
lines are designated CAN_H and CAN_L. must therefore be reduced in comparison
The two-wire line supports symmetrical to the two-wire line. This is accompanied
data transfer whereby the bits are sent on by a lower data transfer rate. Conse-
both bus lines and represented by differ- quently, the single-wire line is only used
ent voltages. This reduces sensitivity to for the low-speed CAN in the body elec-
in-phase interference because the interfer- tronics and comfort/convenience electron-
ence affects both lines equally and can be ics. Thanks to this feature, a low-speed
filtered out. Additional shielding of the CAN with two-wire line would still remain
lines reduces their own radiation emis- functional in the event of a line failure
sions, especially at high baud rates. (CAN_H or CAN_L).

3 Filtering out interference on the CAN bus

a V

3.5 CAN high level


(CAN_H)
2.5
CAN low level
1.5
(CAN_L)

0
a V

2.0 Differential
SVC0018E

signal

0
Bus systems | CAN bus 73

Voltage level Emission limits


The CAN transceiver converts the logical To permit correct evaluation of bit trans-
states 0 and 1 received by the CAN control- mission, the signal must arrive at each
ler into voltage levels that are fed to the node within the bit time without interfer-
CAN_H and CAN_L bus lines. ence, and yet still at the relevant sampling
The high-speed and low-speed CANs use point. Delays arise from the signal transit
different voltage levels for the transmis- time on the data bus. The maximum per-
sion of dominant and recessive states. missible bit rate thus depends on the total
The voltage levels of the low-speed CAN length of the bus. ISO 11898 specifies
are shown in Figure 4a, those of the high- the bit rate for a defined circuit length.
speed CAN in Figure 4b. The following recommendations exist for
In the recessive state, the high-speed longer lines.
CAN uses a voltage of 2.5 V on both lines. • 1 MBits/s for 40 m (specified)

In the dominant state, a voltage of 3.5 V is • 500 kBits/s up to 100 m

present on CAN_H and a voltage of 1.5 V is (recommendation)


present on CAN_L. • 250 kBits/s up to 250 m

On the low-speed CAN, a voltage of 0 V • 125 kBits/s up to 500 m

is present on CAN_H in the recessive state, • 40 kBits/s up to 1,000 m

and 5 V on CAN_L. In the dominant state,


voltages of 3.6 V and 1.4 V are present on It is possible to connect at least 30 network
the CAN_H and CAN_L respectively. nodes to the bus without the need for ad-
ditional measures.
Reflection-free termination
Reflections of the electrical signals at open
ends of lines would interfere with commu-
nication. To dampen these reflections, the
bus lines are terminated at each end with
a resistor of 120 V.
Alternatively, the terminating resistors
may be integrated into the electronic con-
trol units themselves.

4 Voltage level 5 Data transmission system

a V
CAN_L
5
3.6
Node 1 Node n
1.4 (max. 30)
CAN_H
0
recessive dominant recessive
Time t CAN_H
b V
CAN_H 120V CAN bus line 120V Fig. 4
3.5
a Voltage level of
2.5 CAN_L
CAN_L the low-speed CAN
1.5
SVC0019E

SVC0020E

(CAN-B)
b Voltage level of the
recessive dominant recessive
high-speed CAN
Time t
(CAN-C)
74 Bus systems | CAN bus

CAN protocol information. To fulfill this purpose, the


Protocol layers transport layer is responsible for such
For communications protocols, it is functions as arbitration or fault detection
standard practice to arrange thematically and signaling.
coherent tasks as a set of layers, which af-
fords a high level of flexibility in the imple- Physical layer
mentation of a bus system. With the CAN, The physical layer is the lowest level in the
both the CAN hardware and the CAN soft- transport stack. It consists of the physical
ware are subdivided into several layers components of the network, such as the
(Fig. 6). wiring and the voltages used to send the
information.
Application layer
The application layer represents the infor- Multimaster principle
mation in the form of data structures used The CAN protocol supports communica-
by the application. These sets of data tion between network nodes without the
which are to be transmitted are forwarded need for a central control unit. Each node
to the object layer for this purpose. may attempt to send messages at any time.
Whether this attempt is successful or not
Object layer essentially depends on two factors:
The task of the object layer is to manage • Is the bus free before the start of trans-

the messages. The functions of this layer mission?


are used to decide which message should • Has the arbitration phase been passed
be sent at which time. For incoming mes- successfully?
sages, this layer is responsible for message
filtering. This design ensures that, even if any num-
ber of nodes were to fail, it can still be de-
Transport layer termined whether a node is authorized to
The transport layer furnishes the object send.
layer with received messages and pro-
cesses the messages prepared by the ob- Content-based addressing
ject layer for sending in such a way that Unlike other networks, the CAN does not
the physical layer is able to transmit this address the individual network nodes but
the messages that have been sent. Each
6 Protocol layers message has a unique marker, or identifier.
The identifier classifies the content of the
message (e.g. engine speed or power-win-
Application layer dow position). A station is therefore able
to broadcast a message to all other stations
(multicast or broadcast method). These
stations read only those messages whose
Object layer
identifiers are stored in their acceptance
list (message filtering, Fig. 7). In this way,
Transport layer
each station decides for itself whether or
not it needs a message sent on the bus.
The identifier has 11 bits (standard format,
CAN 2.0 A) or 29 bits (extended format,
SVC0021E

Physical layer
CAN 2.0 B). With 11 bits in the standard
format, it is possible to distinguish be-
tween 2,048 different CAN messages;
Bus systems | CAN bus 75

in the extended format, this number rises ority (lowest binary value of the identifier)
to over 536 million. is assigned first access, without any data
The advantage of this addressing loss or delay (non-destructive protocol).
method is that the network nodes do not The arbitration principle permits the
require any information about system dominant bits transmitted by a given sta-
configuration and are thus free to operate tion to overwrite the recessive bits of the
fully independently of each other. This re- other stations (Fig. 8). Each station outputs
sults in a highly flexible complete system, the identifier of its message onto the bus
which makes it easier to manage equip- bit by bit, with the most significant bit first.
ment variants. If one of the ECUs requires During this arbitration phase, each station
new information which is already on the wishing to send data compares the level
bus, all it needs to do is call it up from the present on the bus with the level it actually
bus. It is possible to integrate additional possesses. Each station that attempts to
stations into the system (provided they are send a recessive bit but encounters a dom-
receivers) without having to modify the inant bit loses the arbitration process.
existing stations. The station with the lowest identifier, i.e.
the highest priority, makes its way onto
Controlling bus access the bus without having to repeat the mes-
Arbitration phase sage (non-destructive access control).
If the bus is unoccupied (recessive state) The transmitters of lower-priority mes-
and messages are available for sending, sages automatically become recipients of
each station is free to initiate the sending the message just sent by another station.
of its message. The message begins with a They repeat their attempt to send as soon
dominant bit (start-of-frame bit), followed as the bus is free again.
by the identifier. When several stations Without this access control, bus colli-
start to transmit simultaneously, the sys- sions would result in faults. To guarantee
tem responds by employing “wired-and” unequivocal bus arbitration, therefore,
arbitration (arbiter = logical AND operator) it is not permissible for more than one
to resolve the resulting conflicts over bus node to send a message with the same
access. The message with the highest pri- identifier.

7 Addressing and message filtering 8 Bit arbitration


(acceptance check)

CAN CAN CAN CAN 1


Station 1 Station 2 Station 3 Station 4 Bus line
0
Fig. 7
1 Station 2 transmits
Accept Provision Accept Station 1
0 Stations 1 and 4 accept
the data
1
Selection Send Selection Selection Station 2
message 0 Fig. 8
1 Station 2 gains first
Station 3 access (signal on the
Reception Reception Reception 0
bus = signal from
UAE0742-2E
UAE0284-3E

Station 1 Station 3
loses the loses the station 2)
arbitration arbitration
Bus
0 Dominant level
1 Recessive level
76 Bus systems | CAN bus

With this access method, maximum-pri- • Error frame:


ority messages only have to wait for the If a station detects a fault or error, it
transfer of the message currently being communicates this to the other stations
sent and, with bit times of 130 (CAN 2.0 A) using an error frame.
or 150 (CAN 2.0 B), they have the lowest • Overload frame:
latency. At a data transfer rate of This can be used to create a delay be-
500 kBits/s, this equates to 260 µs or tween a preceding and subsequent data
300 µs. The higher the load on the bus, frame or remote frame. The transmitting
the greater the data transfer's temporal node reports that it cannot currently
offset becomes for messages of lower pri- process another frame.
ority, and thus the greater the uncertainty
over when a message to be sent will arrive For data transfer on the data bus, a mes-
at the recipient. sage frame is created. It contains the infor-
In order that all messages have a chance mation to be transmitted arranged in a
of accessing the bus, the data transfer rate defined sequence. CAN supports two dif-
must be matched to the number of bus ferent formats of frame, which are speci-
subscribers. fied in CAN 2.0 A and CAN 2.0 B. The most
important difference between these two
Priority assignments frame formats is the length of the identi-
The direct consequence of the arbitration fier. A CAN 2.0 A frame has an 11-bit iden-
process is that the identifier also has the tifier, while a CAN 2.0 B frame has a 29-bit
role of prioritizing the frame during trans- identifier divided into two parts (11 bit
mission in addition to identifying the and 18 bit).
frame content. An identifier correspond- Both formats are compatible with
ing to a low binary number has high prior- each other and can be used together in
ity and vice versa. Message priorities are a network. The frames compliant with
derived from the speed at which the mes- CAN 2.0 A and B are shown in Figure 9.
sage content changes or from the impor- They have a maximum length of 130 bits
tance of the message to safety consider- (standard format) or 150 bits (extended
ations, for example. It must not be possible format).
for messages to have the same priority.

Message format
The message transfer on the CAN bus is 9 CAN message format

based on four different frame formats:


• Data frame: Start of frame
The transmitted message contains data Arbitration field
(e.g. current engine speed) that is pro- Control field
Data field
vided by the transmitting station (data CRC field
source). ACK field
• Remote frame: End of
frame
Stations can request the data they
Inter-
need from the data source (example: frame
the windshield wiper requests how wet space
1
the windshield is from the rain sensor). IDLE 1* 12* 6* 0...64* 16* 2* 7* 3* IDLE
The data source responds by sending 0
UAE0285-3E

the relevant data frame. Data frame


Fig. 9
0 Dominant level Message frame
1 Recessive level
Bus systems | CAN bus 77

In CAN 2.0 A and CAN 2.0 B data frames, Control field


the sequence of transferred information In a CAN 2.0 A frame, the control field
is arranged in the same way. The start-of- comprises the IDE bit (Identifier Extension
frame bit is followed by the arbitration, Bit), which is always sent as dominant
control, data and CRC fields. A frame is here, followed by a reserved bit for future
completed by the ACK field and the end- extensions, which is sent recessively. The
of-frame. remaining four bits in this field define the
number of data bytes in the next data field.
Start of frame This enables the receiver to determine
The bus is recessive in idle state. The start whether all data has been received.
of frame, represented by a dominant bit, The structure of a CAN 2.0 B frame is
indicates the start of a transmission and, practically identical. However, since the
together with the process of bit stuffing, IDE bit already belongs to the arbitration
serves to synchronize all stations. field, a further reserved bit for future ex-
tensions takes its place and this reserved
Arbitration field bit is sent recessively.
With a CAN 2.0 A frame, the arbitration
field comprises the 11-bit identifier and Data field
a control bit, the RTR bit (Remote Trans- The data field contains the actual mes-
mission Request). sage information comprised of between
With a CAN 2.0 B frame, the arbitration 0 and 8 bytes. A data field in which the
field comprises the 11-bit identifier, fol- length of the data is expressed in 0 results
lowed by the SRR bit (Substitute Remote in the shortest possible data frame with
Request) and the IDE (Identifier Extension a length of 44 or 64 bits. A frame like this
Bit). Both bits are sent recessively and can be used to synchronize distributed
thereby ensure that a CAN 2.0 A frame processes. A number of signals can be
always takes priority over a CAN 2.0 B transmitted in a single message (e.g. en-
frame if it has the same 11-bit identifier. gine temperature and engine speed).
The second 18-bit identifier follows. The
RTR bit completes the arbitration field. CRC field
The RTR bit indicates whether the trans- The CRC field (Cyclic Redundancy Check-
mitted frame is a data or remote frame. sum) contains a 15-bit checksum (frame
The RTR bit is dominant in the data frame check word) across the preceding frame
and recessive in the remote frame. If sta- from the start bit to the final bit of the data
tion A, for example, happens to send a field. The 16th bit (CRC delimiter) in this
message by data frame and station B re- field is recessive and closes the checksum.
quests this message by remote frame at The checksum is a means of detecting
the same time, the arbitration conflict can- possible transmission interference.
not be resolved in this situation by means
of the message identifier: the RTR bit is the ACK field
decisive factor for access authorization. Unlike all preceding fields, the ACK field
First of all, station A wins arbitration (acknowledgment) is not set by the sender
with the sending of the dominant RTR bit of the frame but by a different node that is
and continues to transmit the message. able to acknowledge receipt of the frame
Station B, which has requested precisely directly after the data field. This field
this message, prepares to receive and comprises the ACK slot and the recessive
is able to read the other data sent by ACK delimiter. The ACK slot is also trans-
station A. mitted recessively by the sender and over-
78 Bus systems | CAN bus

written as dominant by a receiver upon the Cyclic redundancy check


message being correctly received. Here, it For every transmitted message, the trans-
is irrelevant whether the message is of any mitter calculates a check sequence from
significance for the particular receiver in the start-of-frame, arbitration, control and
the sense of an acceptance check (message data field. A 15-bit checksum is derived
filtering). Only correct receipt is con- from the bit sequence by means of a gener-
firmed. This signals to the sender that no ator polynomial. The checksum is then
malfunction occurred during data transfer. used to detect errors in the data transfer.
With CRC generation, a defined genera-
End of frame tor polynomial is used to carry out poly-
The end of frame marks the end of the nomial division across a given frame
message and comprises seven recessive range. The remainder forms the checksum.
bits. With seven bits of the same value in Once the CRC field has been received,
succession, the stuffing rule is deliberately the receiver is able to check that the frame
broken (see Error detection). has been transferred correctly by carrying
out its own polynomial division of the re-
Interframe space ceived frame range using the generator
The interframe space comprises a succes- polynomial and checking whether the re-
sion of three recessive bits which serve to ceived checksum matches the calculated
separate successive messages. After a total remainder.
of 10 of these recessive bits, the stations
are permitted to begin transmitting within Frame check
the network again. Until then, the bus re- The frame check involves all bus subscrib-
mains in idle state. ers, senders as well as receivers, checking
Only data and remote frames need to the sent/received data frame for compli-
include the interframe space. Error and ance with the predefined frame structure.
overload frames can be sent immediately The CAN protocol contains a number of
after the last frame. This enables immedi- fixed-format fields (start and end-of-
ate signaling of errors and problems. frame, delimiter) which are checked
by all stations.
Transmitter initiative
The transmitter will usually initiate a data ACK check
transmission by sending a data frame. It is With the ACK check, a receiver acknow-
also possible for a receiving station to call ledges that the frame has been received
in data from a sending station by deposit- correctly by sending a dominant bit in the
ing a remote frame. The network node ACK slot. The sender of the frame can then
that is able to deliver the information re- verify whether a message was transferred
quested makes the information available correctly. An absence of this bit indicates
in response to this query. that a transmission error has been de-
tected.
Error detection
The bus line may suffer interference, e.g. Monitoring
electromagnetic interference. To eliminate The sender of a frame continuously moni-
the risk of faulty behavior, the transmitted tors the bus level. It is able to detect a
data must be checked for correctness. transmission error by comparing the
A number of control mechanisms for sent bit and the sampled bit.
detecting errors are integrated in the
CAN protocol.
Bus systems | CAN bus 79

Bit stuffing Fault confinement in the event of failures


Compliance with bit stuffing is checked by Defective stations could weigh heavily on
means of the code check. The stuffing con- bus traffic if they were to frequently send
vention stipulates that in every data frame erroneous messages or interrupt the trans-
or remote frame a maximum of five suc- mission of correct messages by repeatedly
cessive bits of equal state may be sent be- sending an error frame. The CAN protocol
tween the start of frame and the end of localizes station failures by means of
the CRC field. As soon as five identical bit statististical error analysis. A station rec-
states have been transmitted in succes- ognizes the probability of its own malfunc-
sion, the sender includes a bit with the op- tion by how often it aborts messages be-
posite state. The receiving station clears fore other stations send an error frame.
all of these inserted bits after the message The protocol's first measure in this case
has been received (destuffing). is to prevent a station such as this from
This measure permits detection of line continuing to abort transmissions. In an
faults, e.g. short-circuit or burst interfer- emergency, the station shuts down auto-
ence. Rare signal changes would affect matically.
the possibility for synchronization in the
nodes.

Error handling
If a CAN controller detects a fault or for-
mat error, it interrupts the current trans-
mission by sending an error frame com-
prising six successive dominant bits. This
breaks the stuffing rule that prohibits this
type of bit sequence. If the sender detects
that its message has been interrupted by
an error frame, it stops transmitting and
makes another attempt at a later time.
This effect prevents other stations from
accepting the erroneous message and
thereby ensures consistency of data
across the entire system.
80 Bus systems | CAN bus

Hardware If messages on the bus are managed in


CAN controller of a subscriber extended format (29-bit identifier), the
The CAN controller of a subscriber gener- CAN controllers must be compatible with
ates a frame from the data to be sent con- the CAN 2.0 B specification. There are
taining all the fields required for compli- controllers that only support CAN 2.0 A
ance with the CAN protocol. It then con- and send and receive messages in the
verts the frame into a bit stream. standard format, but that generate errors
CAN only specifies the physical, trans- with messages in the extended format.
portation and object layers. The interfaces Other controllers are able to tolerate the
that are provided in the application layer extended format without generating an
can be arranged differently to suit the field error. These modules can be used in a CAN
of application. In order to provide proper together with controllers that administer
CPU support (electronic control unit mi- the sending and receiving of messages in
crocontroller for application software) for the extended format.
a wide range of different requirements,
semiconductor manufacturers have Basic CAN
brought onto the market products that In modules with basic-CAN implementa-
provide a variety of capabilities. They dif- tion, only the basic function of the CAN
fer neither in the frame format they pro- protocol for the generation of the bit
duce, nor in their error-handling methods, stream is implemented in the hardware.
but solely in the type of CPU support re- For the management of the messages to be
quired for message administration. sent and received, there is an intermediate

10 Basic-CAN module 11 Full-CAN module

Microcontroller Microcontroller
Output Input
buffer buffer
CAN
controller
Control
unit
System bus interface
Transmission Test for: Control
control unit acceptance, unit
faults
Transmit Receive
buffer buffer
Basic CAN
controller Transmission Test for:
Transmit Receive control unit acceptance,
buffer buffer faults

CAN TxD CAN TxD


CAN RxD CAN RxD

CAN transceiver CAN transceiver

CAN_H CAN_L CAN_H CAN_L


SVC0023E
SVC0022E

CAN bus CAN bus


Bus systems | CAN bus 81

buffer to which the local computer (appli- Modules without local computer
cation software microcontroller) has ac- A further category of CAN module is one
cess (Fig. 10). Since the buffer capacity that is supplied without a local computer.
is limited, the computer must read the These SLIOs (Serial Linked Input/Output)
received data before new messages are are able to input and output data via ports.
received. Message filtering also takes They are therefore suitable for making
place in this computer. A part of the sensors and actuators bus-compatible at
computer's capacity is therefore used for low cost, but they do need a master that
CAN management. Since the computers controls them.
do not usually have sufficient processing
capacity, modules with basic CAN are pri- Transceiver
marily suitable for low bit rates, or for the The bit stream generated by the CAN con-
transmission of fewer messages but at troller is made up of binary signals. They
higher bit rates. do not yet correspond to the required volt-
The advantage of these modules, in com- age levels of the CAN bus. The CAN-bus in-
parison to modules with full CAN, is the terface module, or transceiver, generates
smaller chip surface and the lower manu- the differential signals CAN_H and CAN_L
facturing costs. and the reference voltage Uref from the
binary data stream.
Full CAN
Full CAN implementation is the protocol of Sleep mode
preference in cases where a station has to The CAN comfort bus must remain ready
manage several messages at high bit rates for operation even with the ignition
and the local computer has no free capac- switched off so that functions such as the
ity for communication tasks. They contain radio, power windows or parking lamp
several “communication objects”, each of may continue to operate. The bus sub-
which contains the identifier and the data scribers must therefore be supplied by
of a particular message. During the initial- terminal 30 (permanent positive). After
ization of the CAN module by the local terminal 15 has been switched off (ignition
computer, it is decided which messages off), a CAN node may enter sleep mode
the CAN controller should send and which (standby) to relieve the vehicle electrical
received messages it should process fur- system of as much load as possible. The
ther. Received messages are only accepted transmitter part of the transceiver module
(message filtering) if the identifier matches is switched off in this condition to mini-
one of the communication objects. mize the power consumption in this mode
CAN controllers with full-CAN imple- of operation. However, the receiver part
mentation relieve the burden on the local remains active and checks whether mes-
computer by performing all of the commu- sages are being sent on the bus. In this
nication including message filtering in the way, the CAN controller, which also enters
controller (Fig. 11). standby mode, is able to react to a wake-up
The CAN controller can be coupled to message and fully activate the CAN node.
the microcontroller in the electronic con-
trol unit as a stand-alone module by the
address/data bus. Powerful microcon-
trollers have the CAN controller integrated
on-chip. This type of bus coupling is the
more cost-effective and thus the more
common solution.
82 Bus systems | CAN bus

Data transfer sequence Once the engine-speed information has


Using the transfer of engine speed as an been stored in the transmit buffer, the
example, it shall be demonstrated how CAN controller begins to compile the CAN
data is transferred on a CAN with full-CAN frame. Over the RxD line, the CAN con-
module. troller now monitors the bus. If the bus is
free, it immediately starts to generate the
Transmission bit stream and directs it to the transceiver
The engine management's application soft- on the TxD line; if the bus is occupied, it
ware calculates the engine speed from the waits. From the bit stream, the transceiver
signal from the engine-speed sensor. This creates a signal with the requisite voltage
value is calculated once for every combus- level.
tion cycle. The measured value enters both
the receive buffer and the transmit buffer Reception
of the microcontroller (Fig. 12a). The message originally sent by the engine
The engine-management microcon- management and forwarded on by the
troller is coupled to the CAN controller transceiver is received by all stations
by a parallel interface. The contents of connected to the bus (Fig. 12b). The mes-
the transmit buffer are cyclically passed sage reaches the CAN controller on the
(e.g. every 10 ms) to the transmit buffer RxD lines in the form of a bit stream.
of the CAN controller. A flag notifies the At the first stage (monitoring layer),
CAN controller that a message is ready the CAN controller checks the incoming
to be sent. With this transmit instruction, message for errors using the CRC check-
the engine management has completed its sum. If the message is free of errors, each
part of the task.

12 Data transfer sequence

a b
Engine control unit ABS control unit Instrument cluster
Microcontroller Microcontroller Microcontroller
n n
Rev
counter
output

CAN
area n n

CAN controller CAN controller CAN controller


Transmit Transmit Transmit
buffer buffer buffer

RX TX RX TX RX TX
Transceiver
SVC0024D
SVC0024E

CAN bus
Bus systems | CAN bus 83

station responds with an acknowledge CAN is also widely used in industrial auto-
(ACK check). mation. These applications are supported
At the second stage, or acceptance layer, by an alliance of companies in the “CAN in
the message undergoes message filtering. Automation” users group (CiA).
Each station checks whether the received Bosch has concluded contracts with its
identifier is addressed to the particular licensees that guarantee that any CAN im-
station and whether the message is re- plementations will be able to communicate
quired in the application software. If not, with each other. Users will be able to rely
the message is rejected. Otherwise, it on the interaction of any CAN modules.
makes its way to the receive buffer. A flag
notifies the application software that a Characteristics
new message is ready for processing. • Standardized in accordance with
The instrument cluster, for example, ISO 11898
calls up the available message, processes • Prioritized communication

the engine-speed information and calcu- • Data transfer rates: up to 1 MBits/s

lates triggering signals for the actuator of • Data capacity: up to 8 bytes per message
the rev counter. • Real-time response: the data protocol is
sufficient for the real-time requirements
Standardization in the motor vehicle
The International Organization for Stan- • Non-destructive bus-access method
dardization (ISO) and SAE (Society of Au- • Low power consumption
tomotive Engineers) have issued CAN stan- • Flexibility of configuration

dards for data exchange in automotive ap- • Simple and economical design with

plications: twisted line pairs


• For low-speed applications up to • Very high reliability of data transfer
125 kBit/s: ISO 11 519-2 and 11 898-3 • Fault detection and signaling
• For high-speed applications faster than • Localizing of failed stations
125 kBit/s: ISO 11 898-2 and SAEJ 22 584 • Handling of intermittent and permanent
(passenger cars) or SAEJ 1 939 (commer- faults
cial vehicles) • Short-circuit resistance
• An ISO Standard for diagnosis via CAN • The number of nodes is theoretically un-
has also been published as ISO 15 765 limited. However, a limit arises in prac-
tice from the capacitive load of the bus
Standardization makes it possible for and the increasing latencies of messages
components of different manufacturers when a high number need to be sent.
to function together. No adaptations are
required.

You might also like