Vehicle bus series - J1939 3

I'm a man in slippers, a long-term car electronics engineer in Shanghai.

Old rules, share a piece of text you like, and avoid becoming an engineer with high knowledge and low culture:

No one follows you. No one needs to follow you either. You have to acknowledge your own worth, you can't stand against yourself by putting yourself in someone else's shoes. In life, the most fearful thing is to regard other people's eyes as the only standard of one's own life. In the end, I neither lived the way others liked, nor lived the way I wanted.
Only by accepting our true selves, without inferiority or pride, can we have a stronger heart; only by finding our own core values, can we live out our own wonderful life.

SAE J1939 is a communication protocol based on CAN (Controller Area Network) and is widely used in various commercial vehicles. The protocol standardizes the communication between CAN-connected electronic components and their add-on equipment in vehicles.

1. Priority

NAME is used to resolve conflicts and to prioritize addresses. If an address conflict is detected via an "address claim", the devices involved must compare their names. Starting from MSB (Most Significant Bit, the most significant bit)). Compare bit by bit. When comparing, the same rules of CAN arbitration apply: 0 overrides 1. The smaller the value, the higher the priority of NAME, and the ECU with higher priority can use this address. In this case, the behavior of an ECU with a lower priority NAME depends on its configuration, as follows for four basic configurations of an ECU:

1. Self-configuration

After the address is lost, the device will search for a new address between 128 and 247 by itself and try to get it. Animation „Address Claim Dynamic“

2. Program configuration

The device will send an "address claim" PGN with a NULL address (254), indicating that it "could not claim address". ECUs can be assigned new device addresses using the "Command Address" network management service. This can be done using external tools or "smart" devices in the network.

3. Manual configuration

For such ECUs, new addresses can only be set with the help of switches. A common method for this configuration is to encode the address with the aid of the processor I/O port, depending on the location of the ECU. For example, a door ECU can independently determine whether to install on the left or right and select the corresponding address.

4. Not configurable

Such ECUs can only receive new addresses by reprogramming the device software.

4. AAC bits

ECUs that may appear multiple times in the network must support "self-configuration" in the previous chapter Solutions and Configurations. The configuration behavior is determined by the Most Significant Bit (MSB) "Arbitrated Address (AAC)" in the NAME. This bit is used to independently search for a new device address after an ECU address conflict fails. If the ECU only appears once in the network, a fixed device address can be used and the "AAC" bit does not have to be set. As a result of this, the NAME of a self-configuring ECU has lower priority than an ECU that does not have this bit set.

5. Request

An important mechanism in J1939 network management is the use of "request" PGNs, which are used to request the PGNs of ECUs in the network. The "Address Claim" PGN also embodies the application of this mechanism. For example, the ECU must answer the "Address Claim Request" PGN with the "Address Claim" PGN.

NOTE: If the requesting ECU has a valid address, the ECU must also answer its own request!

6. Empty address

The request mechanism is often used in dynamic networks and is used at the beginning of communication. Therefore, the ECUs to participate in the communication can request the address status before the "address declaration". NOTE: The "Request for Address Claim" PGN is an exception in J1939. In other words, this PGN is the only parameter group that can be sent without a valid address, so it can be sent from an empty address (254).

7. Fragmented Message

The properties of parameter groups and their differences from "pure" CAN messages are introduced in the chapter on the basic information of parameter groups. It is mentioned that the data length of PGN is not limited to 8 bytes. However, since CAN is used as the physical transmission layer, the sender must divide the data packet longer than 8 bytes into multiple data packets, and then send them separately through the CAN message. Receivers must reassemble in their original order. The J1939 standard defines a set of rules for this, the transport protocol.

Two, two transmission protocols

1. Point to point

Specific communication - connection mode data transmission, by which the sender establishes a connection with the receiver. The receiver can choose to control and influence the flow control of individual packets. Both receiver and sender can abort the connection (for example in case of an error).

The connection mode data transfer protocol is not subject to any time constraints. All nodes can exchange data with each other at the maximum allowed speed.

2. Broadcasting

Global communication – BAM (Broadcast Announce Message, broadcast notification message):

The sender manages flow control alone. The message is sent to all nodes, and the receiver cannot intervene in the communication. Even if the receiver is missing a message, this cannot be communicated. The receiver must wait for a new message if necessary.

Since the receiver cannot influence the flow control in the BAM protocol, the sender must maintain a minimum time interval between individual packets, i.e. 50-200 milliseconds. This way, slow network nodes can keep up with the pace of communication.

The J1939 Diagnostic Interface defines a standard diagnostic connector, and a set of PGNs for handling various diagnostic services. The PGN contained in the diagnostic message (DM) basically covers the diagnostic functions defined in the Unified Diagnostic Communication Service (UDS) protocol, and also complies with EU regulations and the "California Regulation Specification" applicable to on-board diagnostics (OBD II), as well as heavy-duty Vehicle OBD (Heavy Duty OBD) and global unified OBD (WWH OBD, ISO 27145).

Contrary to UDS diagnostics where the service must be actively started via software tools, J1939 ECUs can also send diagnostic messages independently during normal operation. If necessary, errors that occur can also be evaluated directly in the network and visualized. At the same time, errors can be read out via the diagnostic connector using a tool. Unified error codes (also known as diagnostic trouble codes, Diagnostic Trouble Codes) include the fault SPN, error mode, and error frequency.

3. DTCs

DTC represents the fault attribute in the system, and mainly represents the SPN whose current state is abnormal. There are several reasons why the current state is abnormal. Indicators that can interpret this state are used to describe the actual cause of the error as precisely as possible. DTC has a unified structure and consists of the following elements:

1、SPN

Indicates a wrong SPN. All defined SPNs can be used in DTC.

2. FMI (Failure Mode Identifier, Failure Mode Identifier)

Indicates the nature and type of error that has occurred, such as out of value range (too high or too low), sensor short, update rate error, calibration error.

3. OC (Occurrence Counter)

This counter counts the number of times an error has occurred for each SPN and stores that value (even if the error fails).

4. CM (SPN Conversion Method, SPN conversion method)

Defines the DTC alignment. A value of "0" means the alignment shown in the "Structure of a DTC" diagram; if a value of "1", it must be distinguished which of the 3 ways the standard has defined. The system has to understand this.

End of writing and sharing!

May you and I believe in the power of time

Be a long-termist!

Guess you like

Origin blog.csdn.net/Soly_kun/article/details/132123396