Site Information

 Loading... Please wait...

SAE J1939 ECU Programming & Vehicle Bus Simulation with Arduino - Arduino Programming (Sketches)

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

The implementation of either one of the introduced CAN Bus Shields and the corresponding CAN Bus sketches went surprisingly smooth when paired with the right library software.

Note: All Arduino CAN Bus/SAE J1939 sketches as explained in the following include the MPC2515 library plus the interface between the CAN Bus and SAE J1939 layers. If you are eager to jump into the J1939 programming, you may skip this chapter and use the information when you start your own CAN/J1939 projects.

I found several source code examples for accessing the MCP2515 CAN controller, but most of them didn’t even pass the initial quality control phase (I read the code first before I use it). One of the quality criteria was the support for 29-bit CAN Bus message identifiers (CAN 2.0B Compatibility), which is mandatory when it comes to implementing the SAE J1939 vehicle network protocol. Some software samples I found were just literally “samples” and they left ample room for guessing games.

I was most pleased by the MPC2515 Library by Cory Fowler, which can be found at
https://github.com/coryjfowler/MCP2515_lib.

This library is compatible with any shield or CAN Bus interface that uses the MCP2515 CAN protocol controller.


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.

Read more...