The CAN bus

To enable two systems to communicate with each other, two prerequisites must be met. You need a physical medium and a communication protocol. It's the same for humans: the medium is paper, computer or voice, and the protocol is language, with its rules of etiquette.

  • The physical medium of the CAN bus (in our case) simply consists of two twisted wires, also known as a twisted pair. The ground reference is passed via the power supply.
  • The CAN protocol defines the exchange rules between the various nodes (transmission authorization, frame composition, error handling, etc.).

Origins of the CAN bus

The CAN (Controller Area Network) bus protocol was first introduced in the automotive industry. When the length of the cables in a vehicle reaches 2Km, all these information exchanges have to be optimized!

At the end of the last century (and even the last millennium), the CAN bus was standardized, and has since been adopted by the aeronautics industry. In an Airbus, several dozen CAN buses circulate between the cockpit and the tail of the aircraft.

CAN bus characteristics

The CAN bus offers :

  • bidirectional communication (each connected module can communicate with all the others);
  • virtually zero risk of error in frame transmission;
  • prioritization of urgent information to be transmitted (arbitration principle);
  • a transmission error management system supported by the CAN protocol, completely transparent to the developer;
  • no loss of time in the event of a conflict between two modules, since the module with the highest priority retains control and continues transmitting while the "loser" listens;
  • a bus length of up to 5Km;
  • inter-connection of up to a hundred nodes in standard mode (with a maximum speed of 1Mbps and a bus length of no more than 30m);
  • each node is connected to the bus by a twisted pair (2 wires transmit data in differential mode, i.e. much less sensitive to interference);
  • the possibility of adding new nodes to the bus, requiring only the modification of the loopback resistor (end jumper on the IBC board) in the case of a bus extension.

Diagram of a CAN bus with position of the loopback resistors

Extending the bus with a new node requires modification of the end jumper.

Inserting a new node on the bus requires no modification.

Possible use in model railroading

  • Communicate with two wires between two microcontrollers, over long distances, without being affected by interference, and thus limit the amount of cabling under the network (IBC interface card).