Binary commands – Pololu Simple User Manual

Page 59

Advertising
background image

Commands only: The proper CRC byte must be appended to the end of every Binary Mode serial command
packet. If the CRC byte is not appended or is incorrect, a Serial CRC Error is generated. Serial responses from
the controller do not have a CRC byte appended to the end.

Commands and responses: The proper CRC byte must be appended to the end of every Binary Mode serial
command packet. If the CRC byte is not appended or is incorrect, a Serial CRC Error is generated. Additionally,
serial responses from the controller have a CRC byte appended to the end, which lets you be more confident that
the response was not corrupted by noise.

Device Number: This is the device number (0–127) that is used to address this device in Pololu Protocol and Mini
SSC protocol commands. This setting is useful when using the Simple Motor Controller with other devices in a daisy-
chained configuration (see

Section 6.6

).

Baud Rate: This setting only applies to TTL serial communication via the RX and TX pins; it is not relevant for
serial communication over the virtual COM port. Auto-detect baud rate is only available when the Serial Mode is
“Binary”; Fixed baud rate is automatically selected when the Serial Mode is “ASCII”.

Auto-detect baud rate: In this mode, the Simple Motor Controller automatically detects the baud rate from
the first 0xAA (170) baud rate indication byte it receives on the RX line. Every time the controller is powered
up or reset, and every time the “Apply settings” button is pressed in the Simple Motor Control Center, you will
need to send a baud rate indication byte before the Simple Motor Controller will accept TTL serial commands.
Once you send the baud rate indication byte, you can check the Status Tab of the Simple Motor Control Center
to see what baud rate the controller detected. The controller can automatically detect baud rates from 1200 bps
to 500 kbps.

Fixed baud rate: In this mode, the Simple Motor Controller will only respond to TTL serial signals
transmitted at the configured fixed baud rate (in units of bits per second, or bps). The fixed baud rate can be set
from 1099 bps to 2 Mbps, but the Simple Motor Controller will not be able to keep up with a constant stream of
commands at baud rates over 500 kbps (if you send commands to the controller faster than it can process them,
the receive buffer will eventually fill up, data will be lost, and a Serial RX Overrun Error will be generated).

Delay TTL serial responses: Enabling this feature causes the Simple Motor Controller to wait for approximately
1 ms before transmitting a TTL serial response. This is useful when interfacing with devices like the Basic Stamp that
use half-duplex UARTs and need time to switch from transmit mode to receive mode. When this feature is disabled,
transmission of a response packet begins as soon as possible after the last byte of a command packet is received (if
that command packet generates a response).

Command Timeout: This setting lets you configure the Simple Motor Controller to shut down the motor if too
much time elapses between received commands, which could happen if your serial control source gets disconnected
or loses power. It is located under the Advanced Tab of the Simple Motor Control Center. See

Section 5.3

for more

information on this parameter.

6.2. Binary Commands

When configured in “Binary” serial mode, the Simple Motor Controller offers several serial command protocols
similar to that of other Pololu products. Communication is achieved by sending serial command packets consisting of
a single command byte followed by any data bytes that command requires (not all commands require data bytes; some
command packets simply consist of a single command byte). Command bytes always have their most significant bits
set, while data bytes almost always have their most significant bits cleared:

0x80 (128) ≤ command byte ≤ 0xFF (255)
0x00 (0) ≤ data byte
≤ 0x7F (127)

Pololu Simple Motor Controller User's Guide

© 2001–2014 Pololu Corporation

6. Using the Serial Interface

Page 59 of 101

Advertising