CAN Frame Decoder (J1939, CANopen)
Decode candump lines, ID DLC data hex or raw bits: standard/extended ID, DLC, data, bit stuffing and CRC15, plus J1939 PGN/addresses and CANopen COB-ID/SDO.
DLC and data length
| DLC | Classic CAN | CAN FD |
|---|---|---|
| 0 | 0 | 0 |
| 1 | 1 | 1 |
| 2 | 2 | 2 |
| 3 | 3 | 3 |
| 4 | 4 | 4 |
| 5 | 5 | 5 |
| 6 | 6 | 6 |
| 7 | 7 | 7 |
| 8 | 8 | 8 |
| 9 | 8 | 12 |
| 10 | 8 | 16 |
| 11 | 8 | 20 |
| 12 | 8 | 24 |
| 13 | 8 | 32 |
| 14 | 8 | 48 |
| 15 | 8 | 64 |
In classic CAN, DLC 9–15 still means 8 data bytes. In CAN FD, 9 and above mean 12, 16, 20, 24, 32, 48 and 64 bytes. This decoder shows CAN FD by length only; raw bit streams are decoded for classic CAN only.
Raw bit streams — bit stuffing and CRC15
- From SOF to the end of the CRC sequence, after five equal bits the transmitter inserts one bit of the opposite value (a stuff bit). The decoder removes them before splitting the fields and lists where they were. Six equal bits is a stuff error.
- CRC15 is computed over SOF, arbitration, control and data fields (stuff bits removed) with polynomial 0x4599 (x¹⁵+x¹⁴+x¹⁰+x⁸+x⁷+x⁴+x³+1), initial value 0, and compared with the received CRC.
- If present, the CRC delimiter (1), ACK slot (0 if anyone received it), ACK delimiter (1) and EOF (seven 1s) are shown too. When copying from a logic analyser, write bus levels (dominant = 0).
J1939 — splitting the 29-bit ID
- 29 bits = priority 3 · EDP 1 · DP 1 · PF (PDU format) 8 · PS (PDU specific) 8 · SA (source address) 8.
- If PF is below 240 (0xF0) it is PDU1: PS is the destination address (DA) and the low 8 bits of the PGN are 0. Example: 0x18EA00F9 → PGN 59904 (0xEA00, Request), DA 0x00, SA 0xF9.
- If PF is 240 or more it is PDU2: PS is the group extension and part of the PGN; the message goes to everyone (255). Example: 0x18FEF100 → priority 6, PGN 65265 (0xFEF1, CCVS1), SA 0x00.
- PGN = EDP, DP, PF and (for PDU2) PS. Values are little-endian; a top byte of 0xFE means error, 0xFF means not available.
PGNs this decoder names
| PGN | Hex | Acronym | Name |
|---|---|---|---|
| 59392 | 0xE800 | ACKM | Acknowledgment |
| 59904 | 0xEA00 | RQST | Request |
| 60160 | 0xEB00 | TP.DT | Transport Protocol — Data Transfer |
| 60416 | 0xEC00 | TP.CM | Transport Protocol — Connection Management |
| 60928 | 0xEE00 | AC | Address Claimed |
| 61184 | 0xEF00 | PropA | Proprietary A |
| 61441 | 0xF001 | EBC1 | Electronic Brake Controller 1 |
| 61442 | 0xF002 | ETC1 | Electronic Transmission Controller 1 |
| 61443 | 0xF003 | EEC2 | Electronic Engine Controller 2 (accelerator pedal) |
| 61444 | 0xF004 | EEC1 | Electronic Engine Controller 1 (engine speed, torque) |
| 61445 | 0xF005 | ETC2 | Electronic Transmission Controller 2 (gear) |
| 65217 | 0xFEC1 | VDHR | High Resolution Vehicle Distance |
| 65226 | 0xFECA | DM1 | Active Diagnostic Trouble Codes (DM1) |
| 65227 | 0xFECB | DM2 | Previously Active Diagnostic Trouble Codes (DM2) |
| 65228 | 0xFECC | DM3 | Diagnostic Data Clear (DM3) |
| 65242 | 0xFEDA | SOFT | Software Identification |
| 65248 | 0xFEE0 | VD | Vehicle Distance |
| 65253 | 0xFEE5 | HOURS | Engine Hours, Revolutions |
| 65254 | 0xFEE6 | TD | Time/Date |
| 65257 | 0xFEE9 | LFC | Fuel Consumption (Liquid) |
| 65259 | 0xFEEB | CI | Component Identification |
| 65260 | 0xFEEC | VI | Vehicle Identification |
| 65262 | 0xFEEE | ET1 | Engine Temperature 1 |
| 65263 | 0xFEEF | EFL/P1 | Engine Fluid Level/Pressure 1 |
| 65265 | 0xFEF1 | CCVS1 | Cruise Control/Vehicle Speed 1 |
| 65266 | 0xFEF2 | LFE1 | Fuel Economy (Liquid) |
| 65269 | 0xFEF5 | AMB | Ambient Conditions |
| 65270 | 0xFEF6 | IC1 | Intake/Exhaust Conditions 1 |
| 65271 | 0xFEF7 | VEP1 | Vehicle Electrical Power 1 |
| 65272 | 0xFEF8 | TRF1 | Transmission Fluids 1 |
| 65276 | 0xFEFC | DD | Dash Display |
SPNs decoded to values (only those with publicly checked scaling)
| SPN | PGN | Name | Byte | Scale | Offset |
|---|---|---|---|---|---|
| 513 | 61444 | Actual engine percent torque | 3 | 1 %/bit | -125 % |
| 190 | 61444 | Engine speed | 4–5 | 0.125 rpm/bit | 0 rpm |
| 91 | 61443 | Accelerator pedal position 1 | 2 | 0.4 %/bit | 0 % |
| 110 | 65262 | Engine coolant temperature | 1 | 1 °C/bit | -40 °C |
| 100 | 65263 | Engine oil pressure | 4 | 4 kPa/bit | 0 kPa |
| 247 | 65253 | Engine total hours of operation | 1–4 | 0.05 h/bit | 0 h |
CANopen — predefined COB-IDs (CiA 301)
| COB-ID | Function |
|---|---|
| 0x000 | NMT command (data: command, node ID — 0 = all) |
| 0x080 | SYNC |
| 0x081–0x0FF | EMCY (error code 2 bytes, error register 1001h, 5 manufacturer bytes) |
| 0x100 | TIME |
| 0x181– / 0x281– / 0x381– / 0x481– | TPDO1–4 (device → bus) |
| 0x201– / 0x301– / 0x401– / 0x501– | RPDO1–4 (bus → device) |
| 0x581–0x5FF | SDO response (server → client) |
| 0x601–0x67F | SDO request (client → server) |
| 0x701–0x77F | NMT error control: heartbeat, boot-up (00 boot-up, 04 stopped, 05 operational, 7F pre-operational) |
| 0x7E4, 0x7E5 | LSS (CiA 305) |
SDO command byte
- The top 3 bits are the command: request 1 = initiate download (write), 2 = initiate upload (read), 0 and 3 = segments, 4 = abort (0x80), 5 and 6 = block transfer.
- With expedited (e = 1) and size indicated (s = 1), n (bits 3–2) is the number of bytes without data: writes 0x2F, 0x2B, 0x27, 0x23 = 1, 2, 3, 4 bytes; read responses 0x4F, 0x4B, 0x47, 0x43 = 1, 2, 3, 4 bytes.
- Bytes 1–2 = index (little-endian), 3 = sub-index, 4–7 = data or abort code. A successful write is answered with 0x60; a read request is 0x40.
FAQ
Is a 3-digit candump ID standard and an 8-digit one extended?
Yes. can-utils prints standard IDs as 3 hex digits and extended IDs as 8. For the «ID DLC data» form you can force the length with the ID length field.
Is every extended ID J1939?
No. Other protocols use 29-bit IDs too (NMEA 2000 and ISOBUS build on J1939; others are vendor formats). The J1939 breakdown only holds if the bus is J1939.
An SPN shows as not available
That byte is 0xFF (not available) or 0xFE (error). The sending ECU may not support it, or there may be a sensor fault. For SPNs not listed, check the start byte and scale in J1939-71 or the vendor document.
Can I work out CAN bit rate and sample point here?
Bit timing is in the CAN Bit Timing Calculator.
For bit rate, sample point and TQ, use the CAN Bit Timing Calculator. For UART, SPI and I2C: UART Waveform Drawer · SPI Mode Helper · I2C Tools
Sources
- Bosch, CAN Specification Version 2.0 (1991) — Part A/B: frame fields, CRC, bit stuffing (NXP-hosted copy BCANPSV2.0)
- Greg Cook, «Catalogue of parametrised CRC algorithms» — CRC-15/CAN (poly 0x4599, check 0x059E)
- Linux can-utils — lib.c parse_canframe (candump/cansend notation)
- Murphy (Enovation Controls) PV100/PV101 «Implementation of SAE J1939 Parameters» 0710174 — PGN names (source: SAE J1939-71)
- Woodward easYgen-3000XT Series J1939 Protocol — SPN ranges (110, 513, 100, 91, 247, 190)
- TiePie engineering, SAE J1939 decoder — [61444.190] Engine_Speed, position 24, size 16, gain 0.125
- ISOBUS data dictionary (isobus.net) — PGN labels shared with J1939 (e.g. 59392 ACKM)
- Wikipedia, «CANopen» — predefined connection set, SDO protocol (summary of CiA 301)
- CAN in Automation (CiA), CiA 301 «CANopen application layer and communication profile»