The CAN (Controller Area Network) protocol was developed by European automotive electronics company Robert Bosch GmbH in 1983 for in-vehicle networking. The intention behind the development of the CAN protocol was to enable robust data communication between different electronic control units (ECU) and microcontroller control units (MCU) of a vehicle over a single wire to eliminate complex point-to-point wiring between them. . . Despite communicating data over a single bus, CAN does not require any host computer.
The standard CAN protocol operates on the physical and data link layers of the OSI model. The other layers of the protocol stack are not implemented within CAN, which has proven to be a great advantage. System engineers are free to design other layers of the protocol stack in a way that best suits an application. Today, CAN has a reputation as a robust, simple, cross-domain and versatile serial network communication protocol that should be implemented whenever frequent real-time data communication between electronic devices belonging to different domains is required. CAN makes variations such as CANopen, DeviceNet, and J1939, allowing implementation of all seven protocol stack layers along with standard CAN layers 1 and 2 for specific use cases. Learning the implementation of the standard CAN protocol would be enlightening.
In this article, we will take a look at the CAN protocol and its distinct features. Next, we will explore some typical applications of the CAN protocol and investigate how CAN is used there.
CAN standard
CAN specifications define the CAN protocol and the CAN physical layer. The protocol is primarily defined by the ISO-11898 specifications, but other specifications such as ISO-11519 for low-speed serial data communication also apply to the protocol. The ISO-11898 specification is divided into three parts. The first part defines the specifications of the data link layer and the single physical link. The second part of the specification defines the CAN physical layer for high-speed CAN. The third part of the specification defines the CAN physical layer for low-speed CAN.
Low-speed CAN has data rates of 5 Kbps, 10, 20, 50 and 125 Kbps. High-speed CAN has data rates of 250, 500, 800 Kbps and 1 Mbps. In a CAN network, data is communicated over a shielded or unshielded twisted pair or ribbon cable with a characteristic impedance of 120 ohms. DB9 (male) connectors are used as per CiA DS-102 specification. CiA stands for “CAN in Automation”. The maximum range of a CAN bus is 1000m (at 40Kbps). For high-speed CAN, the maximum range is 40m at 1Mbps. A maximum of 127 nodes can be connected to a CAN bus.
How the CAN protocol works
In a CAN network, each electronic device or system connected to the bus is a node. Each node consists of three elements — host controller, CAN controller, and CAN transceiver. The host controller is a microcontroller or processor inside the device/system that runs some application for a specific job. The CAN controller handles the transmission and reception of CAN messages between the host controller and the CAN bus. It acts as a protocol handler. The CAN transceiver takes care of transmitting and receiving CAN messages over the CAN bus. It acts as a line driver. While the host controller is a physical controller/processor, the CAN controller and CAN transceiver are implemented in software or firmware.

Components of a CAN node
Each node is a CAN transceiver. Data is communicated asynchronously and half-duplex. Bits are transmitted over the CAN bus using differential voltage. The two wires on the CAN bus are called CAN low and CAN high. There are two unusual logic states on the CAN bus, called recessive and dominant. Logic 1 is the recessive state and logic 0 is the dominant state. Normally, the bus is in a recessive state, that is, logic 1. For the recessive state or logic 1 communication, both the CAN low and CAN high wires receive a voltage half of the VDD or VCC supply voltage. The supply voltage is normally 5V, so both wires are applied at 2.5V. As a result, the differential voltage between the wires is 0V. This is read as logic 1. In the dominant state, CAN high is increased to 3.5V and CAN low is increased to 1.5V. As a result, the differential voltage between two wires is 2V. This is the dominant state of the bus, which is read as logical 0 by the CAN transceiver.

