CAN Protocol

CAN Protocol

Lancez-Vous. C'est gratuit
ou s'inscrire avec votre adresse e-mail
CAN Protocol par Mind Map: CAN Protocol

1. Standard and Implementation

1.1. Standardized since 1991 and is described by 4 ISO documents...ISO 11898-1,ISO 11898-2,ISO 11898-3,ISO 11898-4

1.1.1. ISO 11898-1 covers 2 layers of OSI model and it is an event driven communication.

1.1.2. ISO 11898-2 covers 2 sub-layers of the model for the data communication i.e Physical Medium Attachment and Physical Medium Specification. It allows data rates upto 1 Mbps . It is used in powertrain and chassis areas of the automobile.

1.1.3. ISO 11898-3 covers 2 sub-layers of the model for the data communication i.e Physical Medium Attachment and Physical Medium Specification. It allows data rates upto 125 Mbps . It is used in the convenience area of the automobile.

1.1.4. ISO 11898-4 is an extension of the data link layer service and add a time triggered communication option for CAN based networks.

2. CAN Versions

2.1. CAN 2.0.

2.1.1. CAN 2.0 A refers to Standard Frame Format with 11 bit identifier.

2.1.2. CAN 2.0 B refers to Extended Frame Format with 29 bit identifier.

2.2. CAN FD

2.2.1. Developed in 2011 and released in 2012 by Robert BOSCH

3. CAN Network

3.1. CAN network is usually based on line topology.Sometimes,it can be star topology also.

3.2. Physical transmission medium is UTP.

3.3. The maximum data rate is 1 Mbit/s.

3.4. Maximum length is 40 meters.

3.5. ISO 11898 specifies maximum CAN nodes as 32.

4. Frame Formats

4.1. It consists of two frame formats

4.1.1. Standard Frame Format

4.1.2. Extended Frame Format

5. Advantages

5.1. Low Cost

5.2. Reliable

5.3. Flexibility

5.4. Good Speed

5.5. Multi-master Communication

5.6. Fault-Confinement

5.7. Broadcast Capability

5.8. Standardised

6. CAN Node

6.1. It consists of 3 sub elements

6.1.1. Host

6.1.1.1. It runs core application to do some specific job.A host decides what the received message means and what message it want to send next.

6.1.2. CAN Controller

6.1.2.1. It deals with communication functions prescribed by the CAN protocol and it also triggers interrupt upon transmission and reception of messages.

6.1.3. CAN Transceiver

6.1.3.1. It is responsible for transmission and reception of data on CAN bus.It converts the CAN signal collected from the bus into stream of data which CAN controller can understand.

7. Start Of Frame

7.1. Start of a new frame in a network.It consists of single dominant bit.

8. Arbitration Field

8.1. This field is also called Message Identifier. It indicates the meaning and content of the message and the priority of the message.

8.1.1. In Base Format, the Arbitration Field consists of the BASE Identifier and the RTR bit.

8.1.1.1. A dominant IDE bit indicates 11 bit Standard bit Identifier.

8.1.1.2. RTR bit has to be dominant for Data Frame and Recessive for Remote Frame

8.1.2. In Extended Format, the Arbitration field consists of the Extended identifier,the Substitute remote Request (SRR) bit, the IDE bit and the Remote transmission request (RTR) bit.

8.1.2.1. A Recessive IDE bit indicates 29 bit Extended bit Identifier

8.1.2.2. SRR bit is recessive and this is applicable in Extended Format .

8.1.2.3. RTR bit has to be dominant for Data Frame and Recessive for Remote Frame

9. Control Field

9.1. This field defines the User-defined functions.

9.1.1. In CAN Base Format, the control Field consists of the IDE,ro and 4 bits wide Data Length Code (DLC).

9.1.2. In CAN Extended Format, the control Field consists of the r1,r0 and 4 bits wide Data Length Code(DLC).

10. Data Field

10.1. This field consists of the actual information which is used to be transmitted.The number of data bytes may vary from 0 to 8 and transmission start with MSB bit first

11. CRC Field

11.1. It is a 15 bit which is used to detect any data corruption in transmission.The sender will compute the CRC before sending the frame.After receiving the frame,each receiver will compute the CRC again and compare with it.If the CRC doesnot match, the receiver will generate the error frame.CRC delimiter marks the end of CRC.

