Controller Area Network

Controller Area Network (CAN) is a multicast shared serial bus standard, originally developed in the 1980s by Robert Bosch GmbH, for connecting electronic control units (ECUs). CAN was specifically designed to be robust in noisy environments and can utilize a differential balanced line like RS-485. It can be even more robust against noise if twisted pair wire is used. Although initially created for automotive purposes (as a vehicle bus), nowadays it is used in many embedded control applications (e.g., industrial) that may be subject to noise.

Bit rates up to 1 Mbit/s are possible at networks length below 40 m. Decreasing the bit rate allows longer network distances (e.g. 250 kbit/s at 250 m).

The CAN data link layer protocol is standardized in ISO 11898-1 (2003). This standard describes mainly the data link layer — composed of the logical link control (LLC) sublayer and the Media Access Control (MAC) sublayer — and some aspects of the physical layer of the ISO/OSI Reference Model. All the other protocol layers are left to the network designer's choice.

Contents

Data transmission

CAN transmits data through a binary model of "dominant" bits and "recessive" bits where dominant is a logical 0 and recessive is a logical 1. If one node transmits a dominant bit and another node transmits a recessive bit then the dominant bit "wins" (a logical AND between the two).

Truth tables for dominant/recessive and logical AND
Bus state with two nodes transmitting
dominant recessive
dominant dominant dominant
recessive dominant recessive
Logical AND
0 1
0 0 0
1 0 1

Commonly when used with a differential bus, a Carrier Sense Multiple Access/Collision Avoidance (CSMA/CA) scheme is implemented: if two or more devices start transmitting at the same time, there is a priority based arbitration scheme to decide which one will be granted permission to continue transmitting. Specifically, a dominant bit is asserted by creating a voltage across the wires while a recessive bit is simply not asserted on the bus.

During arbitration, each transmitting node monitors the bus state and compares the received bit with the transmitted bit. If a dominant bit is received when a recessive bit is transmitted then the node stops transmitting (i.e., it lost arbitration). Arbitration is performed during the transmition of the identifier field.

Frames

All frames (aka messages) begin with a start-of-frame (SOF) bit that, obviously, denotes the start of the frame transmission.

CAN has four frame types:

  • Data frame: a frame containing node data for transmission
  • Remote frame: a frame requesting the transmission of a specific identifier
  • Error frame: a frame transmitted by any node detecting an error
  • Overload frame: a frame to inject a delay between data and/or remote frames

Data frame

The data frame is the only frame for actual data transmission. There are two message formats:

  • Standard: with 11 identifier bits
  • Extended: with 29 identifier bits

The CAN standard requires the implementation must accept the standard format and may accept the extended format.

Standard

The frame format is as follows:

Field name Length (bits) Purpose
Start-of-frame 1 Denotes the start of frame transmission
Identifier 11 A (unique) identifier for the data
Remote transmission request (RTR) 1 Must be dominant
Identifier extension bit (IDE) 1 Must be dominant
Reserved bit (r0) 1 Reserved
Data length code (DLC) 4 Number of bytes of data (0-8 bytes)
Data field 0-8 bytes Data to be transmitted (length dictated by DLC field)
CRC 15 Cyclic redundancy check
CRC delimeter 1 Must be recessive
ACK slot 1 Transmitter sends recessive and any receiver can assert a dominant
ACK delimeter 1 Must be recessive
End-of-frame (EOF) 7 Must be recessive

One restriction placed on the identifier is that the first 7 bits cannot be all recessive bits.

Extended

The frame format is as follows:

Field name Length (bits) Purpose
Start-of-frame 1 Denotes the start of frame transmission
Identifier A 11 First part of the (unique) identifier for the data
Substitute remote request (SRR) 1 Must be recessive
Identifier extension bit (IDE) 1 Must be recessive
Identifier B 18 Second part of the (unique) identifier for the data
Remote transmission request (RTR) 1 Must be dominant
Reserved bits (r1 & r0) 2 Reserved
Data length code (DLC) 4 Number of bytes of data (0-8 bytes)
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
ACK slot 1 Transmitter sends recessive and any receiver can assert a dominant
ACK delimiter 1 Must be recessive
End-of-frame (EOF) 7 Must be recessive

The two identifier fields (A & B) combined form a 29-bit identifier. One restriction placed on identifier A is that the first 7 bits cannot be all recessive bits.

Remote frame

The remote frame is identical to the data frame except:

  • the RTR bit set to recessive
  • data length contains the number of bytes that are required from the data frame

Error frame

There are two types of error frames

- Active Error Frame

 Transmitted by a node detecting an error on the networkthat is in error state "error active".

- Passive Error Frame

 Transmitted by a node detecting an active error frame on the network that is in error state "error passive".

Overload frame

Bit stuffing

In CAN frames a bit of opposite polarity is inserted after five consecutive bits of the same polarity. This practice is called bit stuffing, and is due to the "Non Return to Zero" (NRZ) coding adopted. The "stuffed" data frames are destuffed by the receiver. Since bit stuffing is used, six consecutive bits of the same type (111111 or 000000) are considered an error. Bit stuffing implies that sent data frames could be larger than one would expect by simply enumerating the bits shown in the tables above.

