Relationship Between CAN and J1939

Thread Starter

Kittu20

Joined Oct 12, 2022
511
I'm looking clarification on the distinction between CAN and J1939 protocols. While I've gathered that CAN is a protocol and J1939 is a standard, I have gone through documents of J1939 but I'm unsure about the practical usage of J1939. It seems to be utilized in trucks and vehicles, but I'd appreciate insights into how it's specifically implemented in these contexts

@Papabravo
 

Papabravo

Joined Feb 24, 2006
22,058
J1939 sits on top of CAN and uses the 29-bit identifier exclusively. It further defines the use of the identifier space. There are other CAN implementations that use the 11-bit identifier exclusively. I am not aware of any hybrid implementations that mix 11-bit and 29-bit identifiers.
 

Papabravo

Joined Feb 24, 2006
22,058
https://www.kvaser.com/about-can/higher-layer-protocols/j1939-introduction/#:~:text=J1939 is a set of,J1939 is built on CAN.


I am seeing in link that the data frame of J1939 differs from the data frame of CAN , so is J1939 a different protocol or it's the CAN protocol?
In the general case, a CAN data frame can have any length in the range of 0 to 8, regardless of the length of the identifier field. Are you telling me that J1939 allows something different? I do not think that is possible.
 

Thread Starter

Kittu20

Joined Oct 12, 2022
511
I've read several web articles, but I'm still not understanding the complete frame format for J1939. I haven't found any resources explaining complete frame including the start frame and end frame
 

nsaspook

Joined Aug 27, 2009
16,249
I've read several web articles, but I'm still not understanding the complete frame format for J1939. I haven't found any resources explaining complete frame including the start frame and end frame
It's very easy to sniff the bus with a cheap logic analyzer to see what's happening.
https://forum.allaboutcircuits.com/threads/logic-probe-for-can-bus.192771/post-1844883
Generic canbus frame decoding.
1692913371225.png

https://embeddeduse.com/2020/01/17/introduction-to-the-sae-j1939-standard/
In the early days of controller area networks (CAN), every device manufacturer interpreted CAN frames in its own proprietary way. When you changed the engine of a harvester from Volvo to MAN, you would have to reimplement the communication with the engine from scratch. Fendt tractors wouldn’t be able to communicate with John Deere implements and vice versa. The J1939 standard brought order into this Babylonian chaos and reduced the development efforts significantly.
 

geekoftheweek

Joined Oct 6, 2013
1,429
I've read several web articles, but I'm still not understanding the complete frame format for J1939. I haven't found any resources explaining complete frame including the start frame and end frame
You are going to have a hard time finding free information online other than what you have already found. Pretty much everything J1939 related is available from the SAE web site for a price...
 

geekoftheweek

Joined Oct 6, 2013
1,429
Even with the standard there are multiple messages that can be used to convey the same information depending on what information you want to send. It's been too long ago to remember the exact details of my experimentation, but there were some pretty significant differences in the messages when comparing Cummins and Detroit Diesel engines. When extracting the data from the PGNs the format was the same bit wise and multipliers, but the arrangement of the bits in the PGNs themselves were different along with the definiton of the rest of the bits of the PGN.

It does make life easier in the sense there is a standard to follow, but you still have to account for how the manufacturer actually implements the standard to some degree.
 

Papabravo

Joined Feb 24, 2006
22,058
I've read several web articles, but I'm still not understanding the complete frame format for J1939. I haven't found any resources explaining complete frame including the start frame and end frame
Those things are very well defined in the original CAN specification written by Bosch. You are apparently unable to read and understand what is written in black and white in front of your eyes.

For some context. When any CAN bus is idle, the bus lines are in the recessive state. In voltage terms they are held at approximately the same level by the termination resistance, and that level is determined by the transceivers on the bus at approximately Vcc divided by 2. If you are using 5V transceivers that would be approximately 2.5 Volts DC.

The SOF, Start of Frame, consists of a single Recessive to Dominant. A dominant state on the bus is where CAN_H goes High and CAN_L goes low. For 5V transceivers these levels will be approximately +5V and GND. This is followed by the identifier field of either 11 or 29 bits. You know that for J1939 it MUST be 29 bits. Similarly, you know that for DeviceNet it must be 11 bits. This will of course be confirmed by the IDE bit which follows the first 11 bits of the identifier field.

The EOF, End of Frame is a sequence of 7 recessive bits. This is followed by the REQUIRED IFS or Interframe space.

can20.pdf (ucr.edu)

Part A - Page 11
1711216706314.png

Part A - Page 14

1711216802995.png
 
Last edited:

Thread Starter

Kittu20

Joined Oct 12, 2022
511
Those things are very well defined in the CAN specification. You are apparently unable to read and understand what is written in black and white in front of your eyes.
I've gathered from CAN specification that A CAN frame includes

  • Start of Frame (SOF)
  • Arbitration Field
  • Control Field
  • Data Field
  • CRC Field
  • Acknowledgment Field
  • End of Frame (EOF)
 

Papabravo

Joined Feb 24, 2006
22,058
I've gathered from CAN specification that A CAN frame includes

  • Start of Frame (SOF)
  • Arbitration Field
  • Control Field
  • Data Field
  • CRC Field
  • Acknowledgment Field
  • End of Frame (EOF)
But do you have the specification from BOSCH that defines the length and content of the fields? I've added a link in my post.
 

Papabravo

Joined Feb 24, 2006
22,058
Thank you, I have a PDF file of CAN specifications. I think that what I was trying to understand is shown in the diagram provided at the link below

https://www.influxbigdata.in/j1939
View attachment 318226
Notice that in the J1939 or Extended Frame format, the 29-bit identifier is divided into 2 parts so the diagram you referenced has a critical mistake. The SRR and IDE bits divide the 29-bit identifier field into an 11-bit part and an 18-bit part. Note also that the control field now has two reserved bits r0 and r1. The total length of the arbitration field is 32 bits.
1711223155581.png
 
Top