12. ACK field

12.1. This field consists of 2 bits,,Ack slot and ACK delimiter.It can be dominant and recessive.

13. End of Frame

13.1. End of Frame consists of 7 recessive bits and marks the end of data frame.

14. r1,ro are the reserved bits and DLC is used to indicate how many data bytes are transmitted and It may take values from 0 to 8 and other values are not allowed.

15. Introduction to CAN

15.1. Communication between Various ECUs like EMS,ABS,Gear Control etc..

15.1.1. Developed by Robert Bosch

15.1.2. No Host required

15.1.3. Broadcast BUS

15.1.4. Serial Half-Duplex Asynchronous Communication

15.1.5. Differential Two-Wired Communication

15.1.6. Designed Originally for Automobiles

15.1.7. Designed for On-Board Diagnostics

16. Need for CAN

16.1. Conventional Networking

16.1.1. Physical Communication channel was allocated to every channel to be transmitted.It offers limited data exchange but,increases wire harness ,cost and complexity of the system.

16.2. Bus Networking

16.2.1. To overcome conventional networking issue, CAN was introduced as a centralized solution which followed bus networking .It enables serial bit exchange of data via single channel. This solution is quite efficient due to its message prioritization and flexible as node can be inserted and removed without affecting the network.

17. Frame Types

17.1. There are four different frames which can be used on the BUS.

17.1.1. Data Frame

17.1.2. Remote Frame

17.1.3. Error Frame

17.1.4. Overload Frame

18. Communication Principles

18.1. From the network, smaller the message identifier, higher is its priority. A node wish to send message must wait until the bus becomes idle.If the bus is idle, it sends the SOF bit, the dominant bit to take the bus access,then it sends the message identifier with the MSB.During this phase if this node detects the dominant bit on the bus while it has transmitted the recessive bit it clearly means the node has lost the arbitration,stops sending the further bits.It waits and try again once this bus is free again

19. Applications

19.1. Passenger Vehicles,Trucks,Buses

19.2. Electronic Equipment for Aviation and Navigation

19.3. Elevators,Escalators

19.4. Building Automation

19.5. Medical Instruments and Equipment

20. CAN Arbitration

20.1. There are two bus levels of CAN

20.1.1. Dominant Level

20.1.1.1. This level corresponds to logical '0'

20.1.2. Recessive Level

20.1.2.1. This level corresponds to logical '1'

21. Arbitration Process: When different CAN nodes sends dominant and recessive bus levels simultaneously, the bus remains dominant. And , the recessive bus level occurs only if all nodes sends recessive state. Such behavior is called AND logic.

22. These are the most commonly used frame and used when node transmits information to any/all other nodes in the system. These frames consists of fields that provide additional information about the message as defined by the CAN specification. Embedded in the data frames are Arbitration field,control field,Data field,CRC field,Acknowledge field and an end of frame.

23. The purpose of the remote frame is to seek permission for the transmission of data from another node.This is similar to data frame without data field and RTR bit is recessive.

24. If transmitting a receiving node detects an error, it will immediately abort transmission and send error frame consisting of an error flag made up of 6 dominant bits and error flag delimiter made up of 8 recessive bits.

25. It is similar to error frame, but used for providing extra delay between the messages. An Overload Frame is generated by a node when it becomes too busy and is not ready to receive.

26. Logical Error Detection

26.1. To detect corrupted messages, the CAN protocol defines five mechanisms and they are..

26.1.1. Bit Error

26.1.2. Stuff Error

26.1.3. CRC Error

26.1.4. Form Error

26.1.5. ACK Error

27. This error occurs when bit received is not the value transmitted. Ex:Transmitter is recessive bit when it received back it received the dominant value. Bit error occurs in CAN network.

28. This error occurs when more than 5 consecutive bits of same polarity bits are received in a CAN network.

29. This type of error occurs when CRC sent is calculated and compared wrong at the recessive bit.

30. Violation of Fixed form of fields in a CAN network results Form Error. Ex: CRC delimiter,ACK delimiter,EOF,IFS must be recessive bit always ,it must not be dominant bit.

31. ACK field consists of 2 bits..ACK slots,ACK delimiter.In ACK slots, the transmitting slots sends recessive bit following the receiver has to send back the dominant bit in ACK slot.If this doesnot occurs it leads to Acknowledgement Error.