Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Copyright © 2014 Tata Consultancy Services Limited Controller Area Network (CAN) By Renukacharya A. Thakare.

Similar presentations


Presentation on theme: "1 Copyright © 2014 Tata Consultancy Services Limited Controller Area Network (CAN) By Renukacharya A. Thakare."— Presentation transcript:

1 1 Copyright © 2014 Tata Consultancy Services Limited Controller Area Network (CAN) By Renukacharya A. Thakare

2 2 CAN is used in a wide area of applications Automotive Medical Factory automation Railway Maritime Machine control Building automation Application

3 3 Brakes Dashboard Power windows Central locking Engine Airbag Mirrors Gearbox Lights Air conditioning Car Body components Typically low-speed CAN Bus Power Train components Typically high-speed CAN Bus Application

4 4 Copyright © 2014 Tata Consultancy Services Limited What is CAN?  Acronym for Controller Area Network, is a serial communication protocol.  CAN is a multi-master bus with an open, linear structure with one logic bus line and nodes. The number of nodes is not limited by the protocol.  In the CAN protocol, the bus nodes do not have a specific address. Instead, the address information is contained in the identifiers of the transmitted messages, indicating the message content and the priority of the message.  The number of nodes may be changed dynamically without disturbing the communication of the other nodes.  Multicasting and Broadcasting is supported by CAN.

5 5 Prior to the development of CAN, communication between the growing number of electronic control systems within a vehicle was primarily managed by point-to-point wiring. How It all Began

6 6 This is accomplished by adding some CAN specific hardware to each control unit that provides the protocol for transmitting and receiving information via the CAN bus. Now that we can see the clear advantage of CAN technology over previous ways of control unit communication within a vehicle, let’s consider some CAN basics. How It all Began

7 7 CAN Features  Low cost Protocol devices are low cost Good price to performance ratio Low cost twisted pair cables  Reliable Sophisticated error detection and error handling High immunity against EMI Automatic retransmission of erroneous messages Recovery of temporary errors Automatic switch off of defective nodes Guaranteed data consistency  Real-Time High baud rate Short message length Low latency Multi master Arbitration  Flexible No. of nodes not limited by protocol (only by physical layer) Changes possible without disturbing communication  Fast 8 byte limit on messages Bus access prioritised 1Mbps baud rate

8 8 Copyright © 2014 Tata Consultancy Services Limited 1.CAN specification divided into two layers: Data link layer Physical layer 2.Physical layer performs functions of physical signaling, encoding, bit timing and bit synchronization. 3.Data link layer (DLL) performs bus arbitration, message framing, data security, message validation, error detection. CAN – How it operates ?

9 9 Copyright © 2014 Tata Consultancy Services Limited CAN

10 10 Copyright © 2014 Tata Consultancy Services Limited  The message is transmitted in logical bit values. CAN does not specify the physical layer medium.  These bits can be “recessive” or “dominant”.  During simultaneous transmission of “recessive” and “dominant” bits, the resulting bus value will be “dominant”.  When a CAN message is not active, bus is IDLE (recessive bits on bus).  Message is encoded in NRZ (non return to zero format). CAN - Physical Layer

11 11 Copyright © 2014 Tata Consultancy Services Limited Data link layer – Bus Arbitration 1.There are two bus states, called "dominant" and "recessive". 2.The bus logic uses a "Wired-AND" mechanism, that is, "dominant bits“ (equivalent to the logic level "Zero") overwrite the "recessive" bits (equivalent to the logic level "One" ). 3.The CAN protocol handles bus accesses according to the concept called “Carrier Sense Multiple Access with Arbitration on Message Priority”. 4.If two or more bus nodes start their transmission at the same time after having found the bus to be idle, collision of the messages is avoided by bit wise arbitration. Each node sends the bits of its message identifier and monitors the bus level. 5.This arbitration concept avoids collisions of messages and the most important message(lower binary value) is always sent first without time loss.So, this is also called as Non-Destructive arbitration using CSMA/CD protocol.

12 12 Data link layer – Bus Arbitration  Nodes who are lost in the arbitration process automatically try to repeat their transmission once the bus returns to idle state.

