Compact protocol, Pololu protocol – Pololu Simple User Manual

Page 60

Advertising
background image

This means that each data byte can only transmit seven bits of information. The only exception to this is the Mini SSC
command, where the command byte is 0xFF, or 255, and the data bytes can have any value from 0x00 to 0xFE (0 to
254).

Note: If you are using the TTL serial interface and the motor controller is in Auto-Detect Baud Rate mode,
you must send the baud rate indication byte 0xAA, or 170, on the RX line before sending any commands.
The 0xAA baud rate indication byte can be the first byte of a Pololu protocol command, or it can be
transmitted as a single byte. Communication via the controller’s virtual COM port is unaffected by baud
rate settings and does not require the transmission of an initial baud rate indication byte.

This guide displays byte values in the format: “hex (decimal)”, where hex is the

hexadecimal

[http://simple.wikipedia.org/wiki/Hexadecimal]

(base-16) representation of the byte’s value, and decimal is

the decimal representation of the byte’s value. The hexadecimal representation starts with the prefix
0x (e.g. 0x10).

Keep in mind that a byte is simply a number between 0x00 (0) and 0xFF (255). For serial protocols,
the important thing about a byte is its value, not the notation (e.g. hex, decimal, or binary) you use in
your source code to write the byte.

The following three sub-protocols are available in binary serial mode:

Compact Protocol

This is the simpler and more compact of the two protocols; it is the protocol you should use if your Simple Motor
Controller is the only device connected to your serial line. The compact protocol command packet is simply:

command byte (MSB set) [data byte 1] [data byte 2] … [data byte n]

1XXXXXXX

[0XXXXXXX]

[0XXXXXXX]

[0XXXXXXX]

For example, if we want to set the motor speed to 3200 (full speed) forward, we could send the following byte
sequence:

Hex notation:

0x85,

0x00,

0x64

Decimal notation:

133,

0,

100

The byte 0x85 is the Set Motor Forward command, and the last two bytes contain the speed.

Pololu Protocol

This protocol is compatible with the serial protocol used by our other serial motor and servo controllers. As such, you
can daisy-chain a Simple Motor Controller on a single serial line along with our other serial controllers (including
additional Simple Motor Controllers) and, using this protocol, send commands specifically to the desired controller
without confusing the other devices on the line.

To use the Pololu protocol, you must transmit 0xAA (170 in decimal) as the first (command) byte, followed by a
Device Number data byte. The default Device Number for the Simple Motor Controller is 0x0D (13 in decimal),
but this is a configuration parameter you can change. Any controller on the line whose device number matches
the specified device number accepts the command that follows; all other Pololu devices ignore the command. The

Pololu Simple Motor Controller User's Guide

© 2001–2014 Pololu Corporation

6. Using the Serial Interface

Page 60 of 101

Advertising