CAN: Controller Area Network

CAN is a network often used in domestic and light commercial vehicles. It's more common in Europe, but recently the major US manufacturers have also begun to adopt CAN. The advantage CAN has over conventional wiring is the sharing of signals between the control modules. This saves multiple modules from having to interface with the same sensor, reducing the size of the wiring loom and I/O needed by the microcontrollers. CAN provides a means for the control modules to cooperate with each other, allowing more complex control and improved operation in degraded modes of operation caused by component failure. Below is a list of features that characterize CAN:

• Physical layer similar to RS-485 (differential, balanced).

• Terminated by 120 ohm resistor.

• Daisy chain topology.

• 1Mbit/s maximum speed. Typically 250k or 500kbit/s is used.

• 11- or 29-bit addressing (determined by vehicle manufacturer).

• Lower addresses (identifiers) have higher priority.

• Maximum of eight data bytes per message.

• Multimaster arrangement.

• All receiving nodes acknowledge message receipt.

Instead of each module having an address on the network, each module has one or more identifiers--the lower the identifier, the higher the priority of the message. For example, an ABS (antilock braking system) may transmit the wheel-speed information on a low identifier and its software-version information on a higher identifier (the latter not being important to the operation of the vehicle).

The bitrate, identifier length and allocation of identifiers are determined by the vehicle manufacturer. Typically bitrates of either 250k or 500kbit/s are selected.

A maximum of eight data bytes are allowed per message. This keeps the network available for a higher-priority message to be sent through. You wouldn't want to be transferring a 4KB packet while your traction control is trying to tell the other modules what to do to keep your vehicle from sliding off an icy road! Unfortunately, there is no standard byte order, and it's possible to have both Motorola and Intel format on the one network.

All collision detection, checksum and acknowledgement is done in hardware. The hardware comes in two flavors: basic and full CAN. Basic CAN is similar to the UART in your PC in that it has a transmit and receive queue. The controller usually will have an acceptance mask that allows hardware filtering of identifiers. Full CAN uses a system of message objects. Each message object is set to receive or transmit a message. Once a message object is set up to receive a message, its contents will always contain the most recently transmitted message with matching identifier. It's effectively eight byte chunks of shared memory between modules.

As a rule of thumb, you'll find full CAN controllers in microcontrollers and basic CAN controllers in CAN-monitoring equipment. Some of the newer microcontrollers blur the distinction between basic and full CAN controllers.