13 13 Copyright © 2014 Tata Consultancy Services Limited Message transfer – 4 types Data frame : carries data from transmitter to receiver Remote frame : A station acting as a receiver for certain data can initiate the transmission of the respective by its source node by sending a remote frame Error frame : sent by any unit/node upon detecting an error Overload frame: by receiver for internal condition of receiver which requires a delay of new frame

14 14 Copyright © 2014 Tata Consultancy Services Limited  A Data Frame is generated on an autonomous basis by a CAN node(whenever a node wishes to transmit data). Here, we see an example of a Standard CAN Data Frame. The frame begins with a dominant Start Of Frame bit for hard synchronization of all nodes. Data link layer – Data Frame

15 15 Data link layer – Remote Frame The remote frame is same as the Data frame with the following differences: 1.The RTR bit is transmitted as dominant bit in data frame, whereas in remote frame it is transmitted as recessive bit. 2.Remote frame doesn't contain data field.

16 16 An Error Frame is generated by any node that detects a bus error (with the exception of an Acknowledge Error). The Error Frame consists of two fields, an Error Flag field followed by an Error Delimiter field. The Error Delimiter consists of eight recessive bits and allows the bus nodes to restart bus communications after an error. There are, however, two forms of Error Flag fields. The form of the Error Flag field depends on the error status of the node that transmits the error frame. Data link layer – Error Frame

17 17 Data link layer – Overload Frame  An Overload Frame has the same format as an active Error Frame, such as that generated by an error active node. An Overload Frame, however, can only be generated during the Inter frame Space.  The Overload Frame consists of two fields, an Overload Flag followed by an Overload Delimiter. The Overload Flag consists of six dominant bits followed by Overload Flags generated by other nodes, like an active error flag, with a maximum of twelve dominant bits. The Overload Delimiter consists of eight recessive bits.  An Overload Frame can be generated by a node if, due to internal conditions, the node is not yet able to start reception of the next message. A node may generate a maximum of two sequential Overload Frames to delay the start of the next message.

18 18 Copyright © 2014 Tata Consultancy Services Limited Data link layer – Error Detection The CAN protocol provides sophisticated error detection mechanisms. The following errors can be detected: 1.Cyclic Redundancy Check, or CRC Errors 2.Acknowledge Errors 3.Form Errors 4.Bit Errors 5.Stuff Errors.

19 19  Detected errors are made public to all other nodes via Error Frames.  The transmission of erroneous message is aborted and the frame is repeated ASAP.  Each CAN node is in one of three error states "error active", "error passive" or "bus off" according to the value of their internal error counters.  The error-active state is the usual state after reset. The bus node can then receive and transmit messages and transmit active Error Frames (made of dominant bits) without any restrictions. During CAN communication, the error counters are updated according to quite complex rules. For each error on reception or transmission, the error counters are incremented by a certain value. For each successful transaction, the error counters are decremented by a certain value. The error active state is valid as long as both error counters are smaller than or equal to 127. Data link layer – Error Handling

20 20 Copyright © 2014 Tata Consultancy Services Limited If either the receive or the transmit error counter has reached the value of128, the node switches to the error-passive state. In the error-passive state,messages can still be received and transmitted, although, after transmission of a message the node must suspend transmission. It must wait 8 bit times longer than error-active nodes before it may transmit another message. In terms of error signaling, only passive Error Frames (made of recessive bits) may be transmitted by an error-passive node. If both error counters go below 128 again due to successful bus communication, the node switches back to the error-active state. One feature of the CAN protocol is that faulty nodes withdraw from the bus automatically. The bus-off state is entered if the transmit error counter exceeds the value of 255. All bus activities are stopped which makes it temporarily impossible for the station to participate in the bus communication. During this state, messages can be neither received nor transmitted. To return to the error active state and to reset the error counter values, the CAN node has to be reinitialized. Data link layer – Error Handling

21 21 Copyright © 2014 Tata Consultancy Services Limited Thank You


Download ppt "1 Copyright © 2014 Tata Consultancy Services Limited Controller Area Network (CAN) By Renukacharya A. Thakare."

Similar presentations


Ads by Google