j1939 Overview by Kvaser
j1939 Overview by Kvaser
j1939 Overview by Kvaser
|1|
www.kvaser.com
J1939 OVERVIEW
Table of Contents
J1939: Introduction................................................................................................................................2
Introduction....................................................................................................................................................................... 2
Quick facts........................................................................................................................................................................ 2
The SAE J1939 standards........................................................................................................................................... 2
J1939: In Depth.......................................................................................................................................4
Message Format and Usage (J1939/21)............................................................................................................... 4
Addresses and Names (J1939/81)........................................................................................................................... 5
Address Claim.................................................................................................................................................................. 7
Transmitting Messages (J1939/21 and J1939/7x)........................................................................................... 8
TP_BAM messages........................................................................................................................................................ 9
TP_CM messages........................................................................................................................................................... 9
Receiving Messages (J1939/21 and J1939/7x).................................................................................................. 9
ECU Design (J1939/1x, J1939/21, and J1939/7x)............................................................................................. 9
Wiring Topology Physical Layer (J1939/1x)...................................................................................................10
Example of how to interpret a J1939 message...............................................................................................10
Next Steps.............................................................................................................................................12
Get the Complete J1939 Specification Documents........................................................................................12
Compare J1939 Compatible Software Suites...................................................................................................12
Order a J1939 Diagnostic Cable............................................................................................................................12
APPENDIX A...........................................................................................................................................13
J1939/11 Physical Layer............................................................................................................................................13
J1939/13 Off-Board Diagnostic Connector.......................................................................................................13
J1939/21 Data Link Layer........................................................................................................................................13
J1939/31 Network Layer...........................................................................................................................................14
J1939/71 Vehicle Application Layer......................................................................................................................15
J1939/73 Application Layer Diagnostics........................................................................................................15
J1939/81 Network Management...........................................................................................................................16
|1|
www.kvaser.com
J1939 OVERVIEW
J1939: Introduction
Introduction
J1939 is a set of standards defined bythe Society of Automotive Engineers (SAE). J1939
standards are used to design electrical systems on heavy-duty vehiclessuch as trucks, buses, and
mobile hydraulics.
The J1939 specification provides direction for the physical layer, diagnostic connector, and several
layers of messaging architecture. In many ways, J1939 is similar to the older J1708 and J1587
standards, but J1939 is built on CAN (Controller Area Network, ISO 11898).
Perhaps most importantly for the heavy duty vehicle industry, J1939 prescribes a standard set of
message parameter groups - referred to as PGNs - for communication on the electrical bus. A
set of custom message parameters are also reserved for proprietary third party usage. This
provides two benefits at once: 1) a standardized system for faster setup, and 2) the ability to
customize to ones own needs.
Quick facts
Higher-layer protocol built on CAN
Used in heavy-duty vehicles
The speed is nearly always 250 kbit/s
Peer-to-peer and broadcast communication
Used for network management
Includes definition of parameter groups for commercial vehicles and others
Supports manufacturer specific parameter groups
|2|
www.kvaser.com
J1939 OVERVIEW
|3|
www.kvaser.com
J1939 OVERVIEW
J1939: In Depth
Message Format and Usage (J1939/21)
Most messages defined by the J1939 standard are intended to be broadcast. This means that the
data is transmitted on the network without a specific destination. This permits any device to use
the data without requiring additional request messages. This also allows future software revisions
to easily accommodate new devices (address assignments). When a message must be directed to
a particular device, a specific destination address can be included within the message identifier.
For example, a request for a specific torque value from the engine instead of a specific torque
value from the brake controller.
J1939 uses the 29-bit identifier defined within the CAN 2.0B protocol shown in Figure 1. The
identifier is used slightly different in a message with a destination address (PDU 1) compared to
a message intended for broadcast (PDU 2).
PDU stands for Protocol Data Unit (i.e. Message Format).
The SOF, SRR, and IDE bits are defined by the CAN standard and will be ignored here. The RTR bit
(remote request bit) is always set to zero in J1939.
The 29-bit identifier used in J1939 is structured in the following way.
Priority
Reserved
Data page
PDU format
PDU specific
Source Address
3 bits
1 bit
1 bit
8 bits
8 bits
8 bits
The first three bits of the identifier are used for controlling a messages priority during the
arbitration process. A value of 0 has the highest priority. Higher priority values are typically given
to high-speed control messages, for example, the torque control message from the transmission
to the engine. Messages containing data that is not time critical, like the vehicle road speed, are
given lower priority values.
The next bit of the identifier is reserved for future use and should be set to 0 for transmitted
messages.
The next bit in the identifier is the data page selector. This bit expands the number of possible
Parameter Groups that can be represented by the identifier.
The PDU format (PF) determines whether the message can be transmitted with a destination
address or if the message is always transmitted as a broadcast message.
|4|
www.kvaser.com
J1939 OVERVIEW
The interpretation of the PDU specific (PS) field changes based on the PF value:
If the PF is between 0 and 239, the message is addressable (PDU1) and the PS field contains
the destination address.
If the PF is between 240 and 255, the message can only be broadcast (PDU2) and the PS
field contains a Group Extension.
The Group extension expands the number of possible broadcast Parameter Groups that can be
represented by the identifier.
The term Parameter Group Number (PGN) is used to refer to the value of the Reserve bit, DP, PF,
and PS fields combined into a single 18 bit value.
Example: The ID 0xCF004EE can be divided into the following fields in table 2.
000
0x0C
011
Prio
0
R
0
DP
0xF0
11110000
PF
004
00000100
PS
0xEE
11101110
SA
|5|
Contents/Meaning
Identity number, LSB
Identity number
Bits 0-4: Identity number, MSB
Bits 5-7: Manufacturer code, LSB
www.kvaser.com
J1939 OVERVIEW
3
4
5
6
|6|
www.kvaser.com
J1939 OVERVIEW
devices of the same type can coexist on the network due the address limit. Address 255 is
reserved as a global address for broadcast and address 254 is reserved as the null address used
by devices that have not yet claimed an address or failed to claim an address.
Address Claim
In general, most addresses are pre-assigned and used immediately upon power up. In order to
permit J1939 to accommodate future devices and functions which have not yet been defined, a
procedure has been specified for dynamically assigning addresses. Each device must announce
which address it is associated with. This is the identification (address claim) feature. Two options
are available:
1. Send an Address Claim message to claim an address.
When a device sends an Address Claim message to claim an address, all devices compare this
newly claimed address to their own table of devices on the network. If the address is already
claimed by a device with a higher priority, that device transmits an Address Claim message
indicating that the address is already in use. The Name, which is sent as data in the Address Claim
message, determines which device has higher priority.
2. Send a Request for Address Claim.
When a device sends a Request for Address Claim, all devices respond by transmitting their
Address Claimed messages. This permits transitional devices (tools, trailers, etc.) or devices
powering up late to obtain the current address table so that an available address can be selected
and claimed. See figure 2.
Dynamic address assignment support is optional and only those devices which might be expected
to encounter address conflicts must support this capability. To eliminate the need to support
dynamic address assignment and speed up this identity process, most ECUs are associated
with a preferred address. These preferred addresses are described in the document J1939/71. If
the preferred address is already in use by another ECU, the device can attempt to claim another
address if self-configuration is supported by the device.
|7|
www.kvaser.com
J1939 OVERVIEW
|8|
www.kvaser.com
J1939 OVERVIEW
TP_BAM messages
TP_BAM messages use a global destination address which means that all devices on the network
will receive these messages. The transmission is started with a Connection Management (CM)
message, PGN = 0x00EC00, with a Control byte indicating TP_BAM. The message data follows in
Data Transfer (DT) messages, PGN = 0x00EB00.
TP_CM messages
TP_CM messages are sent point to point between two devices. The transmission starts with a CM
message with a Control byte indicating Request To Send (RTS). The receiving device responds with
a CM message with the Control byte indicating Clear To Send (CTS). The transmitting device then
sends the portion of the data indicated in the CTS using DT messages. This handshake of CTS
then DT messages continues until the entire message is transmitted. The connection is terminated
at the completion of the message by the receiver transmitting a CM message with a Control byte
indicating End Of Message Acknowledgement (EOM). Note that for this process to work, the CM
message contains additional data based on what the control byte is. The RTS includes: number
of bytes, number of packets and the PGN whose data will be transported. The CTS includes the
number of packets the receiver expects next and the packet number to start with.
www.kvaser.com
J1939 OVERVIEW
0xCF00401
Data Bytes:
0xFF FF 82 DF 1A FF FF FF
First two bytes = 0x0C = 00001100 in binary format. The first 3 bits arent used since the
identifier only consists of 29 bits. The following 3 bits represents the message priority which
in this case is 3. Thereafter follows a reserved bit and then the data page which are used to
determine the complete PGN.
|10|
www.kvaser.com
J1939 OVERVIEW
The last byte of the CAN-ID is the Source Address (address of the sending device) which in this
case is 1.
The PGN = 0x0F004 which corresponds to the Electric Engine Controller #1 (EEC1) according to
the J1939/71 document. This document also describes the parameters and their position within
the data bytes. The data field consists of the following bytes in this example:
Data bytes
FF
FF
82
DF
1A
FF
FF
FF
Position
Data bytes 1, 2, 6, 7 and 8 in this example are not available and are therefore set to 0xFF. No raw
parameter value (single byte) could have the value 0xFF.
Data byte 3 is the parameter Actual engine percent torque. The raw value 082 is 130 decimal.
According to the J1939/71 document the scaling 1% per bit and the offset is -125. Therefore, the
actual value for this parameter is 5%.
Data bytes 4 and 5 form the parameter Engine speed. The first byte (4) is the least significant
(Intel byte order). The raw value 0x1ADF = 6879 decimal. The scaling is 0.125 rpm per bit and the
offset is 0. The actual value for this parameter is therefore just under 859.875 rpm.
_______________________________________________________________
|11|
www.kvaser.com
J1939 OVERVIEW
Next Steps
This document introduces you to the J1939 standard with a brief overview, a guide to the SAE
specification, and an in depth you look at the message architecture. Hopefully this has helped you
get a picture of the world of J1939.
You may have downloaded this document for a variety of reasons. Perhaps you are designing
a system or ECU, or troubleshooting vehicles, or conducting academic research. In all of these
situations, there are a few simple next steps that will help you move forward with J1939.
|12|
www.kvaser.com
J1939 OVERVIEW
APPENDIX A
J1939/11 Physical Layer
The physical properties of the bus:
Shielded twisted pair wire.
Max 40 meter.
250 kbit/s.
Max 30 nodes (ECUs).
Based on ISO11898.
www.kvaser.com
J1939 OVERVIEW
The transport protocol provides functions for transmitting messages longer than 8 bytes since
they will not fit in a single CAN frame. In J1939, these messages are segmented into 7 byte
packets with a sequence number for each packet. There are special Connection Management (CM)
messages for handling the communication of segmented messages. Examples of these messages
are: Request to Send (RTS), Clear to Send (CTS) and Broadcast Announce Message (BAM). The
segmented messages can be sent to a specific device or as broadcast. CM messages provide
a virtual connection and a handshake procedure between the sender and receiver. The sender
requests to send a segmented message and the receiver answers with how many segments it can
receive for the moment (figure 4). Segmented messages can be sent as broadcast as well with no
handshaking between sender and receiver(s).
|14|
www.kvaser.com
J1939 OVERVIEW
|15|
www.kvaser.com
J1939 OVERVIEW
|16|
www.kvaser.com