ELM327
Selecting Protocols (continued)
based on any active inputs that are present. If you
need to follow the SAE J1978 order, you should send
the ELM327 an AT SS command, or step through
each protocol with the TP command.
only your target protocol (ie. AT SP n), or else tell it to
use yours with automatic searches allowed on failure
(ie AT SP An). Then send your request, with headers
assigned as required. The ELM327 will then attempt to
connect using your headers and your data, and only if
that fails (and you have chosen the protocol with AT
SP An) will it search using the standard OBD default
values.
In general, 99% of all users find that enabling the
memory (setting pin 5 to 5V) and using the ‘Auto’
option when searching (you may need to send AT
SP 0) works very well. After the initial search, the
protocol used by your vehicle becomes the new
default, but it is still able to search for another, without
your having to say AT SP 0 again.
The automatic search works well with OBDII
systems, but may not be what you need if you are
experimenting. During a search, the ELM327 ignores
any headers that you have previously defined (since
there is always a chance that your headers may not
result in a response), and it uses the default OBD
header values for each protocol. It will also use
standard requests (ie 01 00) during the searches. If
this is not what you want, the results may be a little
frustrating.
To use your own header (and data) values when
attempting to connect to an ECU, do not tell the
ELM327 to use protocol 0. Instead, tell it to either use
OBD Message Formats
To this point we have only discussed the contents
(data portion) of an OBD message, and made only
passing mention of other parts such as headers and
checksums, which all messages use to some extent.
On Board Diagnostics systems are designed to be
very flexible, providing a means for several devices to
communicate with one another. In order for messages
to be sent between devices, it is necessary to add
information describing the type of information being
sent, the device that it is being sent to, and perhaps
which device is doing the sending. Additionally, the
importance of the message becomes a concern as
well – crankshaft position information is certainly of
considerably more importance to a running engine
than a request for the number of trouble codes stored,
or the vehicle serial number. So to convey importance,
messages are also assigned a priority.
The information describing the priority, the
intended recipient, and the transmitter are usually
needed by the recipient even before they know the
type of request that the message contains. To ensure
that this information is obtained first, OBD systems
transmit it at the start (or head) of the message. Since
these bytes are at the head, they are usually referred
to as header bytes. Figure 3 below shows a typical
OBD message structure that is used by the
SAE J1850, ISO 9141-2, and ISO 14230-4 standards.
It uses 3 header bytes as shown, to provide details
concerning the priority, the receiver, and the
transmitter. Note that many texts refer to the receiver
TA
SA
priority
receiver transmitter
3 header bytes
up to 7 data bytes
checksum
Figure 3. An OBD Message
ELM327DSI
Elm Electronics – Circuits for the Hobbyist
36 of 82
www.elmelectronics.com