CAN is based on a “broadcast” communication mechanism. This broadcast communication is based on a message-oriented transmission protocol. These messages are identified by Ids. A CAN ID has to be unique throughout the network and also indicates the priority of the message. Priorities are defined during system design and cannot be dynamically changed. The priority with the lowest binary value is the highest priority. Network access conflicts are resolved using bit logic in the IDs; Each dominant bit (LOW state) will overwrite recessive bits (HIGH state). Bus hosting competition is lost by all nodes with recessive transmission and dominant reading. All “losers” nodes become recessive of the message with the highest priority and do not try to write until the network is available again.
The CAN protocol supports two message frame formats. The only substantial difference is the size of the ID. CAN 2.0 A supports 11-bit ID sizes, while CAN 2.0B supports 29-bit ID sizes.
The SAE J1939 protocol is a communication standard for networks in the commercial automotive sector.
The SAE J1939 protocol works as an extended protocol over the CAN physical layer.
Use a 29-bit extended CAN identifier.
Uses standardized CAN baud rates from 250 kbits / s to 500 kbits / s
It has point-to-point addressing (node addressing) and global addressing (message addressing).
A message of more than 1785 bytes can be transmitted through multi-packet messages.
Bus access control through own network management.
It allows the definition of specific diagnostic messages from the manufacturer.
Define your own diagnostic interface.
Messages larger than 8 bytes are too large to be transmitted in a single CAN message. Therefore, these messages must be separated by the sender into individual packages. These individual packets are sent one by one by the sender, and the specific receiver must re-group them in a single message in order to process them.
Node Comunication: The sender establishes communication with the receiver. By receiving the individual packets, the receiver has the ability to control the flow of each packet. Both the receiver and sender can abort communication, for example when an error occurs.
Global Communication: or also called Broadcast Announcement Message (BAM), the sender manages the transmission flow by sending messages to the entire node network. The receiver cannot intervene in the communication, it only receives the message and processes it as indicated; if you can’t get a message, you’ll have to wait for another one to arrive. To allow slow nodes to maintain communication on the network, the sender has to maintain a minimum interval between messages (between 50-200ms).
The J1939-21 defines the schema with which the 29-bit identifier in CAN format should be interpreted. This CAN identifier is subdivided into different segments for a group of parameters. Thus, only a portion of the identifier is represented by the PGN (Parameter Group Number), the remainder is interpreted as Source address, destination address, and priority data page (DP).
The J1939 diagnostic interface defines a standard diagnostic connector as well as a set of PGNs to manipulate different diagnostic services. PGNs designated as Diagnostic Messages (DM) cover the necessary functions defined by UDS (Unified Diagnostic Service).
In contrast to UDS diagnostics in which the diagnosis has to be initiated by SW, J1939 connected ECUs can have diagnostic communication even in standard operations. Uniform error codes called Diagnostic Trouble Code (DTCs) contain the SPN that failed, the failure pattern, and the frequency of occurrence of the failure.