Ascii commands, Command format, Command strings – Pololu Simple User Manual

Page 71

Advertising
background image

limits will be respected) and not allow the motor to start again until the Safe-Start conditions required by the Input
Mode are satisfied. This command has no serial response.

6.3. ASCII Commands

When configured in “ASCII” serial mode, the Simple Motor Controller offers a simple serial interface based on
ASCII characters. This mode makes it easy to interact with the Simple Motor Controller through a terminal program,
such as HyperTerminal, and it can provide a more intuitive interface for users who would rather deal with character
strings than bits and bytes.

There are some limitations when using ASCII mode, however:

• The commands are longer than their Binary-mode Compact Protocol counterparts, so they will take longer to
send when using a TTL serial connection.

• Automatic baud detection is not available; you must configure the Simple Motor Controller to the appropriate
fixed baud rate ahead of time if you are communicating using TTL serial.

• CRC error detection is not available.

• The ASCII-mode serial responses might be harder to parse with some programming languages than the
Binary-mode responses.

Command Format

ASCII commands consist of a command string, which is typically a single letter, followed by a comma-separated list
of numbers representing the arguments to the command. Not all commands take arguments, and only one command
(Set Motor Limit) takes multiple arguments. All commands must be terminated by a special termination character,
such as a carriage return (<CR>).

Expressed generally, the format is:

command string + [argument 1 + [‘,’ + argument 2]] + termination character

For example, to command the motor to drive forward at speed 3200 (full speed), we could send the following ASCII
command:

“F3200<CR>”

Here the command string is “F”, the argument string is “3200”, and the termination character is <CR>.

ASCII commands are case-insensitive and white-space is ignored, so “F3200<CR>” has the same
effect as “f 3200 <CR>”.

The specific commands are documented in

Section 6.3.1

.

Command Strings

The following table lists all of the available command strings:

Pololu Simple Motor Controller User's Guide

© 2001–2014 Pololu Corporation

6. Using the Serial Interface

Page 71 of 101

Advertising