Delphi RS-232 User Manual

AUDIO SYSTEMS
DELPHI AUTOMOTIVE SYSTEMS CORPORATION
Keyword 2000 to RS-232 Gateway
Systems Analysis INterface Tool (SAINT)
Users Guide
Document Number TBD
January 20, 2004
Copyright © Delphi Automotive Systems Corporation, 2004
Maintained by: Scott Herren Delphi Delco Electronics Systems 1800 East Lincoln Road Mail Station R329 Kokomo, IN 46904-9005 Phone: (765) 451-7168 FAX: (765) 451-7085
SAINT
232 Gateway
Keyword 2000 to RS-
01/20/04 Page 1 of 20
1 Introduction.........................................................................................................................3
1.1 Scope........................................................................................................................................................................3
1.2 Precedence..............................................................................................................................................................3
1.3 Definitions and Nomenclature.............................................................................................................................. 3
2 Overview..............................................................................................................................4
3 RS-232 Setup........................................................................................................................5
3.1 Buffering and Flow Control.................................................................................................................................. 5
4 Message Format...................................................................................................................6
4.1 Data Stream.............................................................................................................................................................6
4.2 Messages IDs.........................................................................................................................................................7
4.3 Gateway Messages................................................................................................................................................8
4.4 Keyword 2000 Messages....................................................................................................................................10
5 Connectors.........................................................................................................................15
5.1 RS-232 Connector (J3-DB9F).............................................................................................................................. 15
5.2 Bus and Power Connector (J4-DB9M)..............................................................................................................15
5.3 Flash programming connector ................................ ................................................................ ............................16
6 LEDs ..................................................................................................................................17
7 Switches.............................................................................................................................18
7.1 SW1 Transceiver Switches: ................................ ................................................................................................18
7.2 SW2 Manual Reset:............................................................................................................................................18
8 Software Packages..............................................................................................................19
SAINT
232 Gateway
Keyword 2000 to RS-
01/20/04 Page 2 of 20
Revision Log
Revision A Draft 1 – March 12, 2003 Initial release of the document. Draft 2 – April 25, 2003 Updated Section 4.4.1 (added message 2C 06 XX message) Draft 3 – May 8, 2003 Changed all references of ACP to Keyword 2000. Draft 4 – December 15, 2003 Updated Section 4.4.1 (added new commands – 07 thru 0A) Updated Section 4.4.2 (added new KW2K transmit structure) Draft 5 – January 7, 2004 Updated Section 4.4.1 (added new commands 0B and 0C) Updated Section 4.4.1 (changed 500ms to 5000ms on P3 Timeout) Updated Section 4.4.1 (changed 2C 01 to show Timeout/Error instead of just Error) Draft 6 – January 20, 2004 Updated Section 4.4.1 (added new commands 0D and 0E)
SAINT
232 Gateway
Keyword 2000 to RS-
01/20/04 Page 3 of 20
1 Introduction
1.1 Scope
This document describes the use and operation of SAINT Gateway with Keyword 2000 firmware. This document is proprietary to Delphi Automotive Systems Corporation and cannot be copied in whole or in part without the express written consent of Delphi Automotive Systems Corporation.
1.2 Precedence
This document shall have precedence over any information in any other document. Between reference documents, the document with the later revision date shall have precedence.
1.3 Definitions and Nomenclature
Gateway - abbreviation for Keyword 2000 to RS-232 Gateway. SAINT - common nickname for the gateway (Systems Analysis INterface Tool). Host - The computer which communicates to the gateway via RS-232 or USB. USB - Universal Serial Bus
SAINT
232 Gateway
Keyword 2000 to RS-
01/20/04 Page 4 of 20
2 Overview
This document describes the operation of the Keyword 2000 to RS-232 Gateway. The gateway is often referred to as the “SAINT gateway” or simply “SAINT”.
The following is synopsis of gateway features:
Allows host system to communicate on Keyword 2000 bus.
Performs timing, access, arbitration, serialization, and error control.
Configuration via host to gateway messages.
LED status indicator array:
1. Power LED (flashing LED)
2. Bus Message LED (toggles upon receiving a valid bus message)
3. Message Trigger LED (toggles upon receiving a specified byte pattern)
Gateway to host status / error messages.
Software is easily updated via a flash connector. Will eventually be done through the USB bus.
The following is a synopsis of requirements for use of the gateway:
Connection to power, ground, and busses to be monitored RS-232 connection to host
SAINT
232 Gateway
Keyword 2000 to RS-
01/20/04 Page 5 of 20
3 RS-232 Setup
The gateway use s the following RS -232 parameters:
- 8 Data Bits
- 1 Stop Bit
- No Parity
The gateway supported baud rate: 57600.
Baud Rate
57600
The supported baud rate is sufficient for communicating with the Class2, Keyword, ACP, BEAN, and slower CAN bus’s. However, USB connection is recommended for high speed CAN communications.
3.1 Buffering and Flow Control
Whenever the gateway receives a new message from the host, it will set the CTS line until the message can be processed. The host should not send data to the gateway while the CTS line is set. Due to the speed of the gateway processor, it is unlikely that the host will ever see the CTS line set.
The gateway buffers 64 bytes to send to the host. The gateway polls the RS-232 transmitter in the main loop to send data to the host. In some cases, the RS-232 transmit buffer will overflow. This should occur only when receiving CAN or IIC messages at a very fast rate. This will cause an ERc_RSFull error to be generated and the data to be lost
SAINT
232 Gateway
Keyword 2000 to RS-
01/20/04 Page 6 of 20
4 Message Format
To minimize latency with the RS-232 link, all data is sent in binary form. The same data format is used to send and receive messages. The gateway supports bi-directional asynchronous communications.
4.1 Data Stream
The host data stream is broken into messages. A message consists of a Message ID and one or more data bytes.
The character FFh is used as an ESCAPE character to indicate the end of messages. There are three cases when an ESCAPE character is received.
If the ESCAPE character is followed immediately by a second ESCAPE character, the following are true:
The message is not yet complete.
The pair of ESCAPE characters represents a single byte of message data of value FFh.
If the ESCAPE character is followed immediately by a byte of value 00h, the following are true.
The message is complete.
Neither the FFh nor the 00h are part of the message.
No more messages are ready to be sent.
If the ESCAPE character is followed immediately by of any value other than FFh or 00h, the following are true:
The message is complete.
Neither the ESCAPE character nor the character following the ESCAPE character are part of the message.
The value following the ESCAPE character is the message ID for a new message.
This data stream format was chosen to allow arbitrary long messages (i.e. 4K Class 2 data blocks), to minimize the overhead to two bytes per message during peak traffic, and to immediately recognize the end of a message without having to wait for the next message to start.
After a gateway reset, the gateway will ignore all data until it sees an ESCAPE character. Once it has received a valid EOM, it will recognize the following message.
SAINT
232 Gateway
Keyword 2000 to RS-
01/20/04 Page 7 of 20
4.2 Messages IDs
Message IDs are one byte long and have the following general format:
Type (CAN, BEAN,
ACP,Class 2, IIC, etc)
Bits 3 - 7 bit 2 bit 1 bit 0
The upper nibble indicates the type of message. The following types are defined:
Gateway (08)
Keyword 82 (10h)
Keyword 71 (18h)
IIC (20h)
Keyword 2000 (28h)
Command (Cmd=1) Tx (1) / Rx (0) Time Stamp (TS)
IDB (30)
ACP (38h)
E&C (40h)
J1708 (48h)
CAN (50h)
Class2 (60h)
Class2 Block (68h)
SPI (70h)
BEAN1 (90h)
BEAN2 (98h)
Bits 3 to 7 identify the specific communication bus (i.e., Class 2, CAN bus, etc.). Bit 2 is used to designate a command or setup message when set to 1. Bit 1 is the transmit or receive bit with 1 designating transmit and 0 designating receive. Bit 0 is used to designate the Time Stamp. In general, report messages from the gateway use the same identifiers as commands to the gateway.
SAINT
232 Gateway
Keyword 2000 to RS-
4.3 Gateway Messages
4.3.1 Gateway Commands
The SAINT Gateway supports the following commands:
Header ID Data Description
08h 80h None Perform Reset 08h 86h None Turn Time Stamp Information OFF 08h 87h None Turn Time Stamp Information ON 08h 88h None Turn Transmit Echo ON 08h 89h None Turn Transmit Echo OFF 08h 92 None Request Software Version 08h F0h D1-D12 Enable Gateway Trigger 08h F1h None Disable Gateway Trigger
01/20/04 Page 8 of 20
4.3.1.1 Reset
This command will cause the gateway to do a complete cold start. The gateway will ignore the next message.
4.3.1.2 Time Stamp
This command controls whether a 16 bit time stamp is appended to the end of the bus message reports.
4.3.1.3 Transmit Echo
This command controls whether transmitted messages are echoed back to the host when they are sent. Echoed back messages will have their transmit bit set. Currently the transmit echo is disabled.
4.3.1.4 Software Version Request
This command requests the gateway software version (ASCII).
4.3.1.5 Trigger
This command will cause the gateway to toggle the trigger LED upon receiving the specified byte pattern. Up to 12 data bytes may be used. This feature is helpful for triggering an oscilloscope. (Not available with IDB firmware)
SAINT
232 Gateway
Keyword 2000 to RS-
01/20/04 Page 9 of 20
4.3.2 Gateway Reports
The gateway will report a Reset whenever one occurs. Most likely causes of reset are power on reset, host commanded reset, or gateway micro watchdog error. The gateway does a cold start on all resets (all information is lost). The gateway will also report error conditions with the Report Error message below. See section 4.3.2.1 for error code definitions.
The gateway will also echo back all system commands.
Header ID Description Data Bytes
08h 80h Reset Occurred None 08h 82h Report Error 1 byte Error Code 08h 86h Report Time Stamp Information OFF None 08h 87h Report Time Stamp Information ON None 08h 88h Report Transmit Echo ON None 08h F0h Report Gateway Trigger ON None 08h F1h Report Gateway Trigger OFF None
4.3.2.1 Gateway Error Codes
Most error codes are related to sending data at the wrong rate (usually too fast).
Code Description
80h System - Invalid message ID 81h System - RS-232 Transmit Buffer Full 82h System - UART Error (Overrun, etc.) 83h System – Received message is too long. 84h System - Have not read previous message
SAINT
232 Gateway
Keyword 2000 to RS-
01/20/04 Page 10 of 20
4.4 Keyword 2000 Messages
4.4.1 Keyword 2000 Commands
The following commands may transmitted to the SAINT.
Header ID Description Data Bytes
2Ch 02h Set Tester Address 1 byte Tester Address (Default – F1h) 2Ch 03h Set ECU Address 1 byte ECU Address (Default – 11h) 2Ch 04h Disable/Enable P1 and P2 Error Reporting 1 byte (00 = Disable and 01 = Enable) 2Ch 05h Disable Force Checksum (Default) 1 byte (00h) 2Ch 05h Enable Forced Checksum (error generation) 2 bytes (01h then Checksum byte) 2Ch 06h Disable/Enable Fast Initialization Sequence
(Note: Node-to-Node Communication disables
Fast Wakeup Pattern and Start Comm message)
2Ch 07h Addressing Mode 1 byte (see below)
00 = Tester -to-Node Communication
01 = Node-to-Node Communication
00 = Physical Addressing (default)
1 byte (see below)
01 = Functional Addressing
2Ch 08h Length included in Format Byte 1 byte (see below)
00 = Length not in Format Byte (default)
01 = Length included in Format Byte
2Ch 09h
(More Baud rates can be added as needed.)
2Ch 0Ah Set Low Time of Fast Init Waveform 1 byte (time in msec)
2Ch 0Bh Set P3 Minimum and Maximum Time
P3 Maximum Default = 5120ms
2Ch 0Ch Set P4 Minimum Time
2Ch 0Dh Enable/Disable Start Communications message 1 byte (see below)
Set Baud Rate
P3 Minimum Default = 55ms
P4 Minimum Default = 5ms
* Sets low portion of Fast Init waveform
to 25m sec. Therefore, high portion will be
00 XX (Set P3 min, XX=time in ms)
01 XX (Set P3 max, XX=time*256 in ms)
00 XX (Set P4 min, XX=time in ms)
00 = Enable Start Comm Msg (default)
1 byte (see below)
00 = 10400 Baud (default)
01 = 9600 Baud 02 = 19200 Baud 03 = 38400 Baud 04 = 57600 Baud
05 = 115200 Baud
Example: 2C 0A 19
50ms – 25ms = 25ms
2 bytes (see below)
2 bytes (see below)
01 = Disable Start Comm Msg
SAINT
232 Gateway
Keyword 2000 to RS-
01/20/04 Page 11 of 20
2Ch 0Eh Enable/Disable Forced Format Byte
(Error Testing)
The following commands are reported by the SAINT (without time stamp information).
Header ID Description Data Bytes
2Ch 00h Fast Wakeup Pattern Detected None 2Ch 01h Keyword 2000 Timeout/Error 1 byte (explained below)
Keyword 2000 Timeout/Errors:
Bit 0 P1 Timeout 0 No timeout detected. 1 Inter byte timeout occurred for ECU (time between bytes > 20msec).
Bit 1 P2 Timeout 0 No timeout detected. 1 Timeout occured between Tester and ECU or two ECU responses (> 50msec).
00 = Disable forced format byte (default)
01 XX = enable forced format byte
(where XX = format byte)
Bit 2 P3 Timeout 0 No timeout detected. 1 Timeout occured between end of ECU response and start of Tester (> 5000msec).
Bit 3 Checksum Error 0 No error detected. 1 Detected a checksum error of a received Keyword 2000 message.
SAINT
232 Gateway
Keyword 2000 to RS-
01/20/04 Page 12 of 20
4.4.2 Transmitted Keyword 2000 Messages
The following is the format for sending a Keyword 2000 message:
Header SID (Service Identification Byte) N Data Bytes
28h Byte 2 Bytes 3 (2+N)
The above information is used to form the following message which is sent onto the Keyword 2000 bus (with Length Byte not included in the Format Byte):
Format Target Source Length SID N Data Bytes Checksum
Byte 1 Byte2 Byte 3 Byte 4 Byte 5 Bytes 6 (5+N) Byte (6+N)
The above information is used to form the following message which is sent onto the Keyword 2000 bus (with Length Byte included in the Format Byte):
Format Target Source SID N Data Bytes Checksum
Byte 1 Byte2 Byte 3 Byte 4 Bytes 5 (6+N) Byte (5+N)
Also, the SAINT will check to see if the bus is “initialized” and if necessary will send the Fast initialization sequence (transmit Wakeup Pattern of 25msec logic low and 25msec logic high followed by a Start Communications request message 81 11 F1 81 04). Refer to the “Keyword Protocol 2000 Data Link Layer Recommended Practice” section 5.1.5.3 for more information.
Currently, only the Fast Initialization sequence is supported. Future initialization sequences will be added as needed.
SAINT
232 Gateway
Keyword 2000 to RS-
01/20/04 Page 13 of 20
4.4.3 Received Keyword 2000 Messages
The following are the 4 possible formats of a received Keyword 2000 message with time stamp information:
Header Format SID N Data Bytes Checksum Time MSB Time LSB
29h Byte2 Byte 3 Bytes 4 - (3+N) Byte 4+N Byte 5+N Byte 6+N
Header Format Length SID N Data Bytes Checksum Time MSB Time LSB
29h Byte2 Byte 3 Byte 4 Bytes 5 - (4+N) Byte 5+N Byte 6+N Byte 7+N
Header Format Target Source SID N Data Bytes Checksum Time MSB Time LSB
29h Byte2 Byte 3 Byte 4 Byte 5 Bytes 6 - (5+N) Byte 6+N Byte 7+N Byte 8+N
Header Format Target Source Length SID N Data Bytes Checksum Time MSB Time LSB
29h Byte2 Byte 3 Byte 4 Byte 5 Byte 6 Bytes 7 - (6+N) Byte 7+N Byte 8+N Byte 9+N
4.4.4 Format byte
The format byte contains a 6-bit length information and a 2-bit address mode information.
Bit 7 Bit 6 Address Information 0 0 no address informatio 0 1 exception mode (CARB) 1 0 with address information, physical addressing 1 1 with address information, functional addressing
Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Length X X X X X X Define length of message from the Data to Checksum (not included) bytes . A message length of 1 to 63 bytes is possible. If bits 5-0 are zero then the additional length byte is included. Refer to the “Keyword Protocol 2000 Data Link Layer Recommended Practice” section 4.1.1 for more information.
SAINT
232 Gateway
Keyword 2000 to RS-
01/20/04 Page 14 of 20
4.4.5 Target address byte
This is the target address for the message and is always used together with the source address byte. Refer to the “Keyword Protocol 2000 Data Link Layer Recommended Practice” section 4.1.2 for more information.
4.4.6 Source address byte
This is the address of the transmitting device which is a physical address. Refer to the “Keyword Protocol 2000 Data Link Layer Recommended Practice” section 4.1.3 for more information.
4.4.7 Length byte
This byte is provided if the length in the header byte (bits 0-5) is set to 0. It allows the user to transmit messages with data fields longer than 63 bytes. With shorter messages it may be omitted. This byte defines the length of a message from the beginning of the data field (SID included) to the checksum byte (not included). Refer to the “Keyword Protocol 2000 Data Link Layer Recommended Practice” section 4.1.4 for more information.
4.4.8 Data bytes
The data field may contain up to 255 bytes. The first byte of the data field is the Service Identification Byte. Refer to the “Keyword Protocol 2000 Data Link Layer Recommended Practice” section 4.2 for more information.
4.4.9 Checksum byte
The checksum byte inserted at the end of the message block is defined as the simple 8-bit sum series of all bytes in the message, excluding the checksum. Refer to the “Keyword Protocol 2000 Data Link Layer Recommended Practice” section 4.3 for more information.
SAINT
232 Gateway
Keyword 2000 to RS-
01/20/04 Page 15 of 20
5 Connectors
The gateway uses two connectors. One connector is for the RS-232 link and is DB9F. The second connector is a
DB9M for the CAN bus (low speed, medium speed, and high speed), Class 2 bus, Keyword, power, and ground.
The following pin outs are used:
5.1 RS-232 Connector (J3-DB9F)
A straight pass cable should be used to connect the gateway to the host computer.
DE -9s Pin # Use
2 TX to Host 3 RX from Host 8 CTS 6 DSR 5 GND
5.2 Bus and Power Connector (J4-DB9M)
DE -9p Pin # Use
1 Ground 2 NC 3 NC 4 NC 5 NC 6 NC 7 NC 8 Keyword 2000 9 12 volt
SAINT
232 Gateway
Keyword 2000 to RS-
01/20/04 Page 16 of 20
5.3 Flash programming connector
Note: the long term goal is to Flash using the USB connector.
Connector J2 is used with an external connector – the intended application of this port is the flash programming of a product. The pin out of the connector J2 – flash programming connectior - is as follows:
Pin # Mnemonic Use / description
Line up the connector label with the board pin label.
Osc2 External (to SAINT) oscillator
Vdd Already connected to +5V on
Vss Already grounded
Osc1 External (to SAINT) oscillator
SAINT board
SAINT
232 Gateway
Keyword 2000 to RS-
6 LEDs
Four LEDs are used by the gateway. These LEDs are:
LED # Purpose
4 NC (No Connection) 3 Trig (Toggled on specified message) 2 Pow (SAINT powered up) 1 Bus (Toggles on receiving a Keyword 2000 message byte)
01/20/04 Page 17 of 20
SAINT
232 Gateway
Keyword 2000 to RS-
01/20/04 Page 18 of 20
7 Switches
7.1 SW1 Transceiver Switches:
The following is a summary of the dip switches .
SWITCH # Mnemonic Purpose
1 NA NA 2 NA NA 3 NA NA 4 NA NA 5 NA NA 6 NA NA 7 NU Not currently being used 8 NU Not currently being used
7.2 SW2 Manual Reset:
SW2 is the manual reset switch. Pressing this switch will change an input to the SAINT microprocessor, causing it to start executing the embedded code from some predetermined start state.
SAINT
232 Gateway
Keyword 2000 to RS-
01/20/04 Page 19 of 20
8 Software Packages
The following table lists the latest firmware releases for the SAINT board.
Name Hardware
Version
KW2K_10.HEX 1.2 + 03/12/03 Keyword 2000 initial release.
Date Description
Loading...