ELM329
Using Higher RS232 Baud Rates (continued)
the results of the test. See the chart at the right, which
shows how the command works.
As can be seen, the software (PC) first makes a
request for a new baud rate divisor, using this AT
command. For example, to try the 57.6K rate that was
previously discussed, the controlling PC would send:
PC
ELM329
Request for a new
baud rate divisor:
AT BRD hh
AT BRD 45
ELM329 responds
with ‘OK’
and the ELM329 would respond with ‘OK’. After it sees
the ‘OK’, the PC should switch to the new data rate of
57.6 kbaud. Note that no prompt character follows the
ELM329’s ‘OK’ reply - it is followed only by a carriage
return character (and optionally, a linefeed character).
Having sent an ‘OK’, the ELM329 also switches to
the new (proposed) baud rate, and then simply waits a
predetermined time (nominally 75 msec). This period
is to allow the PC sufficient time to change its baud
rate. When the time is up, the ELM329 then sends the
ID string (currently ‘ELM329 v2.0’) to the PC at the
new baud rate, followed by a carriage return and a
linefeed (if enabled). It then waits for a response.
Knowing that it should receive the ELM329 ID
string, the PC software compares what was actually
received to what was expected. If they match, the PC
responds with a carriage return character, but if there
is a problem, the PC sends nothing. The ELM329 is
meanwhile waiting for a valid carriage return character
to arrive. If it does (within 75 msec), the proposed
baud rate is retained, and the ELM329 says ‘OK’ at
this new rate. If it does not see the carriage return, the
baud rate reverts back to the old rate. Note that the PC
might correctly output the carriage return at this new
rate, but the interface circuitry could corrupt the
character, and the ELM329 might not see a valid
response, so your software must check for an ‘OK’
response before assuming that the new rate has been
accepted.
Program switches to
the new baud rate,
and waits for input
ELM329 switches to
new baud rate and
waits for 75 msec*
ELM329 sends the
AT I string
(ELM329 v2.0)
If the Rx is good,
Program sends a
carriage return
ELM329 waits
up to 75 msec*
for a carriage return
CR
received
?
yes
no
Baud rate reverts
to the previous
baud rate
ELM329 says ‘OK’
(and remains at the
new baud setting)
Using this method, a program can quickly try
several baud rates, and determine the most suitable
one for the connected hardware. The new baud rate
will stay in effect until reset by an AT Z, a Power
Off/On, or a MCLR input. It is not affected by the AT D
(set Defaults), or AT WS (Warm Start) commands.
Print a prompt,
and wait for the
next command
* the 75 msec time is adjustable
with the AT BRT hh command
ELM329DSB
Elm Electronics – Circuits for the Hobbyist
www.elmelectronics.com
45 of 76