Recent Posts
Easy Integration Of CANopen Or SAE J1939 Protocol Stack Into Any Embedded System With Serial Input
Posted by
onThe simple assumption behind the statement of easy integration of a CANopen or SAE J1939 protocol stack is that virtually every embedded system (and even other industrial controls such as PLCs) do have a serial port of some sort, mostly UART, RS232, or USB. "Easy" also implies that you don't have to go through major hoops to provide critical timers and interrupt services, but rather reading reading serial information.
In the following, I will introduce two solutions that meet these requirements, and both are based on hardware protocol converters using an on-chip protocol stack.
CANgineBerry - CANopen Module for Raspberry Pi
The CANgineBerry for CANopen, as its name implies, was originally designed for the Raspberry Pi system, but it can also easily be used for other systems that provide a UART port.
The board is an active CAN Bus co-processor module that uses a regular UART communication channel towards the host system. With its independent 32-bit microcontroller, the CANgineBerry can efficiently execute CAN Bus protocols with stringent timing demands such as CANcrypt or CANopen with response times of under 10 ms.
Depending on the configuration, the CAN Bus communication can be up and running within 50 ms after power-on, even if the host system takes significantly longer to boot.
Available firmware options at launch include a generic minimal CANopen Manager/Controller and a CANopenIA Device both based on the CANopenIA implementation.
The connection to the host system uses only four pins: Two for power (5 V) and two for the UART. The four-pin header row directly matches the Raspberry Pi pin layout, but also other conventional connectors, such as popular USB-to-UART converter chips/modules, if the correct voltage levels are used (5 V supply, 3.3 V signals).
The serial protocol between host and CANopenIA is the CANopen remote access protocol by Embedded Systems Academy. It supports reporting events (new data arrived on CANopen side) as well as reading and writing data of the local Object Dictionary.
The CANopen Manager performs automatic network scans, simplifying application code as it can directly access the data scanned.
SAE J1939 ECU Simulator Board With USB Port
The jCOM.J1939.USB gateway board is a high-performance, low-latency vehicle network adapter for SAE J1939 applications. It allows any host device with a USB COM port to monitor SAE J1939 data traffic and communicate with the SAE J1939 vehicle network.
The board can be easily modified (solder jumpers) to support UART mode instead of USB.
The board supports the full SAE J1939 protocol according to J1939/81 Network Management (Address Claiming) and J1939/21 Transport Protocol (TP). It is also supported by an extensive programming interface for Windows and Linux/Ubuntu applications, including full C/C++/C# source code for short time-to-market developments.
The strength of the board lies in the fact that the entire SAE J1939 protocol, including all timing requirements, is stored on-chip, thus taking the burden off the main system. The board uses a USB COM port to communicate with the main system, i.e. all data transfer is handled through a standard COM port access. The communication protocol between the board and the main system is well documented and thus allows a porting to any computer system with a USB connection. Working source code libraries exist for Windows (C# under Visual Studio 2102/2013), Linux and its derivatives (C++ using Code::Blocks), and Raspberry Pi (C using the standard gcc compiler).
With all its features, the jCOM.J1939.USB allows the simulation of an SAE J1939 ECU (Electronic Control Unit) using embedded solutions such as the Raspberry Pi, BeagleBone, Arduino, Teensy, and others but also PCs running Windows or Linux (incl. Ubuntu, Fedora, etc.).
CAN (Controller Area Network) is a serial communication protocol that was originally developed for the automobile industry. CAN is far superior to conventional serial technologies such as RS232 in regards to functionality and reliability and yet CAN implementations are more cost-effective.
CANopen, a higher layer protocol based on CAN, provides the means to apply the ingenious CAN features to a variety of industrial-strength applications. Many users, for example in the field of medical engineering, opted for CANopen 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).
Providing a detailed look at both CAN and CANopen, this book examines those technologies in the context of embedded networks. There is an overview of general embedded networking and an introduction to the primary functionality provided by CANopen. Everything one needs to know to configure and operate a CANopen network using off-the-shelf components is described, along with details for those designers who want to build their own CANopen nodes.
The wide variety of applications for CAN and CANopen is discussed, and instructions in developing embedded networks based on the protocol are included. In addition, references and examples using MicroCANopen, PCANopen Magic, and Vector's high-end development tools are provided.