Site Information

 Loading... Please wait...

Blog

Developing SAE J1939 Applications with ARD1939 and Copperhill Technologies Hardware

Posted by Wilfried Voss on

ARD1939- A Portable SAE J1939 Protocol Stack for Arduino, ESP32, and Embedded SystemsOne of the challenges of developing SAE J1939 applications is finding a protocol stack that is both affordable and flexible enough for prototyping, education, and custom embedded projects.

To address this need, we developed ARD1939, a portable C++ SAE J1939 protocol stack that serves as the software foundation for many of our development projects and examples.

Originally created for the Arduino Uno, ARD1939 has evolved into a portable implementation that supports Arduino, ESP32, and other embedded platforms. The software provides the core functionality required for building real-world SAE J1939 applications, including Network Management, Address Claiming, Transport Protocol (BAM and RTS/CTS), Request Messages, and PGN transmission and reception.

Unlike many protocol implementations that focus solely on demonstrating a few messages, ARD1939 was designed as a complete software framework for embedded development.

The protocol stack is currently available as a precompiled library, allowing developers to begin building and testing applications immediately. With the release of the upcoming book, “J1939 Development for Embedded Systems,” the complete C++ source code will also be released under an open-source license.

At Copperhill Technologies, we use ARD1939 together with many of our CAN Bus and SAE J1939 development products, including Arduino, ESP32, and Teensy-based hardware platforms. This combination allows engineers to move quickly from evaluating the protocol to developing fully functional embedded applications.

For complete information about the ARD1939 protocol stack, including its architecture, programming interface, supported hardware, and ongoing documentation, visit:

https://ard1939.com

If you’re interested in learning the implementation details behind SAE J1939, be sure to read the complete article:

https://jcom1939.com/ard1939-a-portable-sae-j1939-protocol-stack-for-arduino-esp32-and-embedded-systems/

Questions, suggestions, or feedback? Join the growing J1939 engineering community at:

https://jcom1939.com/forum/

Whether you’re developing a prototype, building an ECU, or simply learning the SAE J1939 protocol, ARD1939 and the accompanying educational resources provide a practical starting point for your next embedded systems project.

SAE J1939 C Library - Including Source Code - for CAN-Enabled PICmicro Microcontrollers

SAE J1939 is a series of SAE recommended practices that have been developed to provide a standard architecture by which various electronic systems on a vehicle can communicate. It was developed by the Truck and Bus Control and Communications Network Subcommittee of the Truck and Bus Electrical and Electronics Committee, but its application is not [...]

Read More »


SAE J1939 Programming with Arduino – Function Calls Description

This post is part of a series about SAE J1939 ECU Programming & Vehicle Bus Simulation with Arduino. j1939.Initvoid j1939.Init(int nSystemTime);Initializes the ARD1939’s memory, baud rate settings, etc.nSystemTime - This is the loop time of your application in milliseconds. This information will provide the ARD1939 protocol stack a time base to manage all timers required for various protocol tasks.Ideally, the system [...]

Read More »


SAE J1939 Programming with Arduino – Application Structure

This post is part of a series about SAE J1939 ECU Programming & Vehicle Bus Simulation with Arduino. As with every Arduino application, the initialization of data and the J1939 protocol takes place during the setup() function, while the actual application resides in loop(). setup() - The j1939.Init function is mandatory to operate ARD1939. [...]

Read More »


SAE J1939 Programming with Arduino – ARD1939 Protocol Stack Reference

This post is part of a series about SAE J1939 ECU Programming & Vehicle Bus Simulation with Arduino. The functions available to the SAE J1939 application layer (i.e your program) are:Initialization j1939.Init – Initializes the protocol stack settings j1939.SetPreferredAddress – Sets the preferred node (source) address j1939.SetAddressRange– Sets the negotiable [...]

Read More »


SAE J1939 Programming with Arduino – RTS/CTS Session Test Program

This post is part of a series about SAE J1939 ECU Programming & Vehicle Bus Simulation with Arduino. Just for kicks, I extended the previously used Arduino sketch to simulate a fully functional RTS/CTS session (yet again, the code is highly tailored to the previous RTS/CTS session). Based on that sketch, I could simulate all error scenarios on the receiver’s side.This [...]

Read More »


SAE J1939 Programming with Arduino – Conclusion

This post is part of a series about SAE J1939 ECU Programming & Vehicle Bus Simulation with Arduino. With all previous programming examples installed and explained, you should now have a pretty good grip on programming your own SAE J1939 application with the Arduino Uno and/or the Mega 2560.Yet, there are still numerous, possible scenarios for J1939 applications and all [...]

Read More »


SAE J1939 Programming with Arduino – ARD1939 Sample Application

This post is part of a series about SAE J1939 ECU Programming & Vehicle Bus Simulation with Arduino. The typical SAE J1939 ECU application not only involves the protocol stack but also a good amount of input and/or output processing. This could involve reading sensors and sending the result in form of a PGN or reading a PGN and setting [...]

Read More »


SAE J1939 Programming with Arduino – End of Message Acknowledgment Timeout

This post is part of a series about SAE J1939 ECU Programming & Vehicle Bus Simulation with Arduino. In order to test all timeouts during an RTS/CTS session, I used a dedicated Arduino sketch to simulate all the “nasty” features that would trigger a communication breakdown. This method was easier to implement rather than using a full SAE J1939 stack. [...]

Read More »


SAE J1939 Programming with Arduino – Clear to Send Timeout

This post is part of a series about SAE J1939 ECU Programming & Vehicle Bus Simulation with Arduino. The simplest test for a Clear to Send timeout is accomplished by running the Mega 2560 ECU as the only node in the network.To test this scenario, I run the Mega 2560 at an address of 0x80 (128) and attempt to initiate [...]

Read More »