You are on page 1of 10

J1939 Introduction

This article is intended to give engineers a brief overview of the SAE J1939 protocol.

SAE J1939 is a replacement for the SAE J1587/J1708 network which has been used for medium and heavy duty commercial vehicles for the past 20 years. Today J1939 is used as the standard communications bus for commercial vehicle's diagnostic and control applications. Due to its popularity and success, it has been adopted by the agricultural (ISO 11789) and marine industries (NMEA2000). Competing high-level CAN protocols are ISO 15765 and CANopen.

J1939 Overview

SAE J1939 is a high level communications protocol, which operates on a Controller Area Network (CAN) bus. J1939 specifies exactly how information (e.g. engine RPM) is exchanged between electronic control units (ECUs) on a vehicle.

It defines the data's priority, size, scaling, and offset. For example, J1939 specifies engine RPM to have a default priority of 3, to have a size of 16-bits, a resolution of 0.125 rpm/bit, and an offset of 0.

The standard goes on to define many other aspects, including message timeouts, how large messages are fragmented and reassembled, the network speed, the physical layer, and how applications acquire network addresses.

J1939 Messages

At the heart of J1939 is the Parameter Group Number (PGN), which is a unique number assigned to every J1939 message. The PGN serves to identify the message and its data. Although sometimes a message will contain a single parameter (e.g. VIN), typically the PGN will contain a group of parameters. In the standard there is a total of 8,672 PGNs.

For an example message, take PGN 61,444. It identifies the "Electronic Engine Controller 1" message. Per the specification, "EEC1" has seven different parameters embedded in the data field of the message. Engine RPM is one of those seven parameters.

J1939 Message Sizes

