User Manual

in binary: 10000100, 00000010, 01110000, 00101110
in hex: 0x84, 0x02, 0x70, 0x2E
in decimal: 132, 2, 112, 46
Here is some example C code that will generate the correct serial bytes, given an integer “channel”
that holds the channel number, an integer “target” that holds the desired target (in units of quarter
microseconds if this is a servo channel) and an array called serialBytes:
Many servo control applications do not need quarter-microsecond target resolution. If you want
a shorter and lower-resolution set of commands for setting the target you can use the Mini-SSC
command below.
Set Target (Mini SSC protocol)
Mini-SSC protocol: 0xFF, channel address, 8-bit target
This command sets the target of a channel to a value specified by an 8-bit target value from 0 to
254. The 8-bit target value is converted to a full-resolution target value according to the range and
neutral settings stored on the Maestro for that channel. Specifically, an 8-bit target of 127 corresponds
to the neutral setting for that channel, while 0 or 254 correspond to the neutral setting minus or plus
the range setting. These settings can be useful for calibrating motion without changing the program
sending serial commands.
The channel address is a value in the range 0–254. By default, the channel address is equal to the
channel number, so it should be from 0 to 23. To allow multiple Maestros to be controlled on the same
serial line, set the Mini SSC Offset parameter to different values for each Maestro. The Mini SSC Offset
is added to the channel number to compute the correct channel address to use with this command.
For example, a Micro Maestro 6-channel servo controller with a Mini SSC Offset of 12 will obey Mini-
SSC commands whose address is within 12–17.
Set Multiple Targets (Mini Maestro 12, 18, and 24 only)
Compact protocol: 0x9F, number of targets, first channel number, first target low bits, first target
high bits, second target low bits, second target high bits, …
Pololu protocol: 0xAA, device number, 0x1F, number of targets, first channel number, first target
low bits, first target high bits, second target low bits, second target high bits, …
This command simultaneously sets the targets for a contiguous block of channels. The first byte
specifies how many channels are in the contiguous block; this is the number of target values you will
need to send. The second byte specifies the lowest channel number in the block. The subsequent
1
2
3
4
serialBytes[0] = 0x84; // Command byte: Set Target.
serialBytes[1] = channel; // First data byte holds channel number.
serialBytes[2] = target & 0x7F; // Second byte holds the lower 7 bits of target.
serialBytes[3] = (target >> 7) & 0x7F; // Third data byte holds the bits 7-13 of target.
?
Pololu Maestro Servo Controller User’s Guide © 2001–2017 Pololu Corporation
5. Serial Interface Page 54 of 99