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

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

Скачать:  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,
or On Board Diagnostics, port for the connection of
test equipment. Data is transferred serially between
the vehicle and the external equipment using these
connections, in a manner specified by the Society of
Automotive Engineers (SAE). These are serial
connections, but as the voltage levels and the
protocols differ, computer serial ports cannot be
directly used to communicate with vehicles.
The ELM323 is a 14 pin integrated circuit that,
with only a few external components, is able to
interface to the OBD port, interpreting the data
signals and reformatting them as standard ASCII
characters. 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 create their own
custom `scan tool' by adding an interface program.
This integrated circuit was designed to provide a
cost-effective way for experimenters to work with an
OBD system, so many features such as RS232
handshaking, variable baud rates, etc., have not
been implemented. Additionally, this device is only
able to communicate using the 10.4KHz ISO 9141
protocol that is commonly used by Daimler Chrysler,
and many `world built' vehicles.
Low power CMOS design
Crystal controlled for accuracy
Configurable with AT commands
Standard ASCII character output
Four high current LED drive outputs
10.4KHz ISO 9141 Protocol
Diagnostic Trouble Code Readers
Automotive Scan Tools
Description
Applications
Block Diagram
1 of 11
Features
ELM323DSB
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
7
RSRx
OBDTx
10
OBDRx
9
RSTx
8
3.58MHz
RS232
Interface
ELM323
Elm Electronics Circuits for the Hobbyist
< http://www.elmelectronics.com/ >
Pin Descriptions
2 of 11
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.579545MHz NTSC television colourburst crystal
is connected between these two pins. Crystal
loading capacitors (typically 27pF) will also normally
be connected between each of the pins and the
circuit common (Vss).
LFmode (pin 4)
This input is used to select the default linefeed mode
after a powerup or system reset. If it is at a high
level, then by default lines 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 ATL0 or ATL1
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 input currents 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 Application section for more
details.
V
SS
(pin 14)
Circuit common is connected to this pin. This is the
most negative point in the circuit.
ELM323DSB
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 11
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).
ELM323DSB
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
AT Commands
The ELM323 accepts internal configuration
commands in much the same manner that modems
do. Any message received at any time, that begins
with the character `A' followed by the character `T' will
be considered an internal configuration or `AT'
command. These are executed upon receipt of the
terminating carriage return character, and completion
of the command is acknowledged by the printing of the
characters `OK'.
4 of 11
ELM323
ELM323DSB
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 line feed 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 v1.1
>
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 10 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).
Communications on the OBD bus can generally
begin without requiring the use of any AT commands,
as the factory default settings should be appropriate
for most applications. Occasionally the user may wish
to customize settings though, such as turning the
character echo off. In these cases, AT commands
must be issued.
To perform the desired function simply send AT
followed by the appropriate characters. For example,
5 of 11
ELM323
ELM323DSB
Elm Electronics Circuits for the Hobbyist
< http://www.elmelectronics.com/ >
Remember that they are not case sensitive, they can
have spaces or tab characters embedded as you wish,
and that for the on/off type commands, the `0'
character is the number zero:
Bus Initiation
Both the ISO 9141 and ISO 14230 (KWP2000)
standards require that the vehicle's bus be initialized
before any communications can take place. ISO 9141
allows for only a slow (2 to 3 second) process while
ISO 14230 allows for the slow method, as well as a
faster alternative. In either case, once the bus has
been initiated, communications must take place at
least once every five seconds, to keep the bus `alive'.
The ELM323 takes care of this bus initiation and
the periodic sending of messages for you it is
automatic and requires no input from the user. The
ELM323 will not initiate the bus until the first message
needs to be sent however, by first attempting the slow
method, and if that fails then trying the fast. During the
to turn character echoing off, simply send ATE0
followed by a return character. To turn it back on, send
ATE1.
The following is a summary of the commands that
are recognized by the current version of the ELM323.
AT Commands (continued)
D
[ set all to Defaults ]
This command is used to reset the E, H and L
options to their default (or factory) settings. This is
equivalent to issuing an ATE1, an ATH0, and also an
ATL1 or ATL0. (The level at LFmode is read
whenever this command is issued, and L is set
appropriately).
E0 and E1
[ Echo off(0) or on(1) ]
These commands control whether or not characters
received on the RS232 port are retransmitted (or
echoed) back to the host computer. To reduce traffic
on the RS232 bus, users may wish to turn echoing
off by issuing ATE0. Default is E1 (echo on).
FI
[ perform a Fast Initiation ]
When this command is received, the ELM323 will
begin a Fast Initiation sequence as described by the
ISO14230 standards. Normally this would be
attempted if the slow 5 baud sequence fails, but this
provides a means to manually initiate the sequence.
H0 and H1
[ Headers off(0) or on(1) ]
These strings control whether or not the header
information is shown in the responses. All OBD
messages have an initial (header) string of three
bytes and a trailing check digit that is normally not
displayed by the ELM323. To see this extra
information, users can turn the headers on by
issuing an ATH1. The default is H0 (headers off).
I
[ Identify yourself ]
Issuing this command causes the chip to identify
itself, by printing the startup product ID string (this is
currently `ELM 323 v1.1'). Software can use this to
determine exactly which integrated circuit it is talking
to, without resorting to resetting the entire IC.
L0 and L1
[ Linefeeds off(0) or on(1) ]
The transmitting of a linefeed character following
every carriage return character is controlled by this
option. If an ATL1 is issued, linefeed generation will
be turned on, and for ATL0, it will be off. Users may
wish to have this option on if using a terminal
program, but off if using a custom interface (as the
extra characters transmitted will only serve to slow
the vehicle polling down). The default setting is
determined by the logic level at the LFmode pin on
powerup or reset: if it is a `1' or high level, then the
default is L1, otherwise it is L0.
Z
[ reset all ]
This combination causes the chip to perform a
complete reset as if power were cycled off and then
on again. All settings are returned to their default
values, and the chip will be put in the idle state,
waiting for characters to arrive on the RS232 bus.