Controller Area Network (CAN) - Introduction & Frames

    CAN is serial communication protocol which is mostly being used in Automotive industry now a days. Its domain of application ranges from high speed networks to low cost complex wiring.

      In Automotive industry, it is used to establish communication between number of Electronic Control Units (ECUs) which are used for the applications like Engine Control Unit, Body Control units (BCMs), Anti-lock Braking Systems (ABS), Electric Power Steering, Fuel Injection systems, etc. are connected using the CAN with speed upto 1Mbit/s.

      CAN is a multi-master protocol which is having 2-wires (CAN-H & CAN-L) bus to which all the CAN nodes are connected. It works on the Carrier Sense Multiple Access - Collision Detection (CSMA-CD) technique for the data transfer between the two nodes.

 What is CAN Node ?

         
    A node is any microcontroller system connected to the bus. It can be a simplex or complex in nature. It will continuously send a message on the bus of a specific parameter like speed of vehicle, engine temperature, etc. CAN network is made of such nodes which can communicate with each other through bus by sending the robust data packets known as "CAN Messages".


CAN Signaling

    
    Let's first understand the CAN line coding based on the simple logic.
  •        For Binary bit - 1 : Recognized as Recessive
  •        For Binary bit - 0 : Recognized as Dominant        
     CAN is a 2 wired protocol as mentioned earlier. CAN bus consists of CAN-H and CAN-L bus lines which works on the differential voltage.
  •        When the bit is "Recessive" : Differential voltage on the bus is less than threshold limit (<0.5V when received as input & <1.5V when sent as transmitted output)
  •        When the bit is "Dominant" : Differential voltage on the bus is more than threshold limit (<1.5V)

CAN Frames :

    CAN has the following 4 types of frames :
  •     Data Frame : Contains data which is to be transmitted
  •     Remote Frame : Mainly used to request data from remote node.
  •     Error Frame : Transmitted by any node to detect error
  •    Overload frame : To inject delay between data and remote frame

Data Frame :

  • Start of Frame (SOF) - 1 bit : Denotes start of transmission. Always Dominant.
  • Identifier frame - 11/29 bits : Address of receiving node (11 bits in case of Standard CAN & 29 bits in case of Extended CAN).
  • Remote Request (Rem Req) - 1 bit : When the data is to be requested from the other/remote CAN node, set to recessive. When the data is to be transmitted, it is always set to dominant.
  • Arbitration Frame : Identifier frame & Remote Req frame together referred as Arbitration Frame.
  • Control Field - 6 bits : Combination of ID Extension bit (1 bit), Reserved bit (1 bit) and Data Length Code (4 bits) which consists of no. of bytes of data (0 to 8 Bytes). DLC is 0 when Rem Req frame is recessive.
  • Data Fields - 0 to 8 Bytes : Data to be sent to other node. It is absent or 0 when Rem Req frame is recessive.
  • Cyclic Redundancy Check (CRC) - 15 bits : For error detection and correction.
  • Acknowledgement (ACK) - 1 bit : Acknowledgement of the data received.
  • End of Frame - 7+ bits : Denotes the Data frame has ended.

Error Frame :

    It is generated by any node when a node detects one of the many types of errors which are defined by CAN protocol.


  • Superposition of error flags - 6 to 12 bits : Error flags given by different stations / Nodes. It can be dominant / recessive.
  • Error Delimiter - 8 bits : Always recessive.
    There are two types of error flags :
  • Active Error Flag : 6 Dominant bits. Transmitted by a node when the error is detected on the network / bus.
  • Passive Error Flag : 6 Recessive bits. Transmitted by a node when the active error frame is detected on the network / bus.

Overload Frame :

    Consists 2 fields. Overload Flag and Overload Delimiter depending on the conditions as follows :
  • Case 1 : Due to internal conditions of the receiver, it requires a delay between next data or remote frame.
  • Case 2 : Detection of dominant bit during intermission.
    The frame consist of 14 bits. 6 for Overload Flag & 8 for Overload delimiter. The overall form corresponds to the active error flag. Overload flag's form destroys the fixed form of intermission field. As a consequence, all other stations also detects overload condition & starts transmission of Overload flag.

No comments:

Post a Comment