Site Information

 Loading... Please wait...

CAN Bus And SAE J1939 Recording and Simulation Using the Raspberry Pi

Posted by Industry News on

SAE J1939 Turbo Interface for Raspberry PiThe Raspberry Pi is a series of small single-board computers developed in the United Kingdom by the Raspberry Pi Foundation to promote the teaching of basic computer science in schools and in developing countries. The original model became far more popular than anticipated, selling outside of its target market for uses such as robotics. Peripherals (including keyboards, mice and cases) are not included with the Raspberry Pi. Some accessories however have been included in several official and unofficial bundles.

According to the Raspberry Pi Foundation, over 5 million Raspberry Pis have been sold before February 2015, making it the best-selling British computer. By November 2016 they had sold 11 million units.

The Raspberry Pi is undoubtedly the perfect embedded system to read and simulate CAN Bus and J1939 data streams for communication with a vehicle bus. The Linux operating system provides comfortable means of an established file management system combined with great speed, and these days there are multiple choices for the appropriate RPi CAN or SAE J1939 hardware interface.

CAN Bus Interfaces

PiCAN2 - CAN Interface for Raspberry Pi With SMPS

The PiCAN2 board series provides Controller Area Network (CAN) Bus capabilities for the Raspberry Pi. It uses the Microchip MCP2515 CAN controller with MCP2551 CAN transceiver. Connection are made via DB9 or 3-way screw terminal.

There is an easy-to-install SocketCAN driver, and programming can be accomplished in C or Python.

The boards are offered with various options, including SMPS (Switch-Mode power supply for extended input power), one or two CAN Bus ports, isolated CAN Bus ports, GPS, and more.

Features

  • CAN v2.0 A/B at 1 Mb/s
  • High speed SPI Interface (10 MHz)
  • Standard and extended data and remote frames
  • CAN connection via standard 9-way sub-D connector or screw terminal
  • Compatible with OBDII cable
  • Solder bridge to set different configuration for DB9 connector
  • 120Ω termination resistor
  • Serial LCD ready
  • LED indicator
  • Foot print for two mini push buttons
  • Four fixing holes, complies with Pi Hat standard
  • SocketCAN driver
  • Interrupt RX per GPIO
  • More Information...

SAE J1939 Interface

jCOM.J1939.RPi SAE J1939 Turbo Interface For Raspberry Pi 3

While it is definitely possible to run an SAE J1939 protocol stack on the Raspberry Pi, there are some obstacles, one of them being the lack of availability of appropriate software in the marketplace. Also, despite the RPi's powerful processor, there can be timing performance issues, which primarily depend on the actual application and its load on the CPU (e.g. video processing).

The solution comes in form of the jCOM.J1939.RPi interface, which allows the Raspberry Pi to run a J1939 application comfortably even at high bus load, without slowing down application responses. All this is supported by an extensive programming library (in C source code) and sample code.

The jCOM.J1939.RPi integrates an 100 MHz ARM Cortex-M3 with a CAN transceiver and a fast serial connection to the Raspberry Pi. The processor, acting as an SAE J1939 gateway, receives and processes all J1939 data frames, including filtering of PGNs, thus reducing the processing burden on the RPi CPU. The processor also manages all timing requirements according to the SAE J1939 standards, which eliminates any impact on protocol performance due to high RPi CPU loads.

The processed data delivered to the application includes the PGN, data, and priority. Any data length, either the standard 8 bytes or up to 1785 bytes (TP = Transport Protocol) are supported, freeing the application engineer from managing tedious protocol features.


Electronics Cookbook: Practical Electronic Recipes with Arduino and Raspberry Pi

Electronics Cookbook: Practical Electronic Recipes with Arduino and Raspberry Pi by Simon Monk

If you’re among the many hobbyists and designers who came to electronics through Arduino and Raspberry Pi, this cookbook will help you learn and apply the basics of electrical engineering without the need for an EE degree. 

Through a series of practical recipes, you’ll learn how to solve specific problems while diving into as much or as little theory as you’re comfortable with.

Author Simon Monk (Raspberry Pi Cookbook) breaks down this complex subject into several topics, from using the right transistor to building and testing projects and prototypes. 

With this book, you can quickly search electronics topics and go straight to the recipe you need. It also serves as an ideal reference for experienced electronics makers.

This cookbook includes:

  • Theoretical concepts such as Ohm’s law and the relationship between power, voltage, and current
  • The fundamental use of resistors, capacitors and inductors, diodes, transistors and integrated circuits, and switches and relays
  • Recipes on power, sensors and motors, integrated circuits, and radio frequency for designing electronic circuits and devices
  • Advice on using Arduino and Raspberry Pi in electronics projects
  • How to build and use tools, including multimeters, oscilloscopes, simulations software, and unsoldered prototypes
  • More Information...