• admin@embedclogic.com

CAN Interview Questions

I have tried to collect most of the questions related to CAN Protocol which can ask by your Interviewer. You must have gone through my CAN protocol tutorial before starting this Q&A.

What Is CAN Protocol?

CAN Stand for Controller Area Network patented by Robert Bosch in
1986 to replace conventional wiring used between ECUs for data sharing between ECUs in vehicles.

Conventional to CAN Network Transition

It is an asynchronous serial communication protocol. it allows up to 1 Mbps bit rate for a 40m wire length. The most popular bit rate is 500 kbps for 100m length. For more detail go through this article.

CAN Protocol Basically used on Physical layer(11898-2), Data link layer
(11898-3) , and the transport layer(15765-2).

The physical layer standard is used for bit encoding with NRZ line code and the data link layer is used for error detection, handling, and Message receiving/transmission while transport layer protocol 15765-2 is used for data packet handling if the data length is greater than 8 bytes (<4096 bytes).

CAN protocol allows only 8-byte data in CAN Frame. More than 8-byte data will be fragmented in the 8-byte frame as per 15765-2 standard at the transport layer. For more detail go through this article.

What are the Features of CAN Protocol?

CAN protocol is very enriched in features that motivate one should use it for data communication-

  1. Simple and flexible in Configuration
  2. CAN is a Message-Based Protocol
  3. Message prioritization feature through identifier selection.
  4. CAN offer Multi-master Communication
  5. Error Detection and Fault Confinement feature
  6. Retransmission of the corrupted message automatically when the bus is idle.

Apart from these, the CAN protocol has other powerful features. It offers the in-built features in the CAN controller like synchronization of nodes, Frame Integrity check through CRC mechanism, etc. because of all these features offered at the h/w level, lots of software coding overhead is reduced. for detail about the features list please go through this article

Why CAN is asynchronous communication?

Basically, two types of communication exist –

Synchronous Communication – Each bit of data drive syncs with a clock signal and the master drives the clock signal means the master can only initiate data communication.

Asynchronous communication – Data transmission is not synced with any external clock signal. it may be transmitted intermittently. In the case of CAN, a bit transmission follows the bit time concept which is associated with the time Quanta. Follow this article for more detail.

Explain CAN architecture with respect to OSI Layer.

CAN Network architecture is like the below image :

CAN Architecture Diagram

As shown in the above figure CAN network is basically made of Node and CAN Bus. Node has basically three components :

  1. MCU is the host controller and decides how to deal with received or transmit data. It processes data from the Application layer to the network layer and vice versa.
  2. CAN Controller takes care of the message reception and transmission, error detection and handling, etc.
  3. CAN Transceiver converts the CAN controller data into bus level before sending it on CAN Bus and vice-versa.

ISO mapped the CAN protocol specification with the OSI model according to the above architecture. CAN protocol basically works on three OSI layers: The physical layer, Data Link Layer, and Transport layer. Go through this article for detail.

Why CAN Bus uses differential Cable?

CAN Protocol uses two-wire twisted pair cables for CAN Bus architecture to reduce cross-talk and EMI. Please go through this article for detail.

Why CAN Bus Topology use a terminator register at the end?

In a Bus topology, a terminator register is used whether in CAN or Ethernet or somewhere else to absorb the signal at the end to avoid reflection. The terminator register must be equal to the impedance generated by the signal(V/I).In CAN usually, 100-120 ohm resistance is used at the end of the differential cable.

Why CAN BUS use NRZ encoding instead of RZ?

NRZ encoding uses to change Controller’s digital signal to the BUS level. Go through the article for more detail.

Explain High-Speed CAN and Low-Speed CAN

High-Speed CAN and Low-Speed CAN(Fault Tolerant CAN) is basically two architecture for Node arrangement at the CAN network on the physical layer.ISO codified this architecture in 11898-2(High-Speed CAN) and 11898-3 (Low-Speed CAN). It basically differs in speed and voltage level. Go through this article for detail.

