Site Information

 Loading... Please wait...


SAE J1939 250k/500k Baudrate Converter with Arduino Due - Source Code Included

Posted by Wilfried Voss on

The introduction of 500 Kbps (see SAE J1939/14) as an alternative to 250 Kbps, required clarifications on how to solve problems that come with incorporating devices supporting different baud rate settings in the same network. One solution comes with automatic baud rate detection. The SAE J1939/16 document outlines the methods used to detect the baud rate of an SAE J1939 network segment by ECUs that can adjust their CAN baud rate while in use. The specified approach provides a reliable method to detect the CAN baud rate of that network segment without interrupting network communications.

For more information, see our post  SAE J1939/16 Automatic Baud Rate Detection Process.

However, there are scenarios where automatic baud rate detection does not apply, e.g., attempts to connect a 250k supporting device into an existing 500k network or vice versa, assuming that the device does not support baud rate detection. For such cases, one will require a baud rate converter. This post describes the implementation of such a converter using our  Arduino-Based ECU Development Board with Dual CAN Interface

Note: The two CAN ports are not galvanically isolated, which does not pose a problem. It is, however, recommended to use isolated CAN ports to prevent grounding loops. The use of galvanically isolated CAN ports will, however, increase the hardware costs tremendously.

The board comes with two CAN ports of which one receives and transmits 250k SAE J1939 data frames, and the second port does so at 500k. The above image represents my test setup with the Arduino Due acting as the baud rate converter. I used two of our  SAE J1939 ECU Simulator boards in combination with the JCOM1939 Monitor software for Windows.

I set up one J1939-USB board to represent node 128 at 500k baud:

The second J1939-USB board was set up to represent node 129 at 250k baud:

The next image shows the data traffic at node 128:

Row 1: Node 128 receives address claim from node 129.

Row 2: Node 128 transmits PGN FF01 hex.

Row 3: Node 128 receives PGN FF00 hex from node 129.

A similar scenario happened at node 129:

Row 1: Node 129 receives address claim from node 128.

Row 2: Node 129 receives PGN FF01 from node 128.

Row 3: Node 129 transmits PGN FF00.

After this first test, I assigned transmit frequencies to the PGNs, and the data traffic is demonstrated here:

The above image shows two instances of the JCOM1939 monitor software, one assigned to node 128, the other to node 129.

The Arduino code is fairly simple, and I will only refer to the most important section:

The code shows that CAN port 0 repeats every data frame it receives and transmits it per CAN port 1. The same happens the other way around.

The code can be easily extended to support message mapping, i.e., re-assigning message IDs (PGNs). The application can also be used as a CAN Repeater, Network Extender, and more.

Click here to download the Arduino code...

SAE J1939 Starter Kit And Network Simulator

SAE J1939 Starter Kit And Network Simulator

Our J COM.J1939 Starter Kit And Network Simulator is designed to allow the experienced engineer as well as the beginner to experiment with SAE J1939 data communication without the need of connecting to a real-world J1939 network, i.e. a diesel engine. It may sound obvious, but in order to establish a network, you need at least two nodes, and that fact applies especially to CAN/J1939 where the CAN controller will basically shut down after transmitting data without receiving a response. For that reason, our jCOM.J1939 Starter Kit And Network Simulator consists of two J1939 nodes, namely our jCOM.J1939.USB, an SAE J1939 ECU Simulator Board With USB Port.

More Information...

LIN Bus Simulation Device with USB Interface Controlled by Windows Software

The Baby-LIN-II by Lipowsky Industrie-Elektronik is a compact system for controlling a LIN BUS network via USB. The PC works as a LIN monitor, LIN Master, or LIN Slave. The system also supports operation in stand-alone mode and allows the execution of continuously running sequences without a PC. In addition, the galvanic isolation guarantees interference-free data transmission. The [...]

Read More »

Under Development: Programmable CAN Bus to USB, Bluetooth, BLE, WiFi Gateway

For the longest time, I had resisted the idea of creating my version of a CAN-to-USB gateway, primarily due to the vast competition. A professional CAN/J1939 development requires a professional CAN-to-PC solution to monitor data traffic. I am pleased with the PEAK PCAN-USB device, as shown in the above image. However, not everybody is willing [...]

Read More »

Telematics Gateway for Real-Time SAE J1939 or ISOBUS Data Monitoring

The CANUp telematics gateway by Technoton measures the operational parameters of vehicles and equipment and reports their performance. The core feature of the CANUp gateway includes the utilization of edge/fog computing methods, which detect 10,000+ possible parameters of vehicle or equipment operation and send generated operation reports to a web-based telematics server and directly to a user via [...]

Read More »

Standard IoT Gateway with ARM i.MX8M Plus Quad-Core Cortex-A53 Supports Two CAN FD Ports

Aaeon, a manufacturer of reliable and high-quality computing platforms, introduced their SRG-IMX8P IoT gateway solution with two CAN FD interfaces, bringing extended connectivity and utility across vertical markets. It is powered by Arm NXP i.MX8M Plus quad-core Cortex-A53 and Cortex-M7 processors with 8 GiB of onboard DDR4, the device reduces object detection time to 13 msec [...]

Read More »

NMEA 2000 Data Scanner with Bluetooth, BLE for Android, iOS, PC Applications

Our N2K-BT gateway functions as a NMEA 2000 to Bluetooth data scanner for any host device with a Bluetooth or BLE (Bluetooth Low Energy) port, such as PCs, phones, or tablets. Therefore, it supports operating systems such as Windows, Linux, iOS, Android, and more. In addition, the wireless communication protocol employs easy-to-read and easy-to-process ASCII [...]

Read More »

ESP32 Based CAN Bus, SAE J1939 and NMEA 2000 to Bluetooth Gateway

The following is a follow-up on our post  Controller Area Network (CAN), SAE J1939, NMEA 2000 Wireless Module for IoT and ELD Applications. The CAN Bus, SAE J1939 and NMEA 2000 to Bluetooth Gateway is the first product of a new series of wireless gateways for IoT (Internet of Things), ELD (Electronic Logging Devices), and other applications. At the [...]

Read More »

SAE J1939 Starter Kit and Network Simulator - New Hardware Variant Using the ESP32 Processor

Our SAE 1939 Starter Kit And Network Simulators allow the experienced engineer and the beginner to experiment with SAE J1939 data communication without connecting to a real-world J1939 network, i.e., a diesel engine. To establish a network, you need at least two nodes. That fact applies, especially to CAN/J1939 nodes. A single CAN Bus controller [...]

Read More »

Four Channel CAN Bus to USB Gateway Using The Arduino Due

In the past, I frequently received inquiries regarding the availability of a four-channel CAN Bus gateway. Such devices exist in the marketplace; however, they are usually costly, and, after all, they don't support easy customization or programming. While we at Copperhill Technologies have the ability to create such a gateway, this is primarily a matter [...]

Read More »

SAE J1939 Protocol Converter Supports Modbus And Ethernet Connectivity

Axiomatic Technologies announced the release of their AX141810, a Modbus router with CAN Bus and Ethernet connectivity. It is available in two variants. The protocol converter is user-configurable via a web browser, featuring data exchange between a CAN Bus network, specifically SAE J1939, EIA-485, and Ethernet.The unit integrates one isolated extended frame format CAN Bus interface, [...]

Read More »