1、_ SAE Technical Standards Board Rules provide that: “This report is published by SAE to advance the state of technical and engineering sciences. The use of this report is entirely voluntary, and its applicability and suitability for any particular use, including any patent infringement arising there
2、from, is the sole responsibility of the user.” SAE reviews each technical report at least every five years at which time it may be reaffirmed, revised, or cancelled. SAE invites your written comments and suggestions. Copyright 2008 SAE International All rights reserved. No part of this publication m
3、ay be reproduced, stored in a retrieval system or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise, without the prior written permission of SAE. TO PLACE A DOCUMENT ORDER: Tel: 877-606-7323 (inside USA and Canada) Tel: 724-776-4970 (outside USA)
4、 Fax: 724-776-0790 Email: CustomerServicesae.org SAE WEB ADDRESS: http:/www.sae.org J2818 JAN2008 SURFACE VEHICLE INFORMATION REPORT Issued 2008-01 Keyword Protocol 1281 RATIONALE Not applicable. TABLE OF CONTENTS 1. SCOPE 2 2. REFERENCES 2 2.1 Applicable Publications . 2 2.1.1 SAE Publications. 2 2
5、.1.2 ISO Publications 3 3. TERMS AND ACRONYMS . 3 3.1 ECU. 3 3.2 ETX . 3 3.3 Scan Tool 3 3.4 Serial Diagnosis 3 3.5 MESSAGE 3 3.6 SERVICE 3 3.7 SESSION 3 3.8 TRANSMITTER. 3 3.9 RECEIVER 4 4. OVERVIEW. 4 4.1 Stimulation and Initiation. 4 4.2 Data Byte Communication 4 4.3 Message-Specific Overview 5 4
6、.4 Timing Parameters 6 5. INTERFACE 6 6. INITIATION OF SERIAL DIAGNOSTIC COMMUNICATION . 7 6.1 Stimulation of the KWP1281 ECU 7 6.2 Communication Set-Up. 8 6.2.1 Synchronization Byte 8 6.2.2 Keyword 8 6.2.3 Format of Data Bytes 9 6.3 Error Handling During Initiation. 10 SAE J2818 Issued JAN2008 - 2
7、- 7. COMMUNICATION. 10 7.1 Service Structure. 10 7.1.1 Message Length 10 7.1.2 Message Counter 11 7.1.3 Service Identification. 11 7.1.4 Message-Specific Bytes 11 7.1.5 Message End Byte 11 7.2 Data Protection . 11 7.3 Message Byte Timing . 11 7.4 Acknowledgement of Correctly Received Messages . 11 7
8、.5 Error Handling During Normal Communication 12 7.6 No Acknowledge Retry . 13 7.7 No Acknowledge Unknown Block . 13 7.8 Session Structure 14 7.9 Service Sequence. 14 1. SCOPE This Technical Information Report defines the diagnostic communication protocol Keyword Protocol 1281 (KWP1281). This docume
9、nt should be used in conjunction with SAE J2534-2 in order to fully implement the communication protocol in an SAE J2534 interface. Some Volkswagen of America and Audi of America vehicles are equipped with ECUs, in which a KWP1281 proprietary diagnostic communication protocol is implemented. The pur
10、pose of this document is to specify the KWP1281 protocol in enough detail to support the requirements necessary to implement the communication protocol in an SAE J2534 interface device. 2. REFERENCES 2.1 Applicable Publications The following publications form a part of this specification to the exte
11、nt specified herein. Unless otherwise indicated, the latest version of SAE publications shall apply. 2.1.1 SAE Publications Available from SAE International, 400 Commonwealth Drive, Warrendale, PA 15096-0001, Tel: 877-606-7323 (inside USA and Canada) or 724-776-4970 (outside USA), www.sae.org. SAE T
12、echnical Paper 950041 An Arbitration Mechanism on ISO 9141-2 (as information) SAE J2534-1 Recommended Practice for Pass-Thru Vehicle Programming SAE J2818 Issued JAN2008 - 3 - 2.1.2 ISO Publications Available from ANSI, 25 West 43rd Street, New York, NY 10036-8002, Tel: 212-642-4900, www.ansi.org. I
13、SO 9141:1989-10-01 Road vehiclesDiagnostic systemsRequirements for interchange of digital information ISO 9141-2:1994 Road vehiclesDiagnostic systemsCARB requirements for interchange of digital information ISO 9141-2:1996 Road vehiclesDiagnostic systemsCARB requirements for interchange of digital in
14、formation Amendment 1 ISO 9141:1992-10-13 Key word assigning authorityMaster data base ISO 14230-2:1999 Road vehiclesDiagnostic systemsKeyword protocol 2000 Part 2: Data link layer 3. TERMS AND ACRONYMS 3.1 ECU Electronic Control Unit located in the vehicle that communicates over KWP1281. 3.2 ETX En
15、d of transmission. This is the last byte of a Message. It is the ASCII value 0x03. 3.3 Scan Tool Diagnostic Tool that communicates over KWP1281 to the ECU located in the vehicle. 3.4 Serial Diagnosis The serial diagnosis offers the possibility of rapid access to ECU information and functions without
16、 disconnecting the wire harness. Serial diagnosis allows interrogation of input signals present at the ECU, external switching of actuators to which the ECU has access as well as reading the internal unit information such as the fault memory. Serial diagnosis can be used in the end of line inspectio
17、n or in the service workshops and can contribute towards considerable savings in inspection time. 3.5 MESSAGE The smallest repeatable unit of transmission is a “MESSAGE”. A message consists of a certain number of bytes and always has the same format. 3.6 SERVICE Structure of one or more “MESSAGES” u
18、sed as a request or response. 3.7 SESSION The sum of all messages transmitted during communication with an ECU is a “SESSION”. 3.8 TRANSMITTER The unit (ECU or Scan Tool) which is entitled to output a message is called a “TRANSMITTER”. The transmitter executes a passive handshake (i.e. it checks the
19、 complemented byte with respect to correct transmission). SAE J2818 Issued JAN2008 - 4 - 3.9 RECEIVER The receiver of a message is called a “RECEIVER”. The receiver performs an active “handshake” (each received byte (except “ETX”) is complemented and returned to the transmitter). 4. OVERVIEW 4.1 Sti
20、mulation and Initiation FIGURE 1 - INITIATION OF DIAGNOSTIC COMMUNICATION 4.2 Data Byte Communication FIGURE 2 - DATA BYTE COMMUNICATION SAE J2818 Issued JAN2008 - 5 - 4.3 Message-Specific Overview FIGURE 3 - MESSAGE TRANSMISSION SAE J2818 Issued JAN2008 - 6 - 4.4 Timing Parameters TABLE 1 - TIMING
21、PARAMETERS Description Parameter Name Minimum Value Maximum Value Stimulation Idle line before start of stimulation t_r0 300 msec (see text below) Start of communication Time between correct stimulation and start of the synchronization byte t_r1 80 msec 210 msec Time between synchronization byte and
22、 key-byte 1 t_r2 5 msec 20 msec Time between key-byte 1 and key-byte 2 t_r3 1 msec 20 msec Time between key-byte 2 and complement key-byte 2 t_r4 25 msec 50 msec Time between complement key-byte 2 and the start of ECU identification t_r5 25 msec 50 msec Time the ECU waits before sending the synchron
23、ization byte and key bytes again if the inverted key-byte is not received correctly T_RKMAX 231 msec N/A During communication Time the Scan Tool waits after it receives a byte before sending the next byte T_R6 1 msec 50 msec Time the ECU waits after it receives a byte before transmitting the next by
24、te. t_r7 0.5 msec 50 msec Time-out used by transmitter and receiver while waiting for a echo byte response t_r8 max NA 55 msec Number of No Ack retries before error NA_retries 5 Number of time-out retries while sending a message before discarding the message TO_retries 3 Time between end of a messag
25、e and start of the next message t_rb 1 msec 1100 msec Three cases of tr_0 1. The vehicle is switched on and diagnostic data is requested. The Scan Tool shall not send the start bit of ECU Address before the K-Line was on logic “1” for less then 300 ms (W5 in ISO 14230-2). 2. A communication is stopp
26、ed by a time out detected by the Scan Tool. The ECU has to be ready immediately (t_rb Maximum Value W5 in ISO 14230-2). 3. A stop communication is sent by the Scan Tool, in this case the new address can be put on the K-Line within the normal inter byte time (55 msec, P3min in ISO 14230-2). 5. INTERF
27、ACE The KWP1281 ECU requires one line for communication with an external Scan Tool, the bi-directional communication line (K line). This line possesses bus capability, i.e. it can be connected together with lines with the same function from other ECUs (see Figure 4). SAE J2818 Issued JAN2008 - 7 - F
28、IGURE 4 - K-LINE CONNECTION CONCEPT Stimulation of an ECU on the diagnosis bus by the Scan Tool takes place by means of an address specific to the ECU which is transmitted via the K line. 6. INITIATION OF SERIAL DIAGNOSTIC COMMUNICATION 6.1 Stimulation of the KWP1281 ECU The KWP1281 ECU is selected
29、from all ECUs connected to the K line for a subsequent communication by the means of stimulation by the Scan Tool. Stimulation takes place by transmission of the address word assigned to the KWP1281 ECU. In order to access diagnosis mode, the address word must first be transmitted via the K line. Th
30、e address word used for stimulation must be transmitted in 10-bit format at a transfer rate of 5 baud +/- 1%. The address word is made up as follows, in the order of transmission (see Figure 5): FIGURE 5 - ADDRESS WORD SAE J2818 Issued JAN2008 - 8 - 6.2 Communication Set-Up 6.2.1 Synchronization Byt
31、e Communication is set up on the basis of the existing ISO 9141 and ISO 14230-2 specification. After the ECU has received the stop bit of the address word which has been identified as its own address, it waits for 1 bit duration of the stimulation word in order to give the Scan Tool an opportunity t
32、o prepare itself for a subsequent communication. After this waiting time, the ECU reacts with output of a synchronization byte on the K line. The reaction takes place within a time of t_r1, calculated from complete reception of the stimulation address stop bit. The synchronization byte has the follo
33、wing structure (see Figure 6): FIGURE 6 - SYNCHRONIZATION BYTE The synchronization byte is transmitted with the same baud rate as is used for subsequent data transfer. The Scan Tool can recognize the baud rate on the basis of the synchronization byte (e.g. by measurement of the intervals between the
34、 falling edges). No emission related ECUs may use baud rates different from 10400 baud 1%. 6.2.2 Keyword 2 key-bytes are transmitted after the synchronization byte. These inform the Scan Tool of the parameters for subsequent communication. The key-bytes have the following structure (See Figure 7). 1
35、 start bit logical “0”, low potential 7 Key data bits 1 parity bit odd parity (labeled the P bit below) 1 stop bit logical “1”, high potential The 2 key-bytes must be considered as belonging together and represent a 14-bit piece of information. The low byte = 0x01 is transmitted first, followed by t
36、he high byte = 0x0A. SAE J2818 Issued JAN2008 - 9 - FIGURE 7 - KEYWORD Following transmission of the synchronization byte, the ECU waits for t_r2 before transmitting the first key-byte. This allows the Scan Tool sufficient time to change its baud rate to that measured from the synchronization byte.
37、The 2 key-bytes are transmitted at an interval of t_r3. After output of the second key-byte, the ECU expects the complement of the second key-byte from the Scan Tool as confirmation of successful communication, whereby the Scan Tool must observe an interval of t_r4 before it sends the complement. Th
38、is interval serves the purpose of allowing the ECU sufficient time to switch over to receive mode. After successfully completing the communication setup, the ECU starts with the first byte of the ECU ID service after a time of t_r5. Beginning with this automatic response, the KWP1281 protocol is dif
39、ferent from ISO9141-2 and ISO14230-2. 6.2.3 Format of Data Bytes During communication, the KWP1281 Scan Tool and ECU shall operate with the following data byte format (see Figure 8): FIGURE 8 - DATA FORMAT SAE J2818 Issued JAN2008 - 10 - 6.3 Error Handling During Initiation The ECU aborts stimulatio
40、n detection if engine speed exceed the engine speed limit no valid stop bit recognized wrong parity recognized no valid start bit recognized received address not same as own address After abortion of stimulation detection, the ECU synchronizes itself to a stimulation operating again. If the ECU reco
41、gnizes the complement of the key-byte as containing an error, then it can assume that the Scan Tool has not correctly determined the baud rate of the synchronization byte. The ECU waits for t_rkmax before it starts with renewed output of the synchronization byte so that the Scan Tool experiences a t
42、ime-out and also detects an error. In the event of a fault, communication setup can be performed once more without renewed stimulation. A time-out representing approximately 1 bit period of the stimulation word (200 msec) is used for detection of a fault. This means that the interval between 2 bytes
43、 during communication setup must never be longer than the time corresponding to the time-out. If a Scan Tool time-out occurs during communication setup, the Scan Tool can assume that the ECU (if it is still capable of functioning) will start communication setup again with output of the synchronizati
44、on byte, unless the number of communication setup repetitions programmed in the ECU has been reached. If an ECU time-out occurs, which can happen only if the ECU does not receive the complement of the second key-byte, it reacts with output of the synchronization byte after the time-out, as mentioned
45、 above. 7. COMMUNICATION 7.1 Service Structure The information which is exchanged between the Scan Tool and the ECU is organized in services on the basis of the respective content. A service may be combined from several messages. All Messages have the same message structure. Each message consists of
46、 a byte in which the message length is transmitted, a message counter, the service identification (SID), message-specific information and the message end. This results in the following structure in the order of transmission. TABLE 2 - SERVICE STRUCTURE Byte Content 1 Message length (n-1) 2 Message c
47、ounter 3 Service Identification 4 n-1 Message-specific information (if necessary) n Message end 7.1.1 Message Length The message length byte specifies the number of following bytes (in the above table, this is therefore (n-1). SAE J2818 Issued JAN2008 - 11 - 7.1.2 Message Counter The first transmitt
48、ed message (this is the first message of the ECU identifier) has a message counter value of 1. . The value of the message counter is incremented by each transmitted message. The value 0 follows the value 255. Since two successive messages must never have the same direction of transmission this also
49、means that the value of the message counter is always an even number for messages which are output by the Scan Tool. Correspondingly, the message output by the ECU always possesses an odd message number value. The message counter thus offers an additional check for correctness of transmission. 7.1.3 Service Identification The Service Identification, which is transmitted as the third byte, provides