What is the difference between standard CAN and Extended CAN

Originally Bosch released CAN specification CAN 2.0 for passenger Vehicles which explains 11-bit identifier frame architecture but later on it was divided into CAN 2.0(A) which is named as the standard CAN to be used in passenger cars dealing with 11-bit Identifiers. At the same time, the other is CAN2.0(B) which is known as extended CAN be used in heavy vehicles like Buses and Trucks it deals with a 29-bit Identifier. So the basic difference in both standards is in the message Identifier field. For detailed frame architecture, Go through this article.

Can Standard CAN and extended CAN coexist in the same network? who will win arbitration if the first arbitration field is the same?

As you have seen in the CAN frame format in the above question only the Arbitration field in the extended frame format only differs from the standard CAN means extended CAN architecture is designed in such a way that standard and extended CAN coexist on the same network. In extended frame format, the IDE bit distinguishes between the standard and extended CAN.

IDE bit is dominant(1) for the Standard frame and recessive for the extended frame. so the standard frame will win arbitration if both have the same 1st identifier field(11-bit).

What are CSMA/CA and CSMA/CD in CAN Communication?

CSMA stands for Carrier Sense Multiple Access. This concept is used in transmission media access. if multiple ECUs are connected by sharing the same transmission medium to transfer its data then there is the possibility of collision and data corruption if multiple nodes start transmission same time.CSMA introduce two concepts CSMA/CA and CSMA/CD to avoid this situation.

CSMA/CA is carrier sense multiple access /collision avoidance. It is applied before the start of transmission. The node having CSMA/CA enabled feature first checks the transmission medium status before starting transmission and if BUS is idle(which means not in use) then it will start transmission otherwise it will wait for the bus to be idle. In CAN this feature is introduced by the Arbitration concept. Look at this article for the arbitration concept in CAN.

CSMA/CD is Carrier Sense Multiple Access/Collision Detection. It is applicable when the data transmission starts. A Node with CSMA/CD-enabled feature detects the collision and stops further data transmission. It will initiate data re-transmission. In CAN this feature is successfully implemented through the Bit Monitoring feature of the Transmitter node. Click for detail on the bit monitoring Concept.

How many Types of CAN frames exist? explain the functionality of each frame.

There are four types of frames exist-Data Frame to carry Data, a Remote Frame for requesting data from another node, an Error Frame for acknowledging transmission/reception errors, and a last one is overload frame used for wait time requests if the node is busy. Go through this article for detail.

Who will win the arbitration, Data frame or Remote Frame if both come at CAN Bus with the same identifier?

The data frame will win the arbitration because the arbitration field contains Identifier+RTR. Here identifier is the same but RTR is dominant in the case of the Data Frame while recessive in the case of the remote frame.CAN bus work on wired and logic so 1&0=0. So the final value on the CAN bus will be dominant(0). So Ecu which sends the data frame(RTR=0) will get the same value as that it transmitted while ECU which sent the remote frame will not get the same value and consider that bus is busy and stop further transmission and wait for the bus to idle and another ECU will continue its data frame transmission

Explain the types of CAN errors. Which concept is used behind bit error detection?

There are 5 types of error that exist in CAN- Bit error, Stuff error, CRC error, Ack Error, and Form Error. Some of the errors are detected by transmitters like Bit errors and ACK errors and some by the receiver like Stuff errors, CRC errors, and Form Errors. Go through this article to know all about error detection.

What are an active error, passive error and Bus-off state?

These states are basically parts of error confinement. Go through this article for detail about these states of a node.

What is bit time? Calculate the no. of time quanta required to achieve a 500kbps bit rate if the system frequency is 40mhz and the clock divider is 4.

Bit time is the time required to carry a bit on the CAN bus. it is calculated in time quanta, the smallest unit of the bit time. Go through the detail about bit time and its calculation.