ELM329
AT Command Descriptions (continued)
SH xyz
[ Set the Header to 00 0x yz ]
at once with this command. Only 29 bits are used - the
three most significant bits of the first digit are ignored.
Each message that is sent by the ELM329 is a
combination of a header (ID bits) and data bytes.
Since the ID bits need to be changed far less often
than the data byes, it makes sense to change them
only when needed.
The AT SH xyz command accepts a three digit
argument, takes only the right-most 11 bits from that,
and uses that for the 11 bit ID when sending standard
length ID messages.
SP h
[ Set Protocol to h ]
This command is used to set the ELM329 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 ELM329 supports many different protocols, as
listed here (but it’s a little misleading, as there is only
very minimal support for protocols 1 to 5):
SH xxyyzz
[ Set the Header to xxyyzz ]
0 - Automatic
This command provides a means to set three
bytes of the 29 bit extended ID. The values passed are
used to populate the 24 least significant bits (and the
remaining 5 bits are set using the AT CP command).
Since the CAN Priority bits do not often change, this
three byte/six digit command often provides a slightly
faster way to change an extended ID. In addition, it
provides compatibility with the large ELM327 software
base.
The header bytes (ID bits) in a message are
normally assigned values for you (and depending on
your application, may never require adjusting), 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, you can be sure of your starting point
before changing the default values.
1 - SAE J1850 PWM (41.6 kbaud)
2 - SAE J1850 VPW (10.4 kbaud)
3 - ISO 9141-2 (5 baud init, 10.4 kbaud)
4 - ISO 14230-4 KWP (5 baud init, 10.4 kbaud)
5 - ISO 14230-4 KWP (fast init, 10.4 kbaud)
6 - ISO 15765-4 CAN (11 bit ID, 500 kbaud)
7 - ISO 15765-4 CAN (29 bit ID, 500 kbaud)
8 - ISO 15765-4 CAN (11 bit ID, 250 kbaud)
9 - ISO 15765-4 CAN (29 bit ID, 250 kbaud)
A - SAE J1939 CAN (29 bit ID, 250* kbaud)
B - USER1 CAN (11* bit ID, 125* kbaud)
C - USER2 CAN (11* bit ID, 50* kbaud)
D - SAE J1939* CAN (29* bit ID, 500* kbaud)
E - USER4 CAN (11* bit ID, 95.2* kbaud)
F - USER5 CAN (11* bit ID, 33.3* kbaud)
* default settings (user adjustable)
The header bytes are defined with hexadecimal
digits. These remain in effect until set again, or until
restored to their default values with the D, WS, or Z
commands.
The first protocol shown (0) is a convenient way of
telling the ELM329 that the vehicle’s protocol is not
known, and that it should perform a search for you. It
causes the ELM329 to try all protocols if necessary,
looking for one that can be initiated correctly. When a
valid protocol is found, and the memory function is
enabled, that protocol will then be remembered, and
will become the new default setting. When saved like
this, the automatic mode searching will still be
enabled, and the next time the ELM329 fails to
connect to the saved protocol, it will again search all
protocols for another valid one. Note that some
vehicles respond to more than one protocol - during a
search, you may see more than one type of response.
The AT SP 0 command is a useful way to reset
the search logic when attempting to connect to a
vehicle. The ELM329 SP 0 command works like the
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 ELM329 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.
SH wwxxyyzz
[ Set the Header to wwxxyyzz ]
All 29 bits of an extended ID (header) may be set
ELM329DSB
Elm Electronics – Circuits for the Hobbyist
www.elmelectronics.com
21 of 76