CAN (Controller Area Network)Edit
- It is extensively used in automotive but it has found applications everywhere.
- CAN controller
- CAN controller 2.0A -> 11bits ID
- CAN controller 2.0 B -> 29bits ID
- CAN FD -> flexible Data Rate
- Look after the all features of CAN protocol with almost no intervention by host processor.
- Need to configure the controller by writing to its registers, write data to controller.
Features of CANEdit
- 11 or 29 bit Identification & from 0 to 8 bytes .
- Peer to peer network. (Every node can see all messages from all other nodes but it can’t see its own)
- Nodes are easy to add.( just two wires + ground)
- Higher priority messages are sent first depending on the value of ID.(Lower ID has higher priority)
- Automatic retransmission of defective frames.
- Speed (10kbps to 1mbps)
- Twisted differential pair provides excellent noise immunity & bus faults protection.
- CAN system works with ground connection of different DC levels.
- Inexpensive (cheap, good, fast )
- Reliable & Robust
|125 kbps||Low speed||500 m|
|1 mbps||High speed||40 m|
|15 mbps||Flexible Data Rate||10 m|
- CAN system layout or physical configuration main backbone
- Main backbones & drops are comprised of a twisted pair of wires
CAN Physical ConfigurationEdit
The CAN specifications use the terms:
- "dominant" bits = logic 0
- "recessive" bits = logic 1
The idle state is represented by the recessive level (“1”).
Note: If one node transmits a dominant bit and another node transmits a recessive bit then there is a collision and the dominant bit "wins".
Details of the CAN Frame:
- Start-of-frame bit: The start of a message frame is signaled by a dominant start-of-frame bit
- 11-bit Message ID or 29-bit Message ID
- Remote Transmission Request (RTR) bit: It is only set if the message is a data request frame (as opposed to a data frame)., a node may request the transmission of a specific message by another node in the system.
- Data Length Code (DLC): It indicates the number of bytes of data transmitted. The data field can contain from zero to eight bytes of data, and is followed by the
- 16-bit CRC field: containing a 15-bit cyclic redundancy check code which is used by the receiving node to detect errors, and a recessive delimiter bit.
- The ACKnowledge field has two bits:
- The first is the ACK Slot which is transmitted as a recessive bit, but will be overwritten with a dominant bit by any node that successfully receives the transmitted message.
- The second bit is a recessive delimiter bit.
- The end-of-frame field consists of seven recessive bits, and signals that error-free transmission of the message has been completed.
- Intermission field consisting of three recessive bits, after which the bus may be considered to be free for use. Idle time on the bus may be of any length, including zero
IDE: Identifier Extensions
- if IDE = 0 , then the ID is 11 bits
- if IDE = 1, then the ID is 29 bits
ID: Identifier (11 or 29 bits as set by IDE field)
This port of CAN frame sets priority.
DLC: Data length code (4 - bits)
Specifies number of data bytes in the frame from 0 to 8.
Data bytes: 0 to 8 bytes
ID: Identifier (11 or 29 bits)
Used as a node address or to identify requests & responses.
- 11-bits ID :- Standard CAN ID
- 29-bits ID :- Extended CAN ID
ID0: Highest Priority
|Data transmitted with CAN frame|
|0 000||0 bytes|
|0 001||1 bytes|
|0 010||2 bytes|
|0 011||3 bytes|
|0 100||4 bytes|
|0 101||5 bytes|
|0 110||6 bytes|
|0 111||7 bytes|
|1 000||8 bytes|
Applications of CANBUSEdit
CAN Controller Architecture and OperationEdit
Block diagram of the NXP CAN controller
In block diagram the main points of all CAN controllers are:
- I/O Pins: These connect to the CAN transceiver chip pins RD1 and TD1 as already described.
- Bitstream Converters: CAN is a serial bus while the processor is parallel. Conversion happens here.
- TXB buffer: The messages to be transmitted are written here. ID, IDE, DLC and data (if any) go here.
- Acceptance Filter: This passes only specified messages to the processor via the FIFOs. By default at RESET, these filters pass all messages to the FIFOs. Your software must configure and enable them to filter messages.
- RXB Receive Buffer: Each buffer holds 1 CAN message. They provide a buffering system to the processor.
- Control, Status, Bit Timing and Error management registers: Your software must configure these registers, usually at initialization. Various flags and switches are found here. Examples are set CAN speed, request transmission, manage receive messages, enable interrupts and obtain diagnostic information
- WikiNote Foundation
- Prof. Sujit Wagh