English
Language : 

ELM327_10 Datasheet, PDF (23/76 Pages) ELM Electronics – OBD to RS232 Interpreter
ELM327
AT Command Descriptions (continued)
SH xyz
[ Set the Header to 00 0x yz ]
Entering CAN 11 bit ID words (headers) normally
requires that extra leading zeros be added (eg. AT SH
00 07 DF), but this command simplifies doing so. The
AT SH xyz command accepts a three digit argument,
takes only the right-most 11 bits from that, adds
leading zeros, and stores the result in the header
storage locations for you. As an example, AT SH 7DF
is a valid command, and is quite useful for working
with 11 bit CAN systems. It actually results in the
header bytes being stored internally as 00 07 DF.
SH xx yy zz
[ Set the Header to xx yy zz ]
This command allows the user to manually control
the values that are sent as the three header bytes in a
message. These bytes are normally assigned values
for you (and are not required to be adjusted), but there
may be occasions when it is desirable to change them
(particularly if experimenting with physical addressing).
If experimenting, it is not necessary but may be better
to set the headers after a protocol is active. That way,
wakeup messages, etc. that get set on protocol
activation will use the default values.
The header bytes are defined with hexadecimal
digits - xx will be used for the first or priority/type byte,
yy will be used for the second or receiver/target byte,
and zz will be used for the third or transmitter/source
byte. These remain in effect until set again, or until
restored to their default values with the D, WS, or Z
commands.
If new values for header bytes are set before the
vehicle protocol has been determined, and if the
search is not set for fully automatic (ie other than
protocol 0), these new values will be used for the
header bytes of the first request to the vehicle. If that
first request should fail to obtain a response, and if the
automatic search is enabled, the ELM327 will then
continue to search for a protocol using default values
for the header bytes. Once a valid protocol is found,
the header bytes will revert to the values assigned with
the AT SH command.
This command is used to assign all header bytes,
whether they are for a J1850, ISO 9141, ISO 14230, or
a CAN system. The CAN systems will use these three
bytes to fill bits 0 to 23 of the ID word (for a 29 bit ID),
or will use only the rightmost 11 bits for an 11 bit CAN
ID (and any extra bits assigned will be ignored). The
additional 5 bits needed for a 29 bit system are set
with the AT CP command.
If assigning header values for the KWP protocols
(4 and 5), care must be taken when setting the first
header byte (xx) value. The ELM327 will always insert
the number of data bytes for you, but how it is done
depends on the values that you assign to this byte. If
the second digit of this first header byte is anything
other than 0 (zero), the ELM327 assumes that you
wish to have the length value inserted in that first byte
when sending. In other words, providing a length value
in the first header byte tells the ELM327 that you wish
to use a traditional 3 byte header, where the length is
stored in the first byte of the header.
If you provide a value of 0 for the second digit of
the first header byte, the ELM327 will assume that you
wish that value to remain as 0, and that you want to
have a fourth header (length) byte inserted into the
message. This is contrary to the ISO 14230-4 OBD
standard, but it is in use by many KWP2000 systems
for (non-OBD) data transfer, so may be useful when
experimenting. Support for 4 byte KWP headers was
added with v1.2 of the ELM327 IC, and is not available
in previous versions.
SI
[ perform a Slow Initiation ]
Protocols 3 and 4 use what is sometimes called a
5 baud, or slow initiation sequence in order to begin
communications. Usually, the sequence is performed
when the first message needs to be sent, and then the
message is sent immediately after. Some ECUs may
need more time between the two however, and having
a separate initiation command allows you to control
this time. Simply send AT SI, wait a little, then send
the message. You may need to experiment a little to
get the right amount of delay. Protocol 3 or 4 must be
selected to use the AT SI command, or an error will
result.
SP h
[ Set Protocol to h ]
This command is used to set the ELM327 for
operation using the protocol specified by 'h', and to
also save it as the new default. Note that the protocol
will be saved no matter what the AT M0/M1 setting is.
The ELM327 supports 12 different protocols (two
can be user-defined). They are:
0 - Automatic
1 - SAE J1850 PWM (41.6 kbaud)
2 - SAE J1850 VPW (10.4 kbaud)
ELM327DSH
Elm Electronics – Circuits for the Hobbyist
www.elmelectronics.com
23 of 76