The majority of messages in J1939 are 8 bytes in length. 8 bytes. and variable length. There is only one message which is three bytes in length. J1939 Physical Layers Currently there are two 250 Kbps physical layers defined.785 bytes. J1939-11 specifies a shielded twisted pair of wires with a maximum backbone length of 40 meters. J1939-14. J1939-15 specifies an unshielded twisted pair of wires with a maximum backbone length of 40 meters. J1939-11 and J1939-15.904). It uses a three pin connector and allows for up to 30 nodes. with a 500 Kbps layer.J1939 has three different allowed message sizes. It uses a two pin connector and allows for up to 10 nodes. This allows for a more efficient use of the network bandwidth by maximizing the amount of data on the network by reducing the number of messages. These messages are too large to fit in a single CAN data frame and must be fragmented by the transmitter and reassembled by the receiver. they are: 3 bytes. and that is the request message (PGN 59. under development. Variable length messages are messages with a length from 9 to 1. J1939 to RS232 SAE J1939 CANopen Software . This process is defined by J1939's transport protocol which is specified by J1939-21.

que tienen un tamaño de 16 bits . típicamente la PGN contener un grupo de parámetros . Aunque a veces un mensaje contendrá un solo parámetro ( por ejemplo. cómo se fragmenta y se vuelven a montar los mensajes grandes . como los tiempos de espera de mensajes. Por ejemplo . La PGN sirve para identificar el mensaje y sus datos . y un desplazamiento de 0 . el tamaño . y cómo las aplicaciones adquieren direcciones de red. RPM del motor es uno de los siete parámetros .125 rpm / velocidad de bits . la velocidad de la red . que opera en una red de área de controlador (CAN ) bus . En un mensaje de ejemplo. Identifica el mensaje " Electronic Engine Controller 1 " . que ha sido aprobada por la agricultura (ISO 11789 ) y las industrias marinas ( NMEA2000 ) . la capa física . La norma pasa a definir muchos otros aspectos . Por la especificación . una resolución de 0. VIN ) .J1939 Introducción Este artículo tiene por objeto dar a los ingenieros una breve descripción del protocolo SAE J1939 . Hoy en día J1939 se utiliza como el bus de comunicaciones estándar para aplicaciones de diagnóstico y de control del vehículo comercial . RPM del motor ) entre unidades de control electrónico (ECU ) en un vehículo . Se define la prioridad de los datos . En la norma hay un total de 8672 PGN . J1939 Mensajes En el corazón de J1939 es el número del grupo de parámetros ( PGN ) . J1939 especifica RPM del motor para tener una prioridad por defecto de 3 . tomemos PGN 61444 . SAE J1939 es un sustituto de la red SAE J1587/J1708 que se ha utilizado para los vehículos comerciales medios y pesados durante los últimos 20 años. Debido a su popularidad y éxito. J1939 especifican exactamente cómo se intercambia la información ( por ejemplo. Protocolos competidoras de alto nivel se están ISO 15765 y CANopen . la escala y offset. que es un número único asignado a cada mensaje J1939 . J1939 Información general SAE J1939 es un protocolo de comunicaciones de alto nivel . . " EEC1 " tiene siete diferentes parámetros embebidos en el campo de datos del mensaje .

15 . Mensajes de longitud variable son mensajes con una longitud de 9 a 1785 bytes . Se utiliza un conector de tres clavijas y permite hasta 30 nodos . la longitud variable. J1939 capas físicas Actualmente hay dos 250 Kbps capas físicas definidas . J1939 de SAE J1939 RS232 Software CANopen SAE J1939 This article is intended to give engineers a brief overview of the SAE J1939 protocol.15 especifica un par trenzado sin blindaje de los cables con una longitud máxima de columna vertebral de 40 metros. . J1939. Sólo hay un mensaje que es de tres bytes de longitud . For details on the specification itself. J1939. J1939. La mayoría de los mensajes en J1939 son 8 bytes de longitud . Today SAE J1939 is used as the standard communications bus for commercial vehicle's diagnostic and control applications.11 especifica un par trenzado de cables con una longitud máxima de columna vertebral de 40 metros. SAE J1939 is a replacement for the SAE J1587/J1708 network which has been used for medium and heavy duty commercial vehicles for the past 20 years. it has been adopted by the agricultural (ISO 11789) and marine industries (NMEA2000). Estos mensajes son demasiado grandes para caber en una sola trama de datos CAN y deben ser fragmentados por el transmisor y volver a montar por el receptor. Esto permite un uso más eficiente del ancho de banda de la red mediante la maximización de la cantidad de datos en la red mediante la reducción del número de mensajes .21 . 8 bytes . Here is a printable version of this J1939 introduction and Bosch CAN specification.14 . en fase de desarrollo . que son: 3 bytes . Se utiliza un conector de dos pines y permite hasta 10 nodos.11 y J1939.J1939 Tamaños Mensaje J1939 tiene tres tamaños de los mensajes permitidos diferentes . y que es el mensaje de solicitud ( PGN 59904 ) . J1939. please visit the Society of Automotive Engineers. Este proceso es definido por el protocolo de transporte de J1939 que se especifica en J1939. con una capa de 500 Kbps . Due to its popularity and success.

672 PGNs. J1939 Message Sizes J1939 has three different allowed message sizes. For example. . For an example message. to have a size of 16-bits. There is only one message which is three bytes in length.g. including message timeouts.904). The PGN serves to identify the message and its data. and how applications acquire network addresses. and offset. typically the PGN will contain a group of parameters. and an offset of 0. a resolution of 0. which is a unique number assigned to every J1939 message.785 bytes. Altogether there are six subfields which are encoded into the 29-bit CAN identifier. how large messages are fragmented and reassembled. J1939 specifies engine RPM to have a default priority of 3. Per the specification. It identifies the "Electronic Engine Controller 1" message. "EEC1" has seven different parameters embedded in the data field of the message. J1939 Messages At the heart of J1939 is the Parameter Group Number (PGN). Variable length messages are messages with a length from 9 to 1. The transport protocol layer defines two different types of message fragmentation: BAM and CM. Protocol Specific. they are shown below and are: Priority. Extended Data Page. These messages are too large to fit in a single CAN data frame and must be fragmented by the transmitter and reassembled by the receiver.J1939 Overview SAE J1939 is a high level communications protocol. It defines the data's priority. while a CM is destination specific. take PGN 61. engine RPM) is exchanged between electronic control units (ECUs) on a vehicle. Engine RPM is one of those seven parameters. This allows for a more efficient use of the network bandwidth by maximizing the amount of data on the network by reducing the number of messages. the physical layer. and Source Address.444. and variable length. Data Page. the main difference being the destination address. J1939 Datalink SAE J1939 uses a simple datalink layer to communicate information. Protocol Format. scaling.g. refer to SAE J1939-21. In the standard there is a total of 8. The standard goes on to define many other aspects. There are several differences between those two types. only a single BAM can be transmitted simultaneously. VIN). SAE J1939 specifies exactly how information (e. and that is the request message (PGN 59. A BAM uses a global destination address and is therefore sent to all CAs. For details about this encoding. which operates on a Controller Area Network (CAN) bus. Due to the addressing scheme. This process is defined by J1939's transport protocol which is specified by J1939-21. size. and SA is the source address of the controller application. the network speed. 8 bytes. P 3 bits EDP 1 bit DP 1 bit PF 8 bits PS 8 bits SA 8 bits P is the priority of the message. while multiple CMs using different destination addresses may be simultaneously transmitted. EDP and DP make up 4 different pages with one page being reserved for ISO 15765-3.125 rpm/bit. PF and PS define the parameter group number and destination address. Although sometimes a message will contain a single parameter (e. they are: 3 bytes. The majority of messages in J1939 are 8 bytes in length.

Because of these tight tolerances.68 uF. It uses a three pin connector and allows for up to 30 nodes. J1939 allows only for a single SJW. in one spot with least electrical noise and close to the middle.998 us and a maximum period of 4. Terminating resistors have a minimum resistance of 110 ohms. J193914. and maximum of 130 ohms. the shield should be connected directly to ground. J1939-11 specifies a shielded twisted pair of wires with a maximum backbone length of 40 meters and maximum stub length of 1 meter. With a CM. SAE J1939-11 and J1939-15 both specify terminating resistors should not be contained inside of electronic control units. CAN peripherals often may not be driven by PLL (Phase Lock Loop) and FLL (Frequency Locked Loop) multipliers.Another difference between BAMs and CMs is the time is takes to send a messages. Nodes will connect to the shield via a resistor and capacitor in series. data packets must be spaced at least 50 ms apart and no more than 200 ms. can prevent high-speed operation. Clock jitter is variation from period to period in a clock signal. The SJW value dictates how much time can be added or subtracted to the node's CAN clock for syncronization purposes. J1939 Network Termination All SAE J1939 networks utilize. CAN specifics a tolerance of 1. For J1939. terminating resistors should be placed into cable plugs which serve to seal and cap the end of networks. J1939-15 specifies an unshielded twisted pair of wires with a maximum backbone length of 40 meters and maximum stub length of 3 meters. J1939 Clock Tolerance J1939. J1939 Physical Layers Currently there are two 250 Kbps physical layers defined.5%. The resistor should have a value of 1 ohm and the capacitor should have a value of 0.002 us. two resistors at each end of the backbone. typical of 120 ohms. which is based on a CAN bus. and require. These resistors are balanced with the impedance of the network cable and prevent electrical reflections. has a much tighter clock tolerance than what is stated in the CAN ISO 11898 documents. and without dampening. the sample point setting has a maximum value of 87. This also allows for backbones to be extended as needed. It uses a two pin connector and allows for up to 10 nodes. data frames may be sent as quickly as possible.58% while J1939-11 and J1939-15 specify a clock tolerance of 0. Nodes should be set as close as possible but not exceed 87.05%. J1939-11 and J1939-15. PLLs and FLLs. If resistors are placed inside of an ECU. with a 500 Kbps layer. J1939 Protocol Stack . CAN networks also allow and require for custom sample point settings. Due to this. Consult the microcontroller datasheet for PLL/FLL jitter amounts. Instead.5%. J1939 Shield Termination For networks with a shield. if that ECU is removed from the network then the network will fail to operate. With a BAM. CAN peripherals also allow for synchronous jump width (SJW) settings of 1 to 3. which are used to multiply frequencies introduce clock jitter. J1939 CAN Parameters SAE J1939-11 and -15 specify a network data rate of 250 Kbps with a minimum period of 3. Crystals have very low jitter as compared to PLL/FLL circuits. Reflections are much like audiable echos. under development. jitter can introduction errors into the CAN bus.

The NAME field is also essential to Network Management as it establishes node priority. An ECU may contain multiple CAs and NAME fields. In simple terms. will convert and reassemble received raw CAN frames and present complete and valid J1939 messages to the user's application.g. Industry Group. and SAE J1708. Manufacturer Code. and Identity Number. J1939 includes a method for dynamically assigning addresses.What is a J1939 protocol stack? A J1939 protocol stack is a software library that handles the appropriate layers of the OSI 7 layer model. which means there is no legal mandate for business to adhere to them. About the SAE SAE. In anticipation of future devices and functions. Their primary goal is to develop technical standards. Function. Vehicle System Instance. New devices must announce an address for themselves by transmitting an address claim message.Generator Sets and Industrial SAE J1939-81 Network Management SAE J1939-82 Compliance . J1939 specifies layer 1 (physical). for example: SAE J2497. layer 3 (network). If the address is already in use by a device with a higher priority (determined by the NAME). Nodes on the network use the NAME field to distinguish between each other. The SAE provides a venue for government and businesses to agree on technical standards for the worldwide vehicle mobility industry. and transmit raw CAN frames onto the J1939 network. automotive and commercial-vehicle industries. Society of Automotive Engineers. In general these standards are only recommended practices. the lowest numeric values have the highest priority when claiming addresses. J1939 Address Claiming In J1939 CAs. SAE J1587. OBD2 and SAE J1979).Truck and Bus . for inbound data. Reserved Bit. is an organization of engineers and technical experts in the aerospace. the higher priority device indicates the conflict by sending out a Address Claim message. For outbound data. The NAME field gives each CA a unique identity. ECU Instance. The NAME is 64 bits wide and is made up of the following fields: Arbitrary Address Capable. and layer 4 (transport). J1939 NAME Field Every ECU. 250 Kbps SAE J1939-21 Data Link Layer SAE J1939-31 Network Layer SAE J1939-71 Vehicle Application Layer SAE J1939-73 Vehicle Diagnostic Layer SAE J1939-74 Application . SAE J1939. Function instance. layer 2 (data link). or electronic control units. or CA (controller application) on a J1939 network has a unique NAME. All devices on the network compare this newly claimed address with their internal address tables. a J1939 protocol stack. The lower priority device immediately stops using the address and must claim a new one. Vehicle System. J1939 Specifications              SAE J1939 Parent Document SAE J1939-11 Physical Layer.Configurable Messaging SAE J1939-75 Application Layer . The NAME translates to a number. a J1939 protocol stack will accept complete messages from the user's application then convert. however. Sending an Address Claim message the new (non-addressed) device sends out an Address Claim PGN indicating the address it is assuming. SAE J1850. on the vehicle network bus must claim a unique source address to enable communication. and layer 7 (application). Addresses 0 to 128 are pre-assigned and CAs which use these addresses are allowed to communicate immediately after power up. fragment. However sometimes goverments madate adoption (e. 500 Kbps SAE J1939-15 Reduced Physical Layer. 250 Kbps SAE J1939-13 Off-Board Diagnostic Connector SAE J1939-14 Physical Layer.

Transport Protocol) J1939 messages. for HCS12 CPU) There are two J1939 software packages available: J1939-Full and J1939-Light.e. SPN DA PDU2 DTC CA BAM J1939 CPU Cycles per Msg (apprx. for HCS12 CPU) J1939 Code Size Comparison (apprx. SAE J1939 Protocol Stack Details:  J1939 compliant . please see our J1939 Protocol Stack FAQ for possible answers. to meet the demanding needs of the high speed Controller Area Network (CAN). SAE J1939 Protocol Description J1939 Protocol Dictionary PGN SA PDU1 NAME Our SAE J1939 protocol stack was designed by Simma Software. J1939-Full handles reception and transmission of standard single frame and multi-frame (i. the J1939-Full software package handles address claim arbitration specified by the network management layer. If you have questions about our J1939 software. J1939-Light is identical to J1939-Full without support for the J1939 transport protocol which is used for multiframe messages. a nationally recognized J1939 expert. Also. Benchmarks have shown the stack to be 800% more efficient than other commercially available J1939 software solutions. The software protocol stack is well documented and has been used in more than a quarter of a milliion embedded systems. The J1939 source code uses a high performance modular design and has a simple API.

we are providing the below performance analysis metrics. They were measured with a 100% utilized 250 Kbps SAE J1939 network. Below is the list of available ports. 16. It is the CAN device driver. All builds were compiled with full optimizations enabled and code execution from internal flash memory.               Linux Windows XP/7/Embedded Texas Instruments RM4x (DCAN) Texas Instruments LM3Sx Texas Instruments TMS470x Texas Instruments TMS470Mx Texas Instruments TMS570x Texas Instruments Tiva TM4C Texas Instruments F28M35xx Texas Instruments TMS320F280x Texas Instruments TMS320F281x Texas Instruments TMS320F282x Texas Instruments TMS320F283x Texas Instruments AM3x . that is target specific and incorporates the details for a given microcontroller.     MISRA C compliant ANSI C source code Use with or without an RTOS Use with 8. ssCAN. SAE J1939 Ports Our real-time SAE J1939 protocol stack is completely platform independent and written in the ANSI C programming language. or 64-bit CPU Complete user’s reference manual SAE J1939 Software Benchmarks Simma Software provides high-performance deterministic real-time software for the embedded systems industry. 32. These J1939 software benchmarks are for the combined packages of ssJ1939-Full and ssCAN. CAN identifiers were randomized and acceptance masks disabled. For reference and comparitive purposes for our customers. Our ssCAN device driver has been ported to over 40 different microcontrollers. Please contact us if you are interested in a port or device driver for a hardware platform that is not listed.Sitara . Together ssJ1939 and ssCAN form a complete ported system allowing customers to be up and running almost immediately.

DaVinci Atmel SAM7 Atmel AT90 Freescale HCS08 Freescale HCS12 Freescale HCS12X Freescale MC68xxx Freescale MCF5xxx Freescale MPC5xxx Freescale Kinetis Kxx Infineon C16x Infineon TriCore Intel 82527 Microchip PIC18 Microchip PIC24 Microchip PIC32 Microchip dsPIC30 Microchip dsPIC33 Microchip MCP2515 NXP LPC11xx NXP LPC17xx NXP LPC21xx NXP LPC23xx NXP SJA1000 Silicon Labs C8051 STMicro ST7 STMicro ST10 STMicro STR7 STMicro STM8 STMicro STM32F1x STMicro STM32F2x STMicro STM32F3x STMicro STM32F4x Xilinx LogiCORE AXI (axi_can) .                                  Texas Instruments DM8x .