Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

CAN is a communication protocol widely used in the automotive industry because of its robust nature and ability to link many electronic control units (ECUs) together. In our car, each of our boards are connected to the CAN bus and is the primary way the car transmits messages.

Physical Bus:

CAN is a multi-master bus, meaning that each ECU connected to the bus has the ability to drive1 the bus. The bus is made up of a twisted pair of wires, CAN high (CANH) and CAN low (CANL), creating a differential signal. A differential signal simply means that instead of viewing the wire independently, the signal is interpreted using the difference in voltage between the two wires. These two wires can be driven as a pair into two states, dominant or recessive.

When nothing is driving the lines, a CAN bus idles in the recessive state, interpreted as a binary 1. A dominant bit is a binary 0.

The below images show some examples of the state of the bus, as well as the binary interpretation of them.

can-voltage-levels.jpgTiming-Diagram-of-TXD-of-CAN-Transceiver.png

Data Transmission:

CAN data is transmitted in frames. A frame is made up of the following pieces:

  • Start of Frame (SOF) marker

  • Arbitration ID

  • Control

  • Data

  • CRC

  • End of Frame (EOF) marker

The SOF and EOF markers are quite straightforward. The SOF is a single dominant bit (0) which marks the start of a frame. The EOF is 7 recessive bits (1s) that mark the end of the frame. This allows the bus to return to the idle state (observe that no other time will we allow 7 recessive bits within a frame).

Footnotes:

  1. “Driving” a bus means taking control of the voltages being set on the physical hardware which makes up the bus. In the case of CAN, these are the CANH and CANL wires.

  • No labels