Example of CAN signal levels
The dominant state always replaces the recessive state. The bus only remains at the recessive level when all nodes send the recessive bit. Due to AND logic, even if a single node sends a dominant bit, the bus state is dominant.
CAN is a message-based protocol. Data is communicated in the form of message frames. A frame is a meaningful sequence of bits. There are four types of message frames – data frames, remote frames, error frames and overhead frames. Data frames carry messages from a CAN transceiver, remote frames are sent to request data from other CAN transceivers, error frames are sent to indicate an error in a data frame, and overload frame is sent to indicate overload of data frames, indicating the need for delay in the transmission of data frames. An identifier field identifies each frame. The identifier field is 11 bits in standard CAN and 29 bits in the extended CAN protocol. To learn more about the structure/format of data frames and other CAN frames, see this article on standard CAN protocol.
At a time, only one node can access the bus. The access method used in the CAN protocol is a Carrier Sense Multiple Access with Collision Detection (CSMA/CD) method called Bitwise Arbitration (BA). The identifier field of a data frame defines the priority of the message. The lower the identifier value, the higher the priority. Therefore, a data frame with identifier field 0x6C3 has higher priority than a data frame with identifier field 0x7B4. Likewise, a data frame with identifier field 0x7B3 has higher priority than a data frame with identifier field 0x7B4.
Any node can access the CAN bus if it is idle, that is, in a recessive state. If two or more nodes attempt to access the bus simultaneously, the node transmitting a data frame with a smaller identifier field, that is, a data frame with higher priority, will have access to the bus. The identifier fields are compared bit by bit from the MSB (bit 10) to the LSB (bit 0) until a node wins the arbitration. If a node is transmitting a correspondingly recessive bit while any other node is transmitting a dominant bit, the node will lose arbitration. In this way, the node that transmits a data frame with the lowest identifier value, that is, with the highest priority, gains access to the CAN bus. The remaining nodes must wait their turn according to the priority level of their data frame.
A data frame transmitted by a CAN node is transmitted to all other nodes on the bus. In other nodes, it is filtered by them and received only if the identifier field applies to them.
Why can it?
There are many reasons to choose the CAN protocol. CAN is a serial network communication protocol and requires only two wires to communicate data between multiple devices. All devices connected to a CAN network communicate via a common two-wire bus. No need to connect two nodes/devices one by one.
Since the CAN controller as well as the CAN transceiver are implemented at the software/firmware level, and the protocol is implemented only at the physical and data link layer, devices from different domains can communicate on the same bus. The other layers of the OSI model in each device or node can be designed individually by system engineers according to the need or function of the specific node/device.
CAN is a message-based protocol. Unlike the address-based protocol, this type of protocol is not affected by the addition or removal of nodes on the bus. Messages transmitted over the bus are transmitted to all other nodes and filtered according to the identifier field at the node level. Priority is assigned to message frames, not CAN nodes, through their identifier fields. This way, there is no need to identify nodes that share the CAN bus. Nodes can be inserted or deleted without affecting the CAN network.
As built for in-vehicle networks, the protocol uses differential voltages. Therefore, data cannot be corrupted or changed by other nodes. Due to the differential voltage levels, CAN is one of the most robust serial communication protocols.
The CAN bus has less chance of collision between devices. By bitwise arbitration, priority is assigned to messages, so that the most important messages are communicated over the bus first, regardless of the nodes that transmit them. Data is transmitted over the bus asynchronously and prioritized by bit-by-bit arbitration.
The protocol allows error checking for reliability purposes and offers excellent noise immunity. CAN is a widely used serial communication protocol for frequent but low-speed data exchange between embedded electronic devices. Many chips have integrated CAN interfaces. Semiconductor chips for configuring the CAN network are available from vendors such as Maxim Integrated, Texas Instruments, Analog Devices, Microchip Technology, NXP, ST Microelectronics, and others.
CAN applications
The CAN protocol is widely used by all types of automotive industry applications, including passenger vehicles, heavy goods and utility vehicles, and agricultural vehicles. As a robust, reliable and versatile serial communication protocol, CAN is not just limited to automobiles. The protocol is used by control modules for high-speed trains and aircraft. It is used by entertainment and infotainment systems in automobiles. The protocol is used to control and monitor cranes and drilling rigs. It is used by elevators and elevator control systems. The protocol is used for building automation, such as heating and air conditioning systems. It is also used in automatic doors and curtain openers. It is used for automated irrigation in greenhouses and farms. The protocol is widely adopted in medical instrumentation due to its robustness and versatility. Many machine tool control systems use the CAN network as an on-device bus system, enabling factory automation. The protocol is also used by sensor networks where signal robustness is required due to environmental factors.
CAN in automobiles
Built for automotive networks, the CAN protocol is used in most passenger cars. It allows data communication between multiple ECUs without any individual wiring. Most cars have a CAN-based engine management system. Not only that, most cars connect body electronic ECUs through CAN-based multiplex systems. Vehicle entertainment systems are connected via the CAN bus. Additionally, the CAN bus is used by diagnostic systems in vehicles. ISO-15765 is a specification for CAN-based diagnostic interfaces. CAN is also used for connection-oriented data communication between automotive entertainment devices.
In electric cars and hybrid vehicles, the CAN network has an unexpectedly broader role to play. It is useful for communication between inverters, battery management systems and servo motor controllers. It also connects servo controllers with human-machine interface to the driver. Although CANopen is the most used CAN variant in non-automotive applications, it is the one that is finding use in hybrid and electric vehicles.
Many agricultural machines, such as excavators and forklifts, rely on CAN-based networks. In truck cranes, CAN is used for monitoring and controlling the crane system.
CAN in public transport systems
The CAN protocol is widely used in high-speed trains and aircraft. Trains use CAN to connect brake control systems. On high-speed trains, CAN is used to enable automatic braking. Trains also use CAN to communicate with subsystems such as brake control, door control, diagnostics, freight car monitoring, and to communicate with gateways in train bus systems. CAN is also useful in automating customer service and passenger information systems.
In road transport, CAN-based sensor networks are used for speed detection, traffic surveillance and traffic light management. CAN is also the protocol used by marine electronic equipment. It is also used to connect aircraft engine control systems with flight status sensors and navigation systems.
CAN for industrial automation
Being a reliable serial communication protocol equipped with error detection methods, robust signal logic and fault confinement capability, CAN-based protocols such as CANopen, DeviceNet and Smart Distributed Systems are widely used for controlling industrial machines. Semiconductor manufacturing equipment, carton packaging machines, textile processing machines, printing machines and quality control equipment all rely on embedded CAN networks. CAN-based distributed control systems are widely used for robot control and assembly line automation.
CAN in building automation
In building automation, the CAN protocol is widely used across subnets. Elevator and elevator control system, air conditioning systems, automatic doors, automatic curtain openers, blind control systems, heating and cooling systems, and lighting control systems use CAN-based protocols for communication between electronic devices. different domains.
CAN in medical electronics
Due to robust signals, error detection capabilities, and inter-domain communication, CAN is a widely applied protocol for on-device communication in medical electronic equipment such as X-ray machines and CT scanners. CAN-based protocols are also applied to networks between devices in intensive care units and operating rooms.
CAN in embedded electronics
CAN enables flexible embedded networking and is employed as a system bus in many consumer appliances and devices, such as washing machines, vending machines, audio and video systems, coffee machines, and many other household appliances.