Controller Area Network
Overview
Introduced in 1986, CAN is a serial field bus that is low cost, only requires 2 wires, has the ability to function in difficult electrical environments, has a high degree of realtime capability, has excellent error detection and fault confinement capabilities and is easy to use.
Controller Area Network, is a a serial network technology that is a two wire, half duplex, high speed network system. it operates at data rates of up to 1 Megabit per second.
CAN-in-Automation (CiA) is the international users' and manufacturers' organization that develops and supports CAN Standards and CAN-based higher-layer protocols.
ISO 11898 is the international federation that governs the protocol.
Main Characteristics
- Multi-Master priority based bus access
- Non-destructive contention-based arbitration
- Multicast message transfer by message acceptance filtering
- Remote data request (that no one uses)
- Automatic retransmission of messages that lost arbitration
CAN Frame
There are 4 types of CAN Frames
- Data Frame - data transfer from one sending node to one or numerous receiving nodes
- Remote Frame - any node may request data from one source node. A remote frame is followed by the requested data.
- Error Frame - any node may signal an error condition at any time during a data or remote frame transmission
The distance between frames is a minimum of 3 bit times.
CAN supports messages between 0 and 8 bytes.
An 11 bit identifier allows a total of 211 = 2048 different messages. An extended version allows 229 = 536+ million
The dominant level (TTL = 0V) always overrides a recessive level (TTL = 5V). This is important during bus arbitration.
A remote frame requests the transmission of a message by another node. This type of message is uncommon and CiA says to avoid its usage.
A lower message ID number represents a high message priority.
Acknowledgement Field
The acknowledgement field serves as a confirmation of a successful CRC check by the receiving nodes in the network.
Error Checking
CAN implements a robust and elegant error checking system that allows for:
- Retransmission of frames that did not pass a 15 bit CRC check by a receiving node
- Detection of bus fault by a transmitting node by monitoring the bus after every bit cycle and ensuring the bus level is equal to intended transmission bit
- Allows a node to determine whether or not it was the first error reporting node, which allows the determination and removal of a defective node.
Transmission Times
A CAN frame has a minimum of 47 bits (no bit stuffing and no data) and a maximum of 135 bits (max bit stuffing and 8 bytes of data)
Maximum number of messages with average bit stuffing at 1 MBit and 8 bytes is 8,771 per seconds and 17,543 per second with 1 data byte.
Data Transfer Synchronization
CAN uses Non-Return-to-Zero bit encoding. This provides highest transport capacity but requires bit stuffing. In CAN synchronization is done with the SOF bit, which marks the start of a frame, and by bit stuffing, by only allowing 5 consecutive bits of the same polarity.
Wire Length
Implementation
Here is a chip implementation:1)
Notes
ECAN is the “Enhanced Controller Area Network” module from Microchip. It's what they call they module that is compatible with everything up to CAN2.0B (which is the latest CAN standard up that includes the 29 bit extended identifier). 2)