AUDIO SYSTEMS DELPHI AUTOMOTIVE

AUDIO SYSTEMS DELPHI AUTOMOTIVE
AUDIO SYSTEMS
DELPHI AUTOMOTIVE SYSTEMS CORPORATION
CAN / Class 2 / KEYWORD / IIC to RS-232 / USB Gateway
Systems Analysis INterface Tool (SAINT)
Programming Reference
Document Number TBD
Version A , Draft 20
February 23, 2006
Copyright Delco Electronics Corporation, 2004
Maintained by: Scott Herren
Delphi Delco Electronics Systems
1800 East Lincoln Road
Mail Station R329
Kokomo, IN 46904
Phone: (765) 451-7168
FAX: (317) 451-7085
SAINT
CAN / Class 2 / Keyword / IIC to RS-232 / USB
Gateway
02/23/06
Page 1 of 30
Table of Contents
1
Introduction...................................................................................................................................... 4
1.1
1.2
1.3
2
3
Overview ........................................................................................................................................... 5
RS-232 Setup .................................................................................................................................... 6
3.1
4
Buffering and Flow Control ......................................................................................................................7
Message Format ............................................................................................................................... 8
4.1
4.2
4.3
4.4
4.5
4.6
4.7
4.8
4.9
5
Scope .........................................................................................................................................................4
Precedence .................................................................................................................................................4
Definitions and Nomenclature ...................................................................................................................4
Data Stream ...............................................................................................................................................8
Messages IDs.............................................................................................................................................9
Gateway Messages...................................................................................................................................10
CAN Messages ........................................................................................................................................12
Class 2 Messages .....................................................................................................................................16
IIC Messages ...........................................................................................................................................18
Keyword 82 Messages.............................................................................................................................19
Keyword 71 Messages.............................................................................................................................21
IDB Messages..........................................................................................................................................23
Connectors ...................................................................................................................................... 25
5.1
5.2
5.3
RS-232 Connector (J3-DB9F) .................................................................................................................25
Bus and Power Connector (J4-DB9M)....................................................................................................25
Flash programming connector .................................................................................................................26
6
LEDs................................................................................................................................................ 27
7
Switches........................................................................................................................................... 28
8
Electrical Specifications................................................................................................................. 29
SAINT
CAN / Class 2 / Keyword / IIC to RS-232 / USB
Gateway
02/23/06
Revision Log
Revision A
Draft 1 – March 10, 2000
• Initial release of the document. No USB support.
Draft2 – April 12, 2000
• Added IDB messages to document.
Draft3 – August 9, 2000
• Additional IDB commands added
• Updated software packages
Draft4 – July 19, 2001
• Updated Message ID’s
• Updated software packages
• Added CAN baud rate switch settings
• Added section 4.3.1.4 for periodic messages
Draft5 – April 18, 2002
• Updated Message ID’s
• Updated Class 2 section 4.5
• Removed section 4.5.4 and 4.5.5 (C2 Blocks)
• Updated software packages
Draft 6 – September 10, 2002
• Updated message ID’s section 4.2
• Added periodic message response messages section 4.3.2
• Updated section 8 (software packages)
Draft 7 – October 25, 2002
• Updated message ID’s section 4.2
• Added Single Wire Mode Control Commands section 4.4.1.2
Draft 8 – December 2, 2002
• Updated Keyword 71 Messages section 4.8
Draft 9 – February 5, 2003
• Added explaination of received Class2 Error message in section 4.5.3
Draft 10 – February 18, 2003
• Updated sections 4.4.1.1 and 4.4.1.2
Draft 11 – February 25, 2003
• Updated section 4.4.2 and 4.4.3
Draft 12 – April 22, 2003
• Added “Enter Monitor Mode” to section 4.8.1
• Added Section 9 “Electrical Specifications”
Draft 13 – May 12, 2003
• Corrected bits 3 and 2 of section 4.5.3.1 Completion Code
• Updated section 4.4.1.1 Can Setup for 83.3k values
• Added explaination to 4.4.1.2 Single Wire Mode Control
Draft 14 – March 23, 2004
• Added section 4.5.3.2 which specifies Class2 Block support
• Added 95.2k baud to CAN table for IVAN
Draft 15 – June 4, 2004
• Updated section 4.4.2 for 29-bit support
Draft 16 September 08, 2004
Page 2 of 30
SAINT
CAN / Class 2 / Keyword / IIC to RS-232 / USB
Gateway
•
02/23/06
Page 3 of 30
Updated section 4.4.1.1 for new values of bit timing registers 0 and 1 (Intel 82527) These values
are for optimizing the example CAN baud rates (sample 75-82%).
• Updated sections 4.4.2 and 4.4.3 with clearer explainations of 29-bit CAN message construction.
Draft 17 – January 21, 2005
• Updated KW71 error message definition - section 4.8.3
Draft 18 – June 16, 2005
• Added new CAN commands for error reporting – section 4.4.1
Draft 19 – July 7, 2005
• Fixed error in section 4.5.3.1 (Class 2 Completion Code bits 0 and 1)
Draft 20 – February 23, 2006
• Updated section 7.1 tables (CAN Switches 7&8 change from 250k to 125k baud)
• Removed section 8 Software Packages
SAINT
CAN / Class 2 / Keyword / IIC to RS-232 / USB
Gateway
1
1.1
02/23/06
Page 4 of 30
Introduction
Scope
This document describes the use and operation of the CAN / Class 2 / Keyword / IIC to RS-232 / USB Gateway.
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 “ CAN / Class 2 / Keyword / IIC to RS-232 / USB 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
CAN - Controller Area Network data bus
SAINT
CAN / Class 2 / Keyword / IIC to RS-232 / USB
Gateway
2
02/23/06
Page 5 of 30
Overview
This document describes the operation of the CAN / Class 2 / Keyword / IIC to RS-232 / USB 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 CAN, Class 2, Keyword 82, Keyword 71, Keyword 2000, IIC,
GMLAN and IDB busses – for CAN based busses, presently would need to pick one CAN bus by proper dip
switch settings.
Performs timing, access, arbitration, serialization, and error control for all protocols.
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 or USB connection to host
SAINT
CAN / Class 2 / Keyword / IIC to RS-232 / USB
Gateway
3
02/23/06
Page 6 of 30
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, and slower CAN bus’s.
However, USB connection is recommended for high speed CAN (over TBD KHz) communications.
SAINT
CAN / Class 2 / Keyword / IIC to RS-232 / USB
Gateway
3.1
02/23/06
Page 7 of 30
Buffering and Flow Control
Whenever the gateway recieves 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
CAN / Class 2 / Keyword / IIC to RS-232 / USB
Gateway
4
02/23/06
Page 8 of 30
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 waiting 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
CAN / Class 2 / Keyword / IIC to RS-232 / USB
Gateway
4.2
02/23/06
Page 9 of 30
Messages IDs
Message IDs are one byte long and have the following general format:
Type (CAN, Keyword,
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 5 bits indicate the type of message. The following types are defined:
Not Used (00h)
*UART (80h)
Gateway (08h)
J1850 (88h)
Keyword 82 (10h)
BEAN1 (90h)
Keyword 71 (18h)
BEAN2 (98h)
IIC (20h)
DESIP (A0h)
*Keyword 2000 (28h)
Not Used (A8h)
IDB (30)
IE Bus (B0h)
ACP (38h)
LIN (B8h)
E&C (40h)
Not Used (C0h)
J1708 (48h)
Not Used (C8h)
CAN (50h)
Not Used (D0h)
*Reserved (58h)
Not Used (D8h)
Class2 (60h)
Not Used (E0h)
AOS (68h)
Not Used (E8h)
SPI (70h)
Not Used (F0h)
*Reserved (78h)
Extended ID (F8h)
* Note…Reserved for future use. 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
CAN / Class 2 / Keyword / IIC to RS-232 / USB
Gateway
4.3
4.3.1
02/23/06
Page 10 of 30
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
90h
1-N bytes
Send Periodic Message
08h
91h
None
End Periodic Message
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
Send Periodic Message
This command will transmit a periodic message determined by 2 bytes. See example below.
Example for sending a Class 2 periodic message: 08 90 TT TT 60 XX XX XX XX
Where TT is the periodic time in milliseconds (convert to hex) and XX is the C2 message
4.3.1.5
Software Version Request
This command requests the gateway software version (ASCII).
SAINT
CAN / Class 2 / Keyword / IIC to RS-232 / USB
Gateway
4.3.1.6
02/23/06
Page 11 of 30
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
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.
Heade
r
ID
Description
Data Bytes
08h
80h
Reset Occurred
None
08h
82h
Report Error
1 byte Error Code (See 4.3.2.1)
08h
86h
Report Time Stamp Information
OFF
None
08h
87h
Report Time Stamp Information ON
None
08h
88h
Report Transmit Echo ON
None
08h
89h
Report Transmit Echo OFF
None
08h
90h
Report Send Periodic Message ON
None
08h
91h
Report Send Periodic Message OFF
None
08h
92h
Report SWID
1-N bytes of ASCII Data
08h
F0
h
Report Gateway Trigger ON
1-12 bytes of Trigger Data
08h
F1
h
Report Gateway Trigger OFF
None
4.3.2.1 Gateway Error Codes
Cod
e
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
CAN / Class 2 / Keyword / IIC to RS-232 / USB
Gateway
85h
4.4
02/23/06
Page 12 of 30
System – Internal FRAM Buffer Full (not yet
implemented)
CAN Messages
4.4.1 CAN Commands
The following command(s) are reported by the SAINT:
Header
ID
Description
Data Bytes
54h
00h
CAN Error
CAN Completion Code (see 4.4.3.1)
The following is the format for sending a CAN Command:
Header
ID
Description
Data Bytes
54h
01h
Set CAN Frequency
BTR0 BTR1 (see 4.4.1.1)
54h
02h
Set Single Wire CAN Mode Control
MODE (see 4.4.1.2)
54h
03h
Enable/Disable CAN Error Reporting
00 = Enable Error Reporting (default)
01 = Disable Error Reporting
4.4.1.1 CAN Setup
By modifying BTR0 and BTR1, you can change the frequency, Synchronization Jump Width, Sampling point, and
the number of samples taken by the Intel 82527 CAN IC. (See INTEL 82527 Application Document for more
information on reccommended bit construction) The initial CAN baud rate can also be set using SW1-7 and SW1-8
in combination. Please see section 7.1 for details.
•
Synchronization Jump Width (SJW) = bit 6 – bit 7 of BTR0 (program actual value – 1)
•
Baud Rate Prescaler (BRP) = bit0 – bit5 of BTR0 (program actual value – 1)
•
Sampling = bit7 of BTR1 (0 = one sample, 1 = three samples)
•
TSEG2 = bit4 – bit6 of BTR1 (program actual value – 1)
•
TSEG1 = bit0 – bit3 of BTR1 (program actual value – 1)
•
Other Important Values: XTAL = 16 MHz and DSC (Divide System Clock) bit = 1
Frequency =
16M
2 * BRP * (1 + TSEG1 + TSEG2)
SAINT
CAN / Class 2 / Keyword / IIC to RS-232 / USB
Gateway
02/23/06
Page 13 of 30
Examples:
Message
Break Down
Description
54 01 8B 2F
SJW=3, BRP=12, TSEG1=16, TSEG2=3, S=1
Set Baud to 33,333
54 01 47 18
SJW=2, BRP=8, TSEG1=9, TSEG2=2, S=1
Set Baud to 83,333
54 01 C3 CE
SJW=4, BRP=4, TSEG1=15, TSEG2=5, S=3
Set Baud to 95,200
54 01 C4 3A
SJW=4, BRP=5, TSEG1=11, TSEG2 =4, S=1
Set Baud to 100,000
54 01 C3 3A
SJW=4, BRP=4, TSEG1=11, TSEG2=4, S=1
Set Baud to 125,000
54 01 C1 4D
SJW=4, BRP=2, TSEG1=14, TSEG2=5, S=1
Set Baud to 200,000
54 01 C1 3A
SJW=4, BRP=2, TSEG1=11, TSEG2=4, S=1
Set Baud to 250,000
54 01 C0 3A
SJW=4, BRP=1, TSEG=11, TSEG2=4, S=1
Set Baud to 500,000
4.4.1.2 Single Wire Mode Control
The following commands allow the user to control the NSTB (Mode 0) and EN (Mode 1) pins of the Single Wire
CAN transceiver (AU5790).
Message
Description
54 02 00
Sleep mode
54 02 01
High-speed transmission mode
54 02 02
Wake-up transmission mode
54 02 03
Normal transmission mode
Sleep Mode (54 02 00) - This mode is dedicated to minimizing ignition-off current drain. In sleep mode, the bus
transmit function is disabled. You must send the Normal transmission message (54 02 03) to start transmission
again.
High-speed transmission mode (54 02 01) - supports bit rates up to 100 kbps. When this mode is sent the internal
wave shaping function is disabled (the bus driver is turned on and off as fast as possible to support high-speed
transmission mode). In this mode the bus signal level is between 0V and 4V.
Wake-up transmission mode (54 02 02) - When this mode is sent the transceiver sends data with an increased
signal level (+12V). This will result in an activation of other bus nodes being attached to the network.
Normal transmission mode (54 02 03) - This is the normal transmission state with a bus signal level between 0V
and 4V.
SAINT
CAN / Class 2 / Keyword / IIC to RS-232 / USB
Gateway
4.4.2
02/23/06
Page 14 of 30
Transmitted CAN Messages
The following is the format for sending a 11-bit identifier CAN message:
Header
Identifier MSB
Identifier LSB
N Data Bytes
50h
Byte 1
(xxxx xxxxb)
Byte 2
Bytes 3 ⎯ (2+N)
The following is the format for sending a 29-bit identifier CAN message:
Header
Identifier High
Identifier Mid High
Identifier Mid Low
Identifier Low
N Data Bytes
50h
Byte 1
(1xxx xxxxb)
Byte 2
Byte 3
Byte 4
Bytes 5 ⎯ (4+N)
The minimum accepted CAN message length is 3 bytes and the longest is 10 bytes for an 11 bit identifier and 12
bytes for a 29 bit identifier (not including the Header byte.)
Note: For extended Identifiers, bit7 of Identifier High must be set.
4.4.3
Received CAN Messages
The following is the format of a received 11-bit identifier CAN message without time stamp information:
Header
Identifier MSB
Identifier LSB
N Data Bytes
Completion
Code
50h
Byte 1
Byte 2
Bytes 3 ⎯ (2+N)
Byte 3 + N
The following is the format of a received 11-bit identifer CAN message with time stamp information:
Header
Identifier MSB
Identifier
LSB
N Data Bytes
Completion
Code
Time
MSB
Time
LSB
51h
Byte 1
Byte 2
Bytes 3 ⎯ (2+N)
Byte 3 + N
4+N
5+N
The following is the format of a received 29-bit identifier CAN message without time stamp information:
Header
Identifier High
Identifier Mid High
Identifier Mid Low
Identifier Low
N Data Bytes
Completion Code
50h
Byte 1
(1xxx xxxxb)
Byte 2
Byte 3
Byte 4
Bytes 5 ⎯ (4+N)
Byte 5 + N
SAINT
CAN / Class 2 / Keyword / IIC to RS-232 / USB
Gateway
02/23/06
Page 15 of 30
Note: For extended Identifiers, bit7 of Identifier High will be set.
4.4.3.1
Completion Code
The following is the definition of the completion code included with all reported CAN messages. The completion
code in the received messages comes from the Intel 82527 chip. For more detail refer to the Intel 82527
Application Document .
Bit 7
0
1
Busoff Status
The IC is not in the bus off state (default).
There is an abnormal rate of errors on the CAN bus ( > 256). Transmit will be disabled until a reset occurs.
Bit 6
0
1
Warning Status
No abnormal rate of errors.
Abnormal rate of errors ( > 96)
Bit 5
Wakeup Status (N/A)
Bit 4
0
1
Rx OK
No Message received since cleared
Message successfully received since cleared
Bit 3
0
1
Tx OK
No Message transmitted since cleared
Message successfully transmitted since cleared
Bit 2
0
0
0
0
1
1
1
1
Bit 1
0
0
1
1
0
0
1
1
Bit0
0
1
0
1
0
1
0
1
Last Error Code
(No Error)
(Stuff Err) More than 5 same bits received in sequence without complement
(Form Err) Part of received message has wrong format.
(Ack Err) Transmitted message not acked.
(Bit1 Err) During transmit a recessive bit desired but monitored dominant bit.
(Bit0 Err) During transmit a dominant bit desired but monitored recessive bit.
(CRC Err) Received CRC did not match calculated.
(Unused)
SAINT
CAN / Class 2 / Keyword / IIC to RS-232 / USB
Gateway
4.5
02/23/06
Page 16 of 30
Class 2 Messages
The following messages may be used to send a Class 2 commands and messages. Class 2 commands are used for
configuring or commanding the DLC. Class 2 messages include functional, physical, and block messages. Note:
the ESCAPE characters (section 4.1) must be instered at the end of every transmitted message to the SAINT.
4.5.1
Class 2 Commands
The following is the format for sending a Class 2 Command:
Header
ID
Description
Data Bytes
64h
01h
Report Error
1 byte Completion Code (See 4.5.3)
64h
64h
Operate Bus at Normal Speed (10.4 KB/s) (default)
None
64h
65h
Operate Bus at High Speed (41.6 KB/s)
None
64h
66h
Generate a Class 2 Break Signal
None
4.5.2
Transmitted Class 2 Messages
The following is the format for sending a Class 2 message:
60h
Priority/Header
Target
Source
ID
N Data Bytes
Byte 1
Byte 2
Byte 3
Byte 4
Byte 5
Bytes 6 ⎯ (5+N)
The minimum accepted Class 2 message length is 3 bytes and the longest is 8000 bytes.
4.5.3
Received Class 2 Messages
The following is the format of a received Class 2 message without time stamp information:
60h
Priority
Header
Target
Source
ID
N Data Bytes
Completion
Code
Byte 1
Byte 2
Byte 3
Byte 4
Byte 5
Bytes 6 ⎯ (5+N)
Byte 6 + N
The following is the format of a received Class 2 message with time stamp information:
61h
Priority
Header
Target
Source
ID
N Data Bytes
Completion
Code
Time
MSB
Time
LSB
Byte 1
Byte 2
Byte 3
Byte 4
Byte 5
Bytes 6 ⎯ (5+N)
Byte 6 + N
7+N
8+N
SAINT
CAN / Class 2 / Keyword / IIC to RS-232 / USB
Gateway
02/23/06
Page 17 of 30
The following is the format of a received Class 2 Error message with time stamp information:
4.5.3.1
65h
01
Completion
Code
Time
MSB
Time
LSB
Byte 1
Byte 2
Byte 3
Byte 4
Byte 5
Completion Code
The following is the definition of the completion code included with all reported Class 2 messages. The completion
code in the received messages comes from the DLC chip. For more detail refer to the DLC Application document
(XDE 3003.)
Bit 7
Errors in Received Message
0
No Error Detected.
1
Error(s) detected. When set, certain errors occurred in the reception of this message (see description for
bits 1 and 0). If not set, then bits 1 and 0 are also 0.
Bit 6
0
1
RFIFO Overrun
No overrun.
A receiver FIFO overrun was detected and data was lost.
Bit 5
0
0
Bit 4
0
1
1
1
0
1
Bit 3
0
1
In-frame response
This message was not an in-frame response.
This message was an in-frame response.
Bit 2
0
1
In-frame response with/without CRC
This in-frame response does not contain a CRC.
This in-frame response contains a CRC.
Bit 1
0
0
1
1
Bit 0
0
1
0
1
4.5.3.2
Transmitter Action
Transmitter not involved.
Transmitter under run. Should occur only when sending a Class 2 block message and the host
does not keep up with the data requirements.
Transmitter lost arbitration on this message.
Transmit successful.
Error Code
CRC error.
Incomplete byte received.
Bit timing error.
Break symbol received.
Block Message Support
Please note the following differences when using Class2 firmware 3.0 or later. Firmware 3.0 and later has the
support for Block messages. Therefore, the decoding for Rx/Tx (bit1 in header byte) is no longer valid in the
header byte. It is recommended to use the Completion Code to check if the message was transmitted (30h) or
SAINT
CAN / Class 2 / Keyword / IIC to RS-232 / USB
Gateway
02/23/06
Page 18 of 30
received (00h). Also, note that “Echo Off” command (08 89) is not supported. So, all transmitted Class2 messages
are received. The changes are due to the fact that the SAINT cannot determine if the incoming message was
transmitted or received until completely receiving the entire message.
4.6
IIC Messages
IIC messages are receviced directly by the microporcessor on the SAINT board. No transmit capability is planned
at this stage.
Note: At this time the IIC lines are not brought out to the Bus and Power connector. The clock line is RB3 on J5
and the data line is RB2 on J5.
4.6.1
IIC Monitor Commands
The following command may be used to begin monitoring IIC traffic.
Header
ID
Description
Data Bytes
24h
01h
Begin IIC Monitor Mode
ADDR1 ADDR2 ADDR3
4.6.1.1 IIC Monitor Mode
This Command will cause the gateway to begin monitoring all IIC messages with the specified addresses (ADDR1 –
ADDR3). If all zero’s are used in the address field, then the gateway will monitor all IIC traffic. Note: The only
way to exit monitor mode or change the address filter is a gateway reset.
4.6.2.
Received Messages
The following is the format of a received IIC message without time stamp information:
20h
N Data Bytes
Byte1
Bytes 2 ⎯ (1+N)
The following is the format of a received IIC message with time stamp information:
21h
N Data Bytes
Time
MSB
Time
LSB
Byte1
Bytes 2 ⎯ (1+N)
2+N
3+N
SAINT
CAN / Class 2 / Keyword / IIC to RS-232 / USB
Gateway
4.7
02/23/06
Page 19 of 30
Keyword 82 Messages
4.7.1
Keyword 82 Commands
The following Keyword 82 commands may be used.
Header
ID
Description
Data Bytes
14h
00h
Send Response Once (Default)
None
14h
01h
Send Response Continuously
None
14h
02h
Enter Diagnostic Mode
Addr Key1 Key2 BDM BDL
14h
03h
Enter Monitor Mode
None
4.7.1.1 Send Response Once (default)
This command will cause the gateway to only send one response per request.
4.7.1.2 Send Response Continuously
This command will cause the gateway to send a requested message continuously.
4.7.1.3 Enter Diagnostic Mode
This command will cause the gateway to initiate an “Enter Diagnostic Mode” request on the Keyword 82 bus.
Addr
Module Address
Key1
Key Byte One
Key2
Key Byte Two
BD
Initialization Baud Rate Divider ( Init Baud = 9600 / BD)
ex. 14 02 D2 52 80 07 80 = Initiate Diagnostic mode at address D2, Keybyte1 = 52, Keybyte2 = 80, and
baud rate divider = 07 80.
Note: For an initialization baud rate of 5, the Baud Divider will always be 07 80.
4.7.1.4 Enter Monitor Mode
This command will cause the gateway to begin monitoring Keyword messages without going through the diagnostic
process.
SAINT
CAN / Class 2 / Keyword / IIC to RS-232 / USB
Gateway
4.7.2
02/23/06
Page 20 of 30
Transmitted Keyword 82 Messages
The following is the format for sending a Keyword 82 message:
10h
Length Byte
Block Title
N Data Bytes
Byte 1
Byte 2
Byte 3
Bytes 4 ⎯ N
The minimum accepted Keyword message length is 3 bytes and the longest is 48 bytes,
4.7.3
Received Keyword 82 Messages
The following is the format of a received Keyword 82 message without time stamp information:
10h
Length Byte
Block Title
N Data Bytes
Byte 1
Byte 2
Byte 3
Bytes 4 ⎯ N
The following is the format of a received Keyword 82 message with time stamp information:
10h
Length Byte
Block Title
N Data Bytes
Time
MSB
Time
LSB
Byte 1
Byte 2
Byte 3
Bytes 4 ⎯ (3+N)
4+N
5+N
There is no maximum receive Keyword length.
SAINT
CAN / Class 2 / Keyword / IIC to RS-232 / USB
Gateway
4.8
02/23/06
Page 21 of 30
Keyword 71 Messages
4.8.1
Keyword 71 Commands
The following Keyword 71 commands may be used.
Header
ID
Description
Data Bytes
1Ch
00h
Send Response Once (Default)
None
1Ch
01h
Send Response Continuously
None
1Ch
02h
Enter Diagnostic Mode
Addr Key1 Key2 BDM BDL
1Ch
03h
Enter Monitor Mode*
None
* Please note that once an error occurs, the user must send the command again to resume monitoring.
4.8.1.1 Send Response Once (default)
This command will cause the gateway to only send one response per request.
4.8.1.2 Send Response Continuously
This command will cause the gateway to send a requested message continuously.
4.8.1.3 Enter Diagnostic Mode
This command will cause the gateway to initiate an “Enter Diagnostic Mode” request on the Keyword 71 bus.
Addr
Module Address
Key1
Key Byte One
Key2
Key Byte Two
BD
Initialization Baud Rate Divider ( Init Baud = 10400 / BD)
ex. 1C 02 7C 01 8A 08 20 = Initiate Diagnostic mode at address 7C, Keybyte1 = 01, Keybyte2 = 8A, and
baud rate divider = 08 20.
Note: For an initialization baud rate of 5, the Baud Divider will always be 0820.
SAINT
CAN / Class 2 / Keyword / IIC to RS-232 / USB
Gateway
4.8.2
02/23/06
Page 22 of 30
Transmitted/Received Keyword 71 Messages
The following is the format for sending/receiving a Keyword 71 message:
18h
Block Length
Block Counter
Block Title
N Data Bytes
Block End (03h)
Byte 1
Byte 2
Byte 3
Byte 4
Bytes 5 ⎯ (4 + N)
Byte (5 + N)
Each of these bytes will be discussed in the following sections.
4.8.2.1 Byte 1 - Header Byte
The header byte for Keyword 71 messages is $18.
4.8.2.2 Byte 2 - Block Length
The hexadecimal number of bytes to follow. This includes the Block Counter, Block Title, Data, and Block End.
The maximum block length is $0F.
4.8.2.3 Byte 3 - Block Counter
The block counter is increased by one with each block, independent of transmission direction and content. The first
block which is sent via the k-wire receives the number $01 - block $FF is followed by block $00.
Block 1: $01
Block 2: $02…etc.
As the subsequent blocks are transmitted, the “Block Counter” is incremented one for each of the subsequent
blocks, it is a running counter.
4.8.2.4 Byte 4 - Block Title
$1B user defined application.
$2B log in request…etc.
4.8.2.5 Byte 5 ... Byte (4 + N)
Data Bytes
4.8.2.6 Byte (5 + N)
Block End: $03
SAINT
CAN / Class 2 / Keyword / IIC to RS-232 / USB
Gateway
4.8.3
02/23/06
Page 23 of 30
Keyword 71 Error Messages
The following error messages are reported by the SAINT (without time stamp information):
4.9
Header
Data Byte1
Data Byte2
Description
18h
00h
01h
Keyword Time Out Error
18h
00h
03h
No Synch On Init Error
18h
00h
04h
Compliment Error
IDB Messages
At this time the SAINT board only handles the IDB Link Layer (J2366-2). It is up to the PC program to handle the
Thin Transport Layer and the Application Layer. However, the Link Layer is all that is needed to connect to the bus
and receive and transmit IDB messages.
Limitations:
• PMODE Line is not currently handled (will be handled in future versions)
• Only one frame transmition per token
• Retries are currently performed by CAN IC (if too many retries occur, the token hold time can be exceeded)
Note: Switches 3 and 4 of SW1 should be on to select the High Speed CAN transceiver. Also, one node on the IDB
bus will need a terminating resister (J7).
4.9.1 IDB Commands
The following IDB commands may be used.
Header
ID
Description
Data Bytes
34h
01h
Connect to IDB Bus
Addr (optional)
34h
02h
Disconnect from IDB Bus
None
34h
03h
Request Connection Status
None
34h
04h
Enter Monitor Mode
None
4.9.1.1 Connect to IDB Bus
This command will cause the gateway to connect to the IDB bus. If the optional address byte is included, then the
gateway will attempt to connect at this address.
4.9.1.2 Disconnect from IDB Bus
This command will cause the gateway to disconnect from the IDB bus.
SAINT
CAN / Class 2 / Keyword / IIC to RS-232 / USB
Gateway
02/23/06
Page 24 of 30
4.9.1.3 Request Connection Status
(Not Yet Implemented)
4.9.1.4 Enter Monitor Mode
This command will allow the user to monitor IDB traffic without connecting to the bus. Note: You can not transmit
in this mode.
4.9.2
Transmitted IDB Messages
The following is the format for sending an IDB message. Refer to “SAE J2366” for format of IDB Header.
30h
IDB Header
N Data Bytes
Byte 1
Bytes 2 – 5
Bytes 6 ⎯ N
The minimum accepted IDB message length is 5 bytes and the longest is 12 bytes.
4.9.3
Received IDB Messages
The following is the format of a received IDB message without time stamp information:
30h
IDB Header
N Data Bytes
Byte 1
Bytes 2 – 5
Bytes 6 ⎯ N
The following is the format of a received IDB message with time stamp information:
30h
IDB Header
N Data Bytes
Time
MSB
Time
LSB
Byte 1
Bytes 2 - 5
Bytes 6 ⎯ (5+N)
6+N
7+N
The longest IDB message is 12 bytes (14 with TS).
SAINT
CAN / Class 2 / Keyword / IIC to RS-232 / USB
Gateway
5
02/23/06
Page 25 of 30
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 (J4-DB9M)
The SAINT boards Class 2, Power, and Ground pins are compatible with the Demon.
5.3
DE-9p Pin #
Use
1
Ground
2
SW CAN H
3
LS CAN L
4
LS CAN H
5
HS CAN H
6
HS CAN L
7
Class 2
8
Keyword
9
12 volt
Flash programming connector
Note: the long term goal is to Flash using the USB connector.
SAINT
CAN / Class 2 / Keyword / IIC to RS-232 / USB
Gateway
02/23/06
Page 26 of 30
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.
Osc1
External (to SAINT) oscillator
Osc2
External (to SAINT) oscillator
Vdd
Already connected to +5V on
SAINT board
Vss
Already grounded
SAINT
CAN / Class 2 / Keyword / IIC to RS-232 / USB
Gateway
6
02/23/06
Page 27 of 30
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 Class 2, CAN, IIC, or Keyword message)
SAINT
CAN / Class 2 / Keyword / IIC to RS-232 / USB
Gateway
7
7.1
02/23/06
Page 28 of 30
Switches
SW1 Transceiver Switches:
The following is a summary of the dip switches – it is used for choosing the appropriate CAN transceiver.
SWITCH #
Mnemonic
Purpose
1
LSR (Low Speed
Receive)
RXD
2
LST (Low Speed
Transmit)
TXD
3
HSR (High Speed
Receive)
RxD– Philips 82C250 transceiver
4
HST (High Speed
Transmit)
TxD – Philips 82C250 transceiver
5
SR (Single wire
Receive)
RxD – AU5790 chip
6
ST (Single wire
Transmit)
TxD – AU5790 chip
7
NC
Used to determine initial CAN baud rate (see table below)
8
NC
Used to determine initial CAN baud rate (see table below)
Note: Only one CAN protocol bus could be active at a time. Only close the switches for the bus that is being
currently used and leave the rest of the switches open.
7.2
SW1-7
SW1-8
CAN BAUD
OFF
OFF
33KHz
OFF
ON
100KHz
ON
OFF
125KHz
ON
ON
500KHz
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
CAN / Class 2 / Keyword / IIC to RS-232 / USB
Gateway
8
8.1
02/23/06
Page 29 of 30
Electrical Specifications
SAINT Power Requirements
Rating
Symbol
Min
Max
Units
Supply Voltage (input voltage)
Vcc
+12
+16
V
Supply Current
Icc
500
1000
mA
(All values are with respect to ground unless otherwise noted)
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