12 of 51
ELM327DSC Elm Electronics – Circuits for the Hobbyist
www.elmelectronics.com
after which the IC will look for a response, but will not
look at the actual values of the bytes in the response.
This may allow a connection in an otherwise
‘impossible’ situation. Normal behaviour can be
returned with AT KW1, which is the default setting.
Caution should be used with this command, as
you are bypassing the checks that are normally
performed on the keyword bytes. The ELM327 sends
an acknowledgement to the ECU for these bytes, but
that is without considering what the bytes actually are.
You could be incorrectly activating an ISO 9141, or
KWP 2000 protocol, so should be very careful.
L0 and L1 [ Linefeeds off (0) or on(1) ]
This option controls the sending of linefeed
characters after each carriage return character. For
AT L1, linefeeds will be generated after every carriage
return character, and for AT L0, they will be off. Users
will generally wish to have this option on if using a
terminal program, but off if using a custom computer
interface (as the extra characters transmitted will only
serve to slow the communications down). The default
setting is determined by the voltage at pin 7 during
power on (or reset). If the level is high, then linefeeds
on will be the default; otherwise it will be linefeeds off.
M0 and M1 [ Memory off (0) or on(1) ]
The ELM327 has internal ‘non-volatile’ memory
that is capable of remembering the last protocol used,
even after the power is turned off. This can be
convenient if the IC is often used for one particular
protocol, as that will be the first one attempted when
next powered on. To enable this memory function, it is
necessary to either use an AT command to select the
M1 option, or to have chosen “memory on” as the
default power on mode (by connecting pin 5 of the
ELM327 to a high logic level).
When the memory function is enabled, each time
that the ELM327 finds a valid OBD protocol, that
protocol will be memorized (stored) and will become
the new default. If the memory function is not enabled,
protocols found during a session will not be
memorized, and the ELM327 will always start at power
up using the same (last saved) protocol.
If the ELM327 is to be used in an environment
where the protocol is constantly changing, it would
likely be best to turn the memory function off, and
issue an AT SP 0 command once. The SP 0 command
tells the ELM327 to always start in an 'Automatic'
protocol search mode, which is the most useful for an
unknown environment. ICs come from the factory set
to this mode. If, however, you have only one vehicle
that you regularly connect to, storing that vehicle’s
protocol as the default would make the most sense.
As mentioned, the default setting for the memory
function is determined by the voltage level at pin 5 at
power up (or system reset). If it is connected to a high
level (VDD), then the memory function will be on by
default. If pin 5 is connected to a low level, the
memory saving will be off by default.
MA [ Monitor All messages ]
Using this command places the ELM327 into a
bus monitoring mode, in which it displays all messages
as it sees them on the OBD bus. It remains a quiet
monitor on the bus, not sending In Frame Responses
for J1850 systems or Acknowledges for CAN systems.
This continues indefinitely until stopped by activity on
the RS232 input, or the RTS pin.
To stop the monitoring, one can send a single
character then wait for the ELM327 to respond with a
prompt character (‘>’). Alternatively, the RTS input can
be brought to a low level to interrupt the device as
well. Waiting for the prompt is necessary as the
response time is unpredictable, varying depending on
what the IC was doing when interrupted. If for instance
it is in the middle of printing a line, it will first complete
that line then return to the command state, issuing the
prompt character. If it were simply waiting for input, it
would return immediately. Note that the character
which stops the monitoring will always be discarded,
and will not affect subsequent commands.
MP hhhh [ Monitor for PGN hhhh ]
The AT MA, MR and MT commands are quite
useful for when you wish to monitor for a specific byte
in the header of a typical OBD message. For the SAE
J1939 Protocol, however, it is often desireable to
monitor for the multi-byte Parameter Group Numbers
(or PGNs), which can appear in either the header, or
the data bytes. The MP command is a special J1939
only command that is used to look for responses to a
particular PGN request, and follow any multi-segment
occurances of them.
Note that the MP command provides no means to
set the first two digits of the requested PGN, and they
AT Commands (continued)