AP29000
Connecting C166 and C500 Microcontroller to CAN
The Controller Area Network (CAN)
Application Note
10
V 1.0, 2004-02
3.2
Addressing and Bus Arbitration
In the CAN protocol it is not bus nodes that are addressed, but the address information
is contained in the messages that are transmitted. This is done via an identifier (part of
each message) which identifies the message content (e.g. engine speed, oil
temperature etc.) The identifier additionally indicates the priority of the message. The
lower the binary value of the identifier the higher is the priority of the message.
For bus arbitration, CSMA/CD with NDA is used (Carrier Sense Multiple Access /
Collision Detection with Non-Destructive Arbitration). If bus node A wants to transmit a
message across the network, it at first checks that the bus is in the idle state ("Carrier
Sense") i.e. no node is currently transmitting. If this is the case (and no other node
wishes to start a transmission at the same moment) node A becomes the bus master
and sends its message. All other nodes switch to receive mode during the first
transmitted bit (Start Of Frame bit). After correct reception of the message (which is
acknowledged by each node) each bus node checks the message identifier and stores
the message, if required. Otherwise, the message is discarded.
If two or more bus nodes start their transmission at the same time ("Multiple Access"),
collision of the messages is avoided by bitwise arbitration ("Collision Detection / Non-
Destructive Arbitration" together with the "Wired-AND" mechanism, "dominant" bits
override "recessive" bits). Each node sends the bits of its message identifier (MSB
first) and monitors the bus level. A node that sends a recessive identifier bit but reads
back a dominant one loses bus arbitration and switches to receive mode. This
condition occurs when the message identifier of a competing node has a lower binary
value (dominant state = logic 0) and therefore the competing node is sending a
message with a higher priority. In this way, the bus node with the highest priority
message wins arbitration without losing time by having to repeat the message. All
other nodes automatically try to repeat their transmission once the bus returns to the
idle state. It is not permitted for different nodes to send messages with the same
identifier as arbitration could fail leading to collisions and errors.
The original CAN specifications (Versions 1.0, 1.2 and 2.0A) defined the message
identifier as having a length of 11 bits giving a possible 2048 message identifiers. The
specification has since been updated (to version 2.0B) to remove this possible
limitation. CAN specification Version 2.0B allows message identifier lengths of 11
and/or 29 bits to be used (an identifier length of 29 bits allows over 536 Million
message identifiers). Version 2.0B CAN is often referred to as "Extended CAN", the
versions below (1.0, 1.2 and 2.0A) being referred to as "Standard CAN" (see section
2.6.1 for further details).