C. command protocols, Compact protocol, Pololu protocol – Pololu Maestro User Manual

Page 38

Advertising
background image

bytes per second is the baud rate divided by ten. At the Maestro’s maximum baud rate of 250,000 bits per second, the
maximum realizable data rate, with a start bit coming immediately after the preceding byte’s stop bit, is 25,000 bytes
per second.

Whenever connecting devices, remember to wire the grounds together, and ensure that each device
is properly powered. Unpowered devices with a TTL serial port can turn on or partially on, drawing
power from the serial line, which means that extra care must be taken when turning power off and on
to reset the devices.

5.c. Command Protocols

You can control the Maestro by issuing serial commands.

If your Maestro’s serial mode is “UART, detect baud rate”, you must first send it the baud rate indication byte 0xAA
on the RX line before sending any commands. The 0xAA baud rate indication byte can be the first byte of a Pololu
protocol command.

The Maestro serial command protocol is similar to that of other Pololu products. Communication is achieved by
sending command packets consisting of a single command byte followed by any data bytes that command requires.
Command bytes always have their most significant bits set (128–255, or 0x80–0xFF in hex) while data bytes always
have their most significant bits cleared (0–127, or 0x00–0x7F in hex). 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 data bytes can
have any value from 0 to 254.

The Maestro responds to three sub-protocols:

Compact Protocol

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

command byte (with MSB set), any necessary data bytes

For example, if we want to set the target of servo 0 to 1500 µs, we could send the following byte sequence:

in hex: 0x84, 0x00, 0x70, 0x2E
in decimal: 132, 0, 112, 46

The byte 0x84 is the Set Target command, the first data byte 0x00 is the servo number, and the last two data bytes
contain the target in units of quarter-microseconds.

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 Maestro on a single serial line along with our other serial controllers (including additional Maestros)
and, using this protocol, send commands specifically to the desired Maestro without confusing the other devices on
the line.

To use the Pololu protocol, you transmit 0xAA (170 in decimal) as the first (command) byte, followed by a Device
Number data byte. The default Device Number for the Maestro is 12, but this is a configuration parameter you can

Pololu Maestro Servo Controller User's Guide

© 2001–2014 Pololu Corporation

5. Serial Interface

Page 38 of 73

Advertising