SAINT - CSI Electronics

SAINT - CSI Electronics
AUDIO SYSTEMS
DELPHI AUTOMOTIVE SYSTEMS CORPORATION
E&C to RS-232 Gateway
Systems Analysis INterface Tool (SAINT)
Users Guide
Document Number TBD
Version A , Draft 2
May 16, 2003
Copyright © Delphi Automotive Systems Corporation, 2002
Maintained by: Kris Boultbee
Delphi Delco Electronics Systems
1800 East Lincoln Road
Mail Station R329
Kokomo, IN 46904-9005
Phone: (765) 451-1267
FAX: (765) 451-7085
SAINT
E&C to RS-232 Gateway
05/16/03
Page 1 of 18
Table of Contents
1
Introduction .......................................................................................................................... 3
1.1
1.2
1.3
Scope ........................................................................................................................................................................... 3
Precedence .................................................................................................................................................................. 3
Definitions and Nomenclature ................................................................................................................................. 3
2
Overview............................................................................................................................... 4
3
RS-232 Setup ........................................................................................................................ 5
3.1
4
Message Format ................................................................................................................... 7
4.1
4.2
4.3
4.4
5
Buffering and Flow Control...................................................................................................................................... 6
Data Stream................................................................................................................................................................. 7
Messages IDs ............................................................................................................................................................. 8
Gateway Messages.................................................................................................................................................... 9
E&C Messages......................................................................................................................................................... 11
Connectors .......................................................................................................................... 13
5.1
5.2
5.3
RS-232 Connector (J3-DB9F).................................................................................................................................. 13
Bus and Power Connector for ACP Daughter Board 1.0 (J4-DB9M)............................................................... 13
Flash programming connector............................................................................................................................... 14
6
LEDs ................................................................................................................................... 15
7
Switches .............................................................................................................................. 16
7.1
7.2
8
SW1 Transceiver Switches:.................................................................................................................................... 16
SW2 Manual Reset:................................................................................................................................................ 16
Software Packages .............................................................................................................. 17
SAINT
E&C to RS-232 Gateway
Revision Log
Revision A
Draft 1 – June 12, 2002
Initial release of the document.
Draft 2 – May 16, 2003
Corrected title of 4.4.2.
Added section 4.4.5 “Example E&C Message”
05/16/03
Page 2 of 18
SAINT
E&C to RS-232 Gateway
1
1.1
05/16/03
Page 3 of 18
Introduction
Scope
This document describes the use and operation of SAINT Gateway with E&C 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 E&C 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
E&C to RS-232 Gateway
2
05/16/03
Page 4 of 18
Overview
This document describes the operation of the E&C 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 E&C 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
E&C to RS-232 Gateway
3
05/16/03
Page 5 of 18
RS-232 Setup
The gateway uses 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, E&C and slower
CAN bus’s. However, USB connection is recommended for high speed CAN communications.
SAINT
E&C to RS-232 Gateway
3.1
05/16/03
Page 6 of 18
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
E&C to RS-232 Gateway
4
05/16/03
Page 7 of 18
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
E&C to RS-232 Gateway
4.2
05/16/03
Page 8 of 18
Messages IDs
Message IDs are one byte long and have the following general format:
Type (CAN, BEAN,
ACP,Class 2, IIC, etc)
Command (Cmd=1)
Tx (1) / Rx (0)
Time Stamp (TS)
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)
•
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
E&C to RS-232 Gateway
4.3
4.3.1
05/16/03
Page 9 of 18
Gateway Messages
Gateway Commands
The SAINT Gateway supports the following commands:
4.3.1.1
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
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.
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)
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
SAINT
E&C to RS-232 Gateway
05/16/03
Page 10 of 18
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
1-12 bytes of Trigger Data
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
E&C to RS-232 Gateway
4.4
4.4.1
05/16/03
Page 11 of 18
E&C Messages
E&C Commands
There are no E&C commands at this time.
4.4.2
Transmitted E&C Messages
The following is the format for sending an E&C message:
40h
E&C 1
E&C 2
E&C 3
E&C 4
EOM 1
EOM 2
Byte 1
Byte 2
Byte 3
Byte 4
Byte 5
FFh
00h
For the example message of “ABCDEFGH IJKLMNOP QRSTUVWX YZabcdef” the bytes sent for E&C 1-4 are sent
out as: “1GFEDCBA PONMLKJI XWVUTSRQ fedcbaZY” (where H is always a “1”)
The maximum accepted E&C message length is 4 bytes.
4.4.3
Received E&C Messages
The following is the format of a received E&C message without time stamp information:
40h
E&C 1
E&C 2
E&C 3
E&C 4
EOM 1
EOM 2
Byte 1
Byte 2
Byte 3
Byte 4
Byte 5
FFh
00h
The following is the format of a received E&C message with time stamp information:
41h
E&C 1
E&C 2
E&C 3
E&C 4
Time MSB
Time LSB
EOM 1
EOM 2
Byte 1
Byte 2
Byte 3
Byte 4
Byte 5
8+N
9+N
FFh
00h
4.4.4
Length and Parity Bits
The last bit sent on the E&C bus is one’s parity (odd) and a zero bit may be added before the last bit to make the total
number of bits even. This is handled by the SAINT firmware. All transmitted messages have these bits added and all
received messages have these bits removed.
4.4.5
Example E&C Message
The following is an example of how to send an E&C Message and how it will look when echoed back from the SAINT
Gateway.
SAINT
E&C to RS-232 Gateway
05/16/03
Page 12 of 18
Suppose you want to read Address 1234
Request Data at Address (page 34 of E&C Diagnostic and Manufacturing Test Messages):
1pp 101j00 1101 aaaaaaaA bbbbbbbB S
The actual message would look like:
111 101000 1101 00101100 01001000 1 (according to the above, where pp=11; j=0; S=1)
Break this down in bytes:
11110100 01101001 01100010 01000100
F2 69 64 22 - Read each byte lsb (left) to msb (right)
However to send this out to the SAINT send:
2F 96 46 22 (msb is sent first onto the bus, also don’t forget to send a 40h header byte)
Now the SAINT takes this message and REMOVES the first bit!
So you will see on your screen (echoed back from SAINT)
11101000 11010010 11000100 10001000 (same as above but everything shifted since first bit is removed)
71 B4 32 11
You will see on the SAINT Monitor:
17 4B 23 11
SAINT
E&C to RS-232 Gateway
5
05/16/03
Page 13 of 18
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.
5.2
DE-9s Pin #
Use
2
TX to Host
3
RX from Host
8
CTS
6
DSR
5
GND
Bus and Power Connector for ACP Daughter Board 1.0 (J4-DB9M)
DE-9p Pin #
Use
1
Ground
2
ACP B
3
ACP A
4
NC
5
NC
6
NC
7
NC
8
NC
9
12 volt
SAINT
E&C to RS-232 Gateway
5.3
05/16/03
Page 14 of 18
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 connector - is as follows:
Pin #
Mnemonic
Use / description
Line up the connector label with the
board pin label.
Osc1
External (to SAINT) oscillator
Osc2
External (to SAINT) oscillator
Vdd
Already connected to +5V on SAINT
board
Vss
Already grounded
SAINT
E&C to RS-232 Gateway
05/16/03
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 an E&C message)
Page 15 of 18
SAINT
E&C to RS-232 Gateway
7
7.1
05/16/03
Page 16 of 18
Switches
SW1 Transceiver Switches:
The following is a summary of the dip switches .
7.2
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
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
E&C to RS-232 Gateway
8
05/16/03
Page 17 of 18
Software Packages
The following table lists the latest firmware releases for the SAINT board.
Name
Hardware
Version
Date
Description
EC_10.HEX
1.0
06/12/2002
Initial Release
Was this manual useful for you? yes no
Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Download PDF

advertisement