ISO standards

There are several CAN physical layer standards:

  • ISO 11898-2: CAN high-speed
  • ISO 11898-3: CAN fault-tolerant (low-speed)
  • ISO 11992-1: CAN fault-tolerant for truck/trailer communication
  • SAE J2411: Single-wire CAN (SWC)

ISO 11898-2 uses a two-wire balanced signaling scheme. It is the most used physical layer in car powertrain applications and industrial control networks.

The ISO 11898-4 standard defines the time-triggered communication on CAN (TTCAN). It is based on the CAN data link layer protocol providing a system clock for the scheduling of messages.


Application layer implementations

As the CAN standard does not include tasks of application layer protocols, such as flow control, device addressing, and transportation of data blocks larger than one message, many implementations of higher layer protocols were created. Among these are DeviceNet, CANopen, SDS, J1939 and CAN Kingdom.

External links

fr:Controller area network sv:CAN-buss

Navigation

  • Art and Cultures
    • Art (https://academickids.com/encyclopedia/index.php/Art)
    • Architecture (https://academickids.com/encyclopedia/index.php/Architecture)
    • Cultures (https://www.academickids.com/encyclopedia/index.php/Cultures)
    • Music (https://www.academickids.com/encyclopedia/index.php/Music)
    • Musical Instruments (http://academickids.com/encyclopedia/index.php/List_of_musical_instruments)
  • Biographies (http://www.academickids.com/encyclopedia/index.php/Biographies)
  • Clipart (http://www.academickids.com/encyclopedia/index.php/Clipart)
  • Geography (http://www.academickids.com/encyclopedia/index.php/Geography)
    • Countries of the World (http://www.academickids.com/encyclopedia/index.php/Countries)
    • Maps (http://www.academickids.com/encyclopedia/index.php/Maps)
    • Flags (http://www.academickids.com/encyclopedia/index.php/Flags)
    • Continents (http://www.academickids.com/encyclopedia/index.php/Continents)
  • History (http://www.academickids.com/encyclopedia/index.php/History)
    • Ancient Civilizations (http://www.academickids.com/encyclopedia/index.php/Ancient_Civilizations)
    • Industrial Revolution (http://www.academickids.com/encyclopedia/index.php/Industrial_Revolution)
    • Middle Ages (http://www.academickids.com/encyclopedia/index.php/Middle_Ages)
    • Prehistory (http://www.academickids.com/encyclopedia/index.php/Prehistory)
    • Renaissance (http://www.academickids.com/encyclopedia/index.php/Renaissance)
    • Timelines (http://www.academickids.com/encyclopedia/index.php/Timelines)
    • United States (http://www.academickids.com/encyclopedia/index.php/United_States)
    • Wars (http://www.academickids.com/encyclopedia/index.php/Wars)
    • World History (http://www.academickids.com/encyclopedia/index.php/History_of_the_world)
  • Human Body (http://www.academickids.com/encyclopedia/index.php/Human_Body)
  • Mathematics (http://www.academickids.com/encyclopedia/index.php/Mathematics)
  • Reference (http://www.academickids.com/encyclopedia/index.php/Reference)
  • Science (http://www.academickids.com/encyclopedia/index.php/Science)
    • Animals (http://www.academickids.com/encyclopedia/index.php/Animals)
    • Aviation (http://www.academickids.com/encyclopedia/index.php/Aviation)
    • Dinosaurs (http://www.academickids.com/encyclopedia/index.php/Dinosaurs)
    • Earth (http://www.academickids.com/encyclopedia/index.php/Earth)
    • Inventions (http://www.academickids.com/encyclopedia/index.php/Inventions)
    • Physical Science (http://www.academickids.com/encyclopedia/index.php/Physical_Science)
    • Plants (http://www.academickids.com/encyclopedia/index.php/Plants)
    • Scientists (http://www.academickids.com/encyclopedia/index.php/Scientists)
  • Social Studies (http://www.academickids.com/encyclopedia/index.php/Social_Studies)
    • Anthropology (http://www.academickids.com/encyclopedia/index.php/Anthropology)
    • Economics (http://www.academickids.com/encyclopedia/index.php/Economics)
    • Government (http://www.academickids.com/encyclopedia/index.php/Government)
    • Religion (http://www.academickids.com/encyclopedia/index.php/Religion)
    • Holidays (http://www.academickids.com/encyclopedia/index.php/Holidays)
  • Space and Astronomy
    • Solar System (http://www.academickids.com/encyclopedia/index.php/Solar_System)
    • Planets (http://www.academickids.com/encyclopedia/index.php/Planets)
  • Sports (http://www.academickids.com/encyclopedia/index.php/Sports)
  • Timelines (http://www.academickids.com/encyclopedia/index.php/Timelines)
  • Weather (http://www.academickids.com/encyclopedia/index.php/Weather)
  • US States (http://www.academickids.com/encyclopedia/index.php/US_States)

Information

  • Home Page (http://academickids.com/encyclopedia/index.php)
  • Contact Us (http://www.academickids.com/encyclopedia/index.php/Contactus)

  • Clip Art (http://classroomclipart.com)
Toolbox
Personal tools