Emb Mod3 Part 2
Emb Mod3 Part 2
PROTOCOLS Part 2
BUS PROTOCOL
EMBEDDED SYSTEMS CAN
DR BINU PAUL , EMB
CAN – CONTROLLER AREA NETWORK
CAN
To improve the behavior of the vehicle even further, it was necessary for the
different control systems (and their sensors) to exchange information. This was
usually done by discrete interconnection of the different systems (i.e. point to
point wiring). The requirement for information exchange has then grown to such
an extent that a cable network with a length of up to several miles and many
connectors was required. This produced growing problems concerning material
cost, production time and reliability .
BEFORE CAN
CAN
• point-to-point wiring is
replaced by one serial
bus connecting all
control systems.
• CAN-specific hardware
to each control unit that
provides the "rules" or
the protocol for
transmitting and
receiving information via
the bus.
Cheap CAN controller – CPU could get overrun with messages even if it
didn’t need them.
Newer version use hardware filters to reorganise the received data
Remote transmission request (RTR) 1 Must be dominant (0) for DATA frame
Data field 0-8 bytes Data to be transmitted (length dictated by DLC field)
CRC 15 Cyclic redundancy check
CRC delimiter 1 Must be recessive (1)
Transmitter sends recessive (1) and any receiver can
ACK slot 1 assert a dominant (0)
ACK delimiter 1 Must be recessive (1)
End-of-frame (EOF) 7 Must be recessive (1)
CAN bus
Dr Binu paul , EMB
As a node transmits each bit, it verifies that it sees the same bit value on the bus
that it transmitted.
A “0” on the bus wins over a “1” on the bus.
Losing node stops transmitting, winner continues.
Bit-wise arbitration to control access to the bus each message is tagged with a
priority
(the one that sends a “0” bit first as its identifier, after start of frame wins the bus)
Dr Binu paul , EMB
CAN BUS OVERVIEW
Error Frame
Error Frame is a special message that violates the framing rules of a CAN
message
The Error Frame consists of an Error Flag, which is 6 bits of the same value
(thus violating the bit-stuffing rule) and an Error Delimiter, which is 8
recessive bits( “1”)
Overload Frame
It is very similar to the Error Frame with regard to the format and it is
transmitted by a node that becomes too busy.
At present obsolete
Today's CAN controllers are clever enough not to use it
END OF PRESENTATION
The Remote Frame is just like the Data Frame, with two important differences:
It is explicitly marked as a Remote Frame (the RTR bit in the Arbitration Field is recessive), and
there is no Data Field.
The intended purpose of the Remote Frame is to solicit the transmission of the
corresponding Data Frame. If, say, node A transmits a Remote Frame with the
Arbitration Field set to 234, then node B, if properly initialized, might respond with a
Data Frame with the Arbitration Field also set to 234.
Remote Frames can be used to implement a type of request-response type of bus
traffic management. In practice, however, the Remote Frame is little used. It is also
worth noting that the CAN standard does not prescribe the behaviour outlined here.
Most CAN controllers can be programmed either to automatically respond to a
Remote Frame, or to notify the local CPU instead.
Simply put, the Error Frame is a special message that violates the framing rules of a
CAN message. It is transmitted when a node detects a fault and will cause all other
nodes to detect a fault - so they will send Error Frames, too. The transmitter will then
automatically try to retransmit the message. There is an elaborate scheme of error
counters that ensures that a node can't destroy the bus traffic by repeatedly
transmitting Error Frames.
The Error Frame consists of an Error Flag, which is 6 The Error Frame
bits of the same value (thus violating the bit-stuffing
rule) and an Error Delimiter, which is 8 recessive bits.
The Error Delimiter provides some space in which the
other nodes on the bus can send their Error Flags
when they detect the first Error Flag.