Site Information

 Loading... Please wait...


SAE J1939 Programming with Arduino - Introduction to Controller Area Network

Posted by Wilfried Voss on

This post is part of a series about SAE J1939 ECU Programming & Vehicle Bus Simulation with Arduino.

SAE J1939 ECU Programming & Vehicle Bus Simulation with Arduino

Controller Area Network (CAN Bus) is a serial network technology that was originally designed for the automotive industry, especially for European cars, but has also become a popular bus in industrial automation as well as other applications. 

The CAN Bus is primarily used in embedded systems, and as its name implies, is a network technology that provides fast communication among microcontrollers up to real-time requirements, eliminating the need for the much more expensive and complex technology of a Dual-Ported RAM.

CAN Bus is a two-wire, half duplex, high-speed network system, that is far superior to conventional serial technologies such as RS232 in regards to functionality and reliability and yet CAN implementations are more cost effective. 

While, for instance, TCP/IP is designed for the transport of large data amounts, CAN is designed for real-time requirements and with its 1 MBit/sec baud rate can easily beat a 100 MBit/sec TCP/IP connection when it comes to short reaction times, timely error detection, quick error recovery and error repair.

CAN Bus networks can be used as an embedded communication system for microcontrollers as well as an open communication system for intelligent devices. Some users, for example in the field of medical engineering, opted for CAN because they have to meet particularly stringent safety requirements. Similar requirements had to be considered by manufacturers of other equipment with very high safety or reliability requirements (e.g. robots, lifts and transportation systems).

The greatest advantage of Controller Area Network lies in the reduced amount of wiring combined with an ingenious prevention of message collision (meaning no data will be lost during message transmission).

The following shows a need-to-know overview of CAN’s technical characteristics.

Controller Area Network

  • Is a serial networking technology for embedded solutions.
  • Needs only two wires named CAN_H and CAN_L.
  • Operates at data rates of up to 1 Megabit per second.
  • Supports a maximum of 8 bytes per message frame.
  • Does not support node IDs, only message IDs. One application can support multiple Message IDs.
  • Supports message priority, i.e. the lower the message ID the higher its priority.
  • Supports two message ID lengths, 11-bit (standard) and 29-bit (extended).
  • Does not experience message collisions (as they can occur under other serial technologies).
  • Is not demanding in terms of cable requirements. Twisted-pair wiring is sufficient.

Note: For more detailed information on CAN, please refer to the official CiA/Bosch specification or to A Comprehensible Guide to Controller Area Network.

A Comprehensible Guide to J1939

SAE J1939 has become the accepted industry standard and the vehicle network technology of choice for off-highway machines in applications such as construction, material handling, and forestry machines. J1939 is a higher-layer protocol based on Controller Area Network (CAN). It provides serial data communications between microprocessor systems (also called Electronic Control Units - ECU) in any kind of heavy duty vehicles. The messages exchanged between these units can be data such as vehicle road speed, torque control message from the transmission to the engine, oil temperature, and many more.

A Comprehensible Guide to J1939 is the first work on J1939 besides the SAE J1939 standards collection. It provides profound information on the J1939 message format and network management combined with a high level of readability.


SAE J1939 Programming with Arduino - A Brief Introduction to the SAE J1939 Protocol

This post is part of a series about SAE J1939 ECU Programming & Vehicle Bus Simulation with Arduino. The Society of Automotive Engineers (SAE) Truck and Bus Control and Communications Subcommittee has developed a family of standards concerning the design and use of devices that transmit electronic signals and control information among vehicle components. SAE J1939 and its companion documents have quickly become [...]

Read More »

Local Interconnect Network (LIN) To Controller Area Network (CAN Bus) Converter

The LIN (Local Interconnect Network) bus is an inexpensive serial communications protocol, which effectively supports remote application within a car's network. It is particularly intended for mechatronic nodes in distributed automotive applications, but is equally suited to industrial applications. It is intended to complement the existing CAN network leading to hierarchical networks within cars.Controller Area Network [...]

Read More »

CAN Bus (Controller Area Network) Projects with ARM Cortex M3 and Arduino Uno

This book details the use of the ARM Cortex-M family of processors and the Arduino Uno in practical CAN bus based projects. Inside, it gives a detailed introduction to the architecture of the Cortex-M family whilst providing examples of popular hardware and software development kits. Using these kits helps to simplify the embedded design cycle [...]

Read More »

The Car Hacker's Handbook For Deeper Understanding Of Embedded Systems In Modern Vehicles

Modern cars are more computerized than ever. Think infotainment and navigation systems, Wi-Fi, automatic software updates, and other innovations that aim to make driving more safe and convenient. However, vehicle technologies haven not kept pace with today's more hostile security environment, which might leave millions of cars vulnerable to attack. The Car Hacker's Handbook will give [...]

Read More »

Position Control With Embedded J1939-Compliant Linear Actuator Is Superior To Hydraulic Actuator

Manufacturers of agricultural, construction, and other off-highway equipment are increasingly deploying electromechanical actuators instead of hydraulic actuators, the primary reason being their simplicity and environmental benefits. Now, intelligent electromechanical actuators that support the Controller Area Network (CAN) bus networking standard give designers more reasons to choose such a solution. Support for the CAN/J1939 networking protocol [...]

Read More »

CAN Bus Bridge (CAN-to-CAN) Application With Arduino Due

Basically, there are two scenarios where a CAN Bridge application is of use:1. Connecting two separate CAN Bus networks.2. Network length extension.While the first scenario is more or less self-explanatory, let's look a little closer into the network length extension: The physical CAN network length depends primarily on the CAN baud rate, i.e. the higher [...]

Read More »

SAE J1939 Turbo Interface Board for Raspberry Pi

A note upfront: The CAN interface board for the Raspberry Pi as described in the following, specifically the firmware code, is under current development. The hardware is ready for production, and the release is targeted for end of February 2017.This post is a follow-up on a previous post Raspberry Pi With CAN Bus Or SAE J1939 [...]

Read More »

Raspberry Pi With CAN Bus Or SAE J1939 Turbo Interface Board

A note upfront: The CAN interface board for the Raspberry Pi as described in the following, specifically the firmware code, is under current development. The hardware is currently in production, and the release is targeted for the end of February 2017. If you have a special interest in running the SAE J1939 protocol on the Raspberry [...]

Read More »

CAN Bus Interface For the Raspberry Pi 2/3 Comes With Various Options

The PiCAN2 board series by Copperhill Technologies provides CAN Bus capabilities for the Raspberry Pi 2 or 3. The boards (with the exception of the dual isolated interface) use the Microchip MCP2515 CAN controller in combination with the MCP2551 CAN transceiver. There is an easy to install SocketCAN driver, and programming can be accomplished in C [...]

Read More »