Handout Sae j1939 Fundamentals
Handout Sae j1939 Fundamentals
3
Standards Development –
The Reason and the Process
SAE is the primary
Standards organization in
the US, for Automotive/
Heavy Duty (HD)
6
Standards Development,
the Process (cont)
Within Communications
Network Committee are Task
Forces (TFs)
TFs develop standards, some
own Documents, some don’t
Documents are Written,
Reviewed, Approved, and
Published
This uses a formal process
with many rules, and is
VERY SLOW
7
Different parts of J1939 –
The Communications “Stack”
CAN Protocol Stack (my way)
T
Sensor Sends and receives 1’s and 0’s
Physical Layer J1939-11, -13, -14, -15, -17
Fuel
Pump Defines the CAN Frame
Display
Datalink Layer J1939-21, -22
ECU
T
Packages larger blocks of data
Transport Layer J1939-21, -22
www.SAE.org
Physical Layer Standards: Price at SAE.org
• SAE J1939-11 Physical Layer, 250 Kbps, Twisted Shielded Pair $85
• SAE J1939-13 Off-Board Diagnostics Connector $85
• SAE J1939-14 Physical Layer, 500 Kbps $85
• SAE J1939-17 CAN FD Physical Layer, 500 Kbps/2 Mbps $85
10
OBD Overview
On-Board Data
J1939 J1939 J1939 J1939 J1939 J1939 J1939 J1939 CCR J1939
Information Needed J1939 -03 -11 -21 -31 -71 -73 -81 -84 1971.1 DA
Latest Draft Aug 2013 Feb-2014 Aug-2012 Jan-2014 Jan-2014 Jan-2014 Jan-2016 June-2011 Jan-2016 Sep-13 Nov-13
11
The Physical Network, 250k
Twisted Shieled Pair; J1939-11
The Physical Layer
0 09F2000A X 8 00 00 00 00 00 7F FF FF 813.449670 R
0 09F11208 X 8 FF 8D 84 FF 7F FF 7F FD 813.450230 R
0 09F80100 X 8 8B 9F 26 1D A6 1E F2 B6 813.452150 R
0 09F80200 X 8 D0 FC 44 8B 02 00 FF FF 813.455160 R
0 000E0000 X 8 8E B0 78 42 04 00 00 00 813.456810 R
0 000E0000 X 8 23 82 9A 42 05 00 00 00 813.466810 R
0 09F11308 X 8 FF 25 94 FF FF FF FF FF 813.474700 R
0 000E0000 X 8 E7 0F B8 42 06 00 00 00 813.476790 R
0 000E0000 X 8 B5 E3 D4 42 07 00 00 00 813.486790 R
0 000E0000 X 8 6C E0 F0 42 08 00 00 00 813.496800 R
15
Taking the Message Apart
Example 1
A direct cut from a J1939-84 log file created by
the test tool: What does this tell us?
16
Apply what we know from CAN Basics:
Phase J1939 Identifier J1939 Data
4
Number of Bits 1 3 2+16 8 0 to 64 15
Reference SOURCE
Name SOF PRIO PGN ADDRESS DLC DATA (0 to 8 Bytes) CRC
18 EA 00 F9 00 C1 00
18 is a priority of 6
EA 00 is PGN 59904, RQST, see J1939-21
SA is Source Address, F9 = 249, this is a Service Tool, see J1939DA
17 Data is 00 C1 00, or PGN 49408, also known as DM21, see J1939-73
The PGN (Parameter Group Number) and the PG
PGNs are Identifying Numbers for “Groups” of data being requested or transmitted
PGN refers to the identifying Number; PG refers to the Group of Parameters
PGNs follow a specific format defined in SAE J1939-21
Look at J1939-21, Page 8, to see the 29 bit header as used in J1939
J1939-21 Page 14 talks about the PF and PS fields (PDU Format and PDU Specific)
PF PS = EA 00 ; PF = 234 so PS = Destination Address = 00, the Engine ECU!
(Protocol Data Unit)
(00 to EF)
(F0 to FF)
18
The PGN and the PG (cont)
(00 to EF)
(F0 to FF)
• PDU1 Format: If the first byte of the PGN is 0 to 239 (0x00-0xEF), the second byte is
the destination address, as in Example 1.
• PDU2 Format: If the first byte of the PGN is 240 to 255 (0xF0-0xFF), the second byte
is the group extension.
• This gives us 240 addressable PGNs, and 4096 non-addressable PGNs
(16x256=4096)
• In Example 1 the PGN is EA 00. 0xEA = 234, so we have a PDU1 message
addressed to Source Address 00, the engine ECU.
19
The Data Field and DBC File
The Data Field, how is the Data represented?
21
Where the DBC File fits in!
Raw CAN data is delivered to
T GPS
CAN Controller the computer or Embedded
Processor.
Compass USB or
other
Display
Computer or Embedded Processor
RAI
Application or DBC File
T Embedded Program Information
24
Taking the Message Apart
Example 2
A frame from a J1939 trace off a Peterbilt truck.
We will analyze one Signal (SP) within one Message (PG).
25
You’ve got the Data, and you’ve got the PGN
Go to the J1939DA and look up the PGN
PGN is 0xF004 is 61444 and the DA tells us it’s Electronic Engine Cnt 1, EEC1.
We’re going to look at Engine Speed, or SPN 190. The Digital Annex (DA) tells us.
The format of the SPN is defined in the Slot, in this case SLOT 76, again in the DA.
Data Segment
D1 D2 D3 D4 D5 D6 D7 D8
6 0 7 d 8 4 5 0 1 4 0 0 F 0 8 4
26
A Cut from the J1939.DBC File for PGN 61444
27
Isolating the SPN, applying the SLOT
Data Segment
D1 D2 D3 D4 D5 D6 D7 D8
6 0 7 d 8 4 5 0 1 4 0 0 F 0 8 4
28
CAN Frames and Transport
Protocol; J1939-21
Transport Protocol
Example is of VIN.PGN 65260 (0xFEEC)
Assumes VIN is 17 bytes long and is simply 1 through 17
VIN ends with an asterisk ‘*’
Notice the Desired PGN Identifier is buried within the Data Payload
PGN 60416 is Connection Management and is all Overhead
PGN 60160 is Data Transfer and contains the actual Data Payload
30
Transport Protocol is Needed
if a PG is over 8 bytes
31
Transport Protocol Messages
Defined in J1939-21
33
CARB and CCR 1971.1
Origin and Reason for SAE J1939
Diagnostic Messages
The SAE J1939 Diagnostic Message (DM):
37
Background for DMs and DTCs
What is a Diagnostic?
• A Diagnostic is the code that performs a specific test.
• ECUs test for hundreds of failure conditions within an engine.
• Each test requires specific conditions to be able to run.
• When those conditions are met, a Diagnostic will run and perform the test.
What is an FMI?
• A Failure Mode Indicator is used to describe a failure condition related to an SPN.
• FMI = 1 – Data Valid But Below Normal Operational Range – Most Severe Level
• FMI = 2 – Data Erratic, Intermittent or Incorrect
• Thirty-one FMIs are thoroughly documented in J1939-71
Occurrence Count – A count of a specific fault, how may times was a fault condition met.
38
Diagnostic Messages (DM) ; SAE J1939-73
39
Understanding a DM1 in J1939-73
Example 3
• DM1 – Active Diagnostic Trouble Codes
948488000 12 18 FE CA 00 43 FF 66 00 02 01 FF FF (DM1)
40
Understanding a DM1 in J1939-73 (cont)
SPN = x66 = 102, FMI = 2, SPN Conversion Method =0, Occurrence Count = 1
41
Understanding a DM1 in J1939-73 (cont)
18 FE CA 00 43 FF 66 00 02 01 FF FF (DM1)
EXAMPLE 1: The following illustrates the message format for when there is more than one
diagnostic trouble code.
Given:
a=lamp status Two Bytes 43FF
b=SPN
c=FMI b, c, and d occupy four bytes, but they’re not on byte boundaries!
d=CM and OC
Message form will be as follows: a,b,c,d,b,c,d,b,c,d,b,c,d....etc. In this example, the transport protocol of
SAE J1939-21 will have to be used to send the information because it requires more than 8 data bytes.
Actually, any time there is more than one fault the services of the transport protocol will have to be used.
42
What helped me understand J1939?
43
Where to get more:
44
Website www.kvaser.com
Regional Offices https://www.kvaser.com/contact-us/
Resources www.kvaser.com/j1939webinar/
1C FD B7 00 70 66 00 02 01 00 00 00 7D 00 00 FE FF C9 22 CE 0A 00 00 00 00 00 00 00 04 FA
00 00 7D 00..............
DM24 defines this data – This is data related to each SPN, of the data length, all defined in
DM24. SPN 102 set a DTC, so Freeze Frame Data is captured in DM25 for each SPN defines as
supporting FF data by DM24.
This pattern will repeat itself in DM25 if multiple DTCs are set:
48
DM20 – Monitor Performance Ratio
Diagnostics run when specific conditions are met that enable that
diagnostic to detect a specific malfunction.
When the conditions are met that enable a Diagnostic to run, a counter is
incremented.
49
DM20 – Monitor Performance Ratio (cont)
50
DM20 – Monitor Performance Ratio (cont)
1C C2 00 00 BD 00 54 00 CA 14 F8 01 00 0C 00 B8 12 F8 00 00 54 00 C6 14 F8 00
a, x00BD = 189 Engine Ignition Cycle Counter
b, x0054 = OBD Monitoring Conditions Encountered
c, x14CA = SPN 5322 Aftertreatment NMHC Converting Catalyst System Monitor
d, x01F8 = 504 Numerator
e, x0C00 = 3072 Denominator IUMPR for SPN 5322 = 504/3072 = 0.164
Parameter Group Number: 49664 (00C20016)
Bytes 1-2 Engine Ignition Cycle Counter See 5.7.20.1
Bytes 3-4 OBD Monitoring Conditions Encountered Counts See 5.7.20.2
Bytes 5-7 SPN of Applicable System Monitor See 5.7.20.3
Bytes 8-9 Applicable System Monitor Numerator See 5.7.20.4
Bytes 10-11 Applicable System Monitor Denominator See 5.7.20.5
Definitions:
a=Engine Ignition Cycle Counter
b=OBD Monitoring Conditions Encountered Counts
c=SPN which defines the monitor ratio being reported
d=Monitor Ratio Numerator
e=Monitor Ratio Denominator
Message format shall be as follows: a,b,c,d,e,c,d,e,c,d,e,c,d,e,c,d,e,....etc. J1939-73
51
DM7/DM30 Command Non-Continuously
Monitored Test, and Scaled Test Results
xF7 = 247 is the Test Identifier; Return all scaled test results for one SPN
x0 0A 46 is SPN 2630; Engine Charge Air Cooler 1 Outlet Temperature
x1F is FMI 31; Condition Exist
52
DM7/DM30 Command Non-Continuously
Monitored Test, and Scaled Test Results (cont)
0680.381 000 16 1C A4 00 00 F7 46 0A 0C 20 00 00 FB FF
FF FF FF (DM30)
What is the Test Identifier?
What is the SPN?
What is the FMI?
What is the SLOT, Test Value, Max and Min?
53
Q&A