Controller Area Network (CAN Bus) And Higher-Layer Protocols CANopen, SAE J1939, NMEA 2000
For the longest time, the major misconception about Controller Area Network (CAN) was that it merely applies to automobiles. The truth is, CAN, since its introduction in 1986, proved to be a robust, versatile, and straightforward technology and, consequently, the CAN Bus technology found its way into all areas of applications where microprocessors need to communicate among each other.
Along with its undeniable use in automobiles, CAN applications do not only include industrial automation tasks, but any application where distributed control is advantageous and/or a serial bus system will eliminate excessive wiring. CAN proved to be superior to any other field-bus system regarding low cost, the ability to function in a challenging electrical environment, a high degree of real-time capability, excellent error detection and fault confinement capabilities and, almost contradictory to the previously mentioned features, ease of use.
Nowadays, CAN has no particular niche; its use is universal from any industrial application, space, and aviation, maritime, medical, down to household appliances such as washers, dryers, and even coffee machines.
The ease of use is especially evident for the software engineer responsible for the development of a CAN-based application. The actual CAN Bus protocol, i.e., the entire data communication management, including bus arbitration, error detection, and fault confinement, etc., etc., are implemented into silicon. CAN Bus controllers know per default what to do and how to do it.
For more detailed information about the CAN Bus technology, see:
- A Brief Introduction to Controller Area Network...
- A Comprehensible Guide to Controller Area Network...
Higher Layer Protocols
Although extremely useful in automobiles and small applications, CAN alone is not suitable for machine automation since its communication between devices is limited to only eight bytes. Consequently, higher-layer protocols such as CANopen for machine control, DeviceNet for factory automation, SAE J1939 for offroad vehicles, and NMEA 2000 for marine applications were designed to provide a real networking technology that supports messages of unlimited length and allow a master/slave configuration.
To explain higher layer protocols, we must refer again to the ISO/OSI Reference Model, as shown in the image. The standard CAN implementation bypasses the connection between the Data Link Layer and the Application Layer. The layers above the Data Link Layer are covered by additional software, representing a higher-layer protocol.
To put it in a nutshell, higher layer protocols are necessary, because:
- They enable data transport of more than 8 bytes per message
- Embedded Systems may require an appropriate communication model based on Master/Slave configuration
- They provide Network Management (Network Start-Up, Node Monitoring, Node Synchronization, etc.)
The most popular higher layer protocols based on Controller Area Network are:
- SAE J1939
- NMEA 2000
CANopen and DeviceNet are mainly used in industrial control applications. CANopen, however, is to a certain degree also suitable for vehicle applications. Both protocols provide powerful and complete protocol features. Still, it is also safe to say that they are over-engineered, making it very difficult to understand them in their entirety.
SAE J1939 is a very ingeniously designed protocol that takes a resourceful advantage of the CAN 29-Bit message identifier. Rather than relying on a myriad of protocol functions, SAE J1939 uses predefined parameter tables, which keeps the actual protocol on an understandable level. SAE J1939 is a prime example of sound American engineering according to the KISS principle (KISS = Keep It Simple, Stupid!), but it is nevertheless at least as useful as CANopen or DeviceNet.
- Is suited for embedded applications
- Was originally designed for motion control
- Was developed and is maintained by the CAN-in-Automation User Group
Like CAN, the CANopen standard is the responsibility of CiA (CAN-in-Automation). For further information, refer to http://www.can-cia.org.
- Is suited for industrial applications (floor automation)
- Was developed by Allen Bradley/Rockwell
- Is maintained by Open DeviceNet Association (ODVA)
The DeviceNet Specification, consisting of two volumes: Volume One - Common Industrial Protocol (CIP) and Volume Three- DeviceNet Adaptation of CIP, is available only for ODVA (Open DeviceNet Vendor Association) members. For further information, refer to http://www.odva.org.
- Defines communication for vehicle networks (trucks, buses, etc.)
- Does not support a Master/Slave Configuration
- Is a standard developed by the Society of Automotive Engineers (SAE)
The SAE J1939 Standards Collection can be found exclusively on the Web at http://www.sae.org.
NMEA 2000 is a marine networking standard created by, and administered by, the National Marine Electronics Association (NMEA). The NMEA is an association of marine electronics manufacturers, dealers and technicians. NMEA 2000 is a derivative of SAE J1939, i.e. it uses the same protocol features.
- What is NMEA 2000? (PDF)...
- NMEA 2000 Explained (PDF)...
- The Basics of NMEA 2000 (Boating Magazine)...
PICAN Series of CAN Bus Boards for the Raspberry Pi
The Raspberry Pi is a low-cost, credit-card-sized single-board-computer connected to a computer monitor or TV and uses a standard keyboard and mouse. It is a small but capable device that empowers people of all ages to discover computing and learn how to develop applications in programming languages such as Scratch and Python. It can perform almost everything you expect from a standard desktop computer, from browsing the internet and playing high-definition videos to creating spreadsheets, word-processing, or playing games.
However, as our product line shows, the Raspberry Pi is also very well capable of supporting industrial applications and prototyping. We at Copperhill Technologies keep a focus on CAN Bus (Controller Area Network) technologies and higher-layer protocols, such as OBD-II, SAE J1939, and CANopen. The PICAN series of CAN Bus boards for the Raspberry Pi represents a professional and extremely reliable option for CAN Bus development and prototyping.