ChipFind - документация

Электронный компонент: ELM323DS

Скачать:  PDF   ZIP
ELM323
Elm Electronics Circuits for the Hobbyist
< http://www.elmelectronics.com/ >
OBD (ISO) to RS232 Interpreter
Since the 1996 model year, North American
automobiles have been required to provide an OBD
(On Board Diagnostics) data port for the connection
of test equipment. This port is used to obtain
emissions-related diagnostics information, and in
some cases can also be used to obtain real-time
vehicle operating parameters.
The ELM323 is a 14 pin integrated circuit that,
with only a few external components, is able to
convert between the OBD data format and the
standard RS232 serial data format. This allows
virtually any personal computer or PDA to
communicate with a vehicle using only a standard
serial port and a terminal program. If desired,
hobbyists can even create their own custom `scan
tool' by adding an interface program.
Please note that while this integrated circuit has
undergone significant changes recently, it is still
considered to be an experimenter's circuit. It does
support a great many of the ISO9141 and ISO14230
(KWP2000) protocol vehicles, but not all of them,
due to the many interpretations of these standards
that are to be found in use.
Low power CMOS design
Crystal controlled for accuracy
ISO 9141-2 and ISO 14230-4 protocols
Configurable with AT commands
Standard ASCII character output
Four high current LED drive outputs
Diagnostic trouble code readers
Automotive scan tools
Teaching aids
Description
Applications
Block Diagram
1 of 19
Features
ELM323DSC
Connection Diagram
PDIP and SOIC
(top view)
V
DD
V
SS
OBDK
LFmode
XT1
XT2
OBDIn
OBDTx
RSRx
OBDRx
1
2
3
14
13
12
11
4
5
6
10
9
8
7
RS232Tx
OBDL
RSTx
RS232Rx
2
3
XT1
XT2
5
6
Timing and
Control
Interpreter
OBD
Interface
OBDK
11
13
OBDIn
4
OBDL
12
RS232Tx
RS232Rx
LFmode
OBDTx
10
OBDRx
9
3.58 MHz
RS232
Interface
7
RSRx
RSTx
8
ELM323
Elm Electronics Circuits for the Hobbyist
< http://www.elmelectronics.com/ >
Pin Descriptions
2 of 19
All rights reserved. Copyright 2001, 2003 Elm Electronics.
Every effort is made to verify the accuracy of information provided in this document, but no representation or warranty can be
given and no liability assumed by Elm Electronics with respect to the accuracy and/or use of any products or information
described in this document. Elm Electronics will not be responsible for any patent infringements arising from the use of these
products or information, and does not authorize or warrant the use of any Elm Electronics product in life support devices and/or
systems. Elm Electronics reserves the right to make changes to the device(s) described in this document in order to improve
reliability, function, or design.
V
DD
(pin 1)
This pin is the positive supply pin, and should always
be the most positive point in the circuit. Internal
circuitry connected to this pin is used to provide
power on reset of the microprocessor, so an external
reset signal is not required. Refer to the Electrical
Characteristics section for further information.
XT1 (pin 2) and XT2 (pin 3)
A 3.579545 MHz NTSC television colourburst crystal
is connected between these two pins. Crystal
loading capacitors (typically 27pF) will also normally
be connected between each of these pins and the
circuit common (Vss).
LFmode (pin 4)
This input is used to select the default linefeed mode
after a power-up or system reset. If it is at a high
level, then by default messages sent by the ELM323
will be terminated with both a carriage return and a
linefeed character. If it is at a low level, lines will be
terminated by a carriage return only. This behavior
can always be modified by issuing AT L0 or AT L1
commands (see the section on AT Commands).
RS232Rx (pin5)
A computer's RS232 transmit signal can be directly
connected to this pin from the RS232 line as long as
a current limiting resistor (typically about 47K
) is
installed in series. (Internal protection diodes will
pass the resistor current safely to the supply
connections, protecting the ELM323.) Internal signal
inversion and Schmitt trigger waveshaping provide
the necessary signal conditioning.
RS232Tx (pin 6)
This is the RS232 transmit or data output pin. The
signal level is compatible with most interface ICs,
and there is sufficient current drive to allow
interfacing using only a PNP transistor, if desired.
LED Drive Outputs (pins 7, 8, 9, and 10)
These four pins are driven to low levels when the
ELM323 is transmitting or receiving RS232 or OBD
data. Otherwise, they are at a high level. Current
capability is suitable for directly driving most LEDs
through current limiting resistors. If unused, these
pins should be left open-circuited.
OBDIn (pin11)
The OBD data is input to this pin, with a high logic
level representing the active state of the OBD K line.
No Schmitt trigger input is provided, so the OBD
signal should be buffered to minimize transition
times for the internal CMOS circuitry.
OBDL (pin 12) and OBDK (pin 13)
These are the active high output signals which are
used to drive the OBD bus, using external NPN
transistors. Data transfer normally occurs only by the
K line, but the standards require that the L line be
implemented as well in order to properly initialize the
bus. See the Example Applications section for more
details.
V
SS
(pin 14)
Circuit common is connected to this pin. This is the
most negative point in the circuit.
ELM323DSC
Ordering Information
These integrated circuits are available in either the 300 mil plastic DIP format, or in the 150 mil SOIC surface mount
type of package. To order, add the appropriate suffix to the part number:
300 mil Plastic DIP...................................ELM323P
150 mil SOIC........................................ ELM323SM
Elm Electronics Circuits for the Hobbyist
< http://www.elmelectronics.com/ >
ELM323
Electrical Characteristics
Absolute Maximum Ratings
Storage Temperature....................... -65C to +150C
Ambient Temperature with
Power Applied....................................-40C to +85C
Voltage on V
DD
with respect to V
SS
............ 0 to +7.0V
Voltage on any other pin with
respect to V
SS
........................... -0.6V to (V
DD
+ 0.6V)
Note:
Stresses beyond those listed here will likely damage
the device. These values are given as a design
guideline only. The ability to operate to these levels
is neither inferred nor recommended.
3 of 19
Notes:
1. This integrated circuit is produced with a Microchip Technology Inc.'s PIC16C505 as the core embedded
microcontroller. For further device specifications, and possibly clarification of those given, please refer to the
appropriate Microchip documentation (available at http://www.microchip.com/).
2. This spec must be met in order to ensure that a correct power on reset occurs. It is quite easily achieved
using most common types of supplies, but may be violated if one uses a slowly varying supply voltage, as
may be obtained through direct connection to solar cells, or some charge pump circuits.
3. Device only. Does not include any load currents.
4. This specification represents the current flowing through the protection diodes when applying large voltages
to the RS232Rx input (pin 5) through a current limiting resistance. Currents quoted are the maximum that
should be allowed to flow continuously.
5. Nominal data transfer rate when the recommended 3.58 MHz crystal is used as the frequency reference.
Data is transferred to and from the ELM323 with 8 data bits, no parity, and 1 stop bit (8 N 1).
ELM323DSC
All values are for operation at 25C and a 5V supply, unless otherwise noted. For further information, refer to note 1 below.
Characteristic
Minimum
Typical
Maximum
Conditions
Units
Supply voltage, V
DD
4.5
5.0
5.5
V
V
DD
rate of rise
0.05
V/ms
Average supply current, I
DD
1.0
2.4
mA
Input low voltage
V
SS
0.15 x V
DD
V
Input high voltage
V
DD
V
0.85 x V
DD
Output low voltage
0.6
V
Output high voltage
V
V
DD
- 0.7
Current (sink) = 8.7mA
Current (source) = 5.4mA
see note 2
RS232Rx pin input current
mA
see note 4
-0.5
RS232 baud rate
baud
see note 5
9600
+0.5
see note 3
4 of 19
ELM323
ELM323DSC
Elm Electronics Circuits for the Hobbyist
< http://www.elmelectronics.com/ >
Communicating with the ELM323
The ELM323 relies on a standard RS232 type
serial connection to communicate with the user. The
data rate is fixed at 9600 baud, with 8 data bits, no
parity bit, 1 stop bit, and no handshaking (often
referred to as 9600 8N1). All responses from the IC
are terminated with a single carriage return character
and, optionally, a linefeed character. Make sure your
software is configured properly for the mode you have
chosen.
Properly connected and powered, the ELM323 will
energize the four LED outputs in sequence (as a `lamp
test') and will then send the message:
ELM323 v2.0
>
In addition to identifying the version of this IC,
receiving this string is a good way to confirm that the
computer connections and terminal software settings
are correct. However, at this point no communications
have taken place with the vehicle, so the state of that
connection is still unknown.
The `>' character displayed above is the ELM323's
prompt character. It indicates that the device is in its
idle state, ready to receive characters on the RS232
port. Messages sent from the computer can either be
intended for the ELM323's internal use, or for
reformatting and passing on to the OBD bus.
The ELM323 can quickly determine where the
received characters are to be directed by analyzing the
entire string once the complete message has been
received. Commands for the ELM323's internal use
will always begin with the characters `AT' (as is
common with modems), while commands for the OBD
bus are only allowed to contain the ASCII codes for
hexadecimal digits (0 to 9 and A to F).
Whether an `AT' type internal command or a hex
string for the OBD bus, all messages to the ELM323
must be terminated with a carriage return character
(hex `0D') before it will be acted upon. The one
exception is when an incomplete string is sent and no
carriage return appears. In this case, an internal timer
will automatically abort the incomplete message after
about 15 seconds, and the ELM323 will print a single
question mark (`?') to show that the input was not
understood (and was not acted upon).
Messages that are not understood by the ELM323
(syntax errors) will always be signalled by a single
question mark. These include incomplete messages,
incorrect AT commands, or invalid hexadecimal digit
strings, but are not an indication of whether or not the
message was understood by the vehicle. One must
keep in mind that the ELM323 is a protocol interpreter
that makes no attempt to assess the OBD messages
for validity it only ensures that an even number of
hex digits were received, combined into bytes, and
sent out the OBD port, and it does not know if the
message sent to the vehicle is in error.
Incomplete or misunderstood messages can also
occur if the controlling computer attempts to write to
the ELM323 before it is ready to accept the next
command (as there are no handshaking signals to
control the data flow). To avoid a data overrun, users
should always wait for the prompt character (`>')
before issuing the next command.
Finally, there are a few convenience items to note.
The ELM323 is not case-sensitive, so `ATZ' is
equivalent to `atz', and to `AtZ'. Also, it ignores space
characters and all control characters (tab, linefeed,
etc.) in the input, so they can be inserted anywhere to
improve readability. Another feature is that sending
only a single carriage return character will always
repeat the last command (making it easier to request
updates on dynamic data such as engine rpm).
Overview
The following describes how to use the ELM323 to
obtain a great deal of information from your vehicle. To
some, the following information will be overwhelming,
and for others it will not be nearly enough.
We begin by discussing just how to talk to the IC
using a PC, then go on to explain how to change
options using `AT' commands, and finally go on to
actually use the ELM323 to obtain trouble codes (and
reset them). For the more advanced experimenters,
there are also sections on how to use some of the
programmable features of this product as well.
Using the ELM323 is not as daunting as it first
seems. Many users will never need to issue an `AT'
command, adjust timeouts or change the headers. For
most, all that is required is a PC or a PDA with a
terminal program (such as HyperTerminal or ZTerm),
and knowledge of one or two OBD commands, which
we provide in the following...
5 of 19
ELM323
ELM323DSC
Elm Electronics Circuits for the Hobbyist
< http://www.elmelectronics.com/ >
AT Commands
AR
[ Automatically set the Receive address ]
Responses from the vehicle will be acknowledged
and displayed by the ELM323, if its internally stored
receive address matches the address that the
message is being sent to. With the Auto Receive mode
in effect, the value used for the receive address will be
chosen based on the current header bytes, and will
automatically be updated whenever the header bytes
are changed.
The value that is used for the receive address is
determined based on several factors. If the IC is
connected to a KWP2000 (ISO14230) system, the
third byte of the header will always be used as the
receive address. If the IC is connected to an ISO9141
system, the receive address will depend on the
contents of the first header byte. If the first byte shows
that the message uses physical addressing, the third
byte of the header will be used for the address,
otherwise (for functional addressing) the second
header byte, increased in value by 1, will be used.
Auto Receive is turned on by default.
BD
[ OBD receive Buffer Dump ]
There may be times when a bus initialization is not
successful, or perhaps the OBDRx LED flickers but
nothing is sent on the RS232 connection. In these
cases, it may be an advantage to see just what was
Several parameters within the ELM323 can be
adjusted in order to modify its behaviour. These do not
normally have to be changed before attempting to talk
to the vehicle, but occasionally the user may wish to
customize the settings; for example by turning the
character echo off, adjusting a timeout value, or
changing the header bytes. In order to do this, internal
`AT' commands must be issued.
Those familiar with PC modems will immediately
recognize AT commands as a standard way in which
modems are internally configured. The ELM323 uses
essentially the same method, always watching the
data sent by the PC, looking for messages that begin
with the character `A' followed by the character `T'. If
found, the next characters will be interpreted as
internal configuration or `AT' commands, and will be
executed upon receipt of a terminating carriage return
character. The ELM323 will usually reply with the
characters `OK' on the successful completion of a
command, so the user knows that it has been
executed.
Some of the following commands allow passing
numbers as arguments in order to set the internal
values. These will always be hexadecimal numbers
which must be provided in pairs. The hexadecimal
conversion chart in the OBD Commands section may
prove useful if you wish to interpret the values. Also,
one should be aware that for the on/off types of
commands, the second character is a number (1 or 0),
the universal terms for on and off respectively.
The following is a summary of all of the AT
commands that are recognized by the current version
of the ELM323, listed alphabetically. Users of previous
versions of this product (v1.x) should note that their
ICs will not support all of the functions shown.
received on the OBD connection. This command
shows the entire OBD buffer contents as a length byte
followed by 11 data bytes. Since not all of the data
bytes are likely to be relevant, be sure to check the
value contained in the length byte before interpreting
the data. The format of the data returned by this
command will follow the data mode in effect at the time
(Packed Data or Formatted Data) so you may want to
adjust that before viewing the data.
D
[ set all to Defaults ]
This command is used to set all of the options to
their default or `factory' settings, as listed in these
pages. This lets you experiment with different settings,
but be able to quickly restore them all to the original
settings using only one command.
To summarize the changes, E will be on, H will be
off, and L will be set according to the level at pin 4.
The Auto Receive mode (AR) will be selected, data will
be transmitted in the standard formatted way (as if
chosen by FD), and both the `NO DATA' timeout and
the period between bus idle (wakeup) messages will
be reset to their default values. As well, the header
bytes will be set to the prescribed values for OBDII
operation, and the receive address will be adjusted
accordingly. If the bus had been initiated, it will remain
active.