| The message arbitration (the process in which two or more CAN
controllers agree on who is to use the bus) is of great importance
for the really available bandwidth for data transmission.
Any CAN controller may start a transmission when it has detected
an idle bus. This may result in two or more controllers starting a
message (almost) at the same time. The conflict is resolved in the
following way. The transmitting nodes monitor the bus while they are
sending. If a node detects a dominant level when it is sending a
recessive level itself, it will immediately quit the arbitration
process and become a receiver instead. The arbitration is performed
over the whole Arbitration Field and when that field has been sent,
exactly one transmitter is left on the bus. This node continues the
transmission as if nothing had happened. The other potential
transmitters will try to retransmit their messages when the bus
becomes available next time. No time is lost in the arbitration
process.
An important condition for this bit-wise arbitration to succeed
is that no two nodes may transmit the same Arbitration Field.
There is one exception to this rule: if the message contains no
data, then any node may transmit that message.
Since the bus is wired-and and a Dominant bit is logically 0, it
follows that the message with the numerically lowest Arbitration
Field will win the arbitration.
Q: What happens if a node is alone on the bus and
tries to transmit?
A: The node will, of course, win the arbitration and happily
proceeds with the message transmission. But when the time comes for
acknowledging... no node will send a dominant bit during the ACK
slot, so the transmitter will sense an ACK error, send an error
flag, increase its transmit error counter by 8 and start a
retransmission. This will happen 16 times; then the transmitter will
go error passive. By an special rule in the error confinement
algorithm, the transmit error counter is not further increased if
the node is error passive and the error is an ACK error. So the node
will continue to transmit forever, at least until someone
acknowledges the message.
|