Pololu protocol, Procedure for daisy-chaining – Pololu Qik 2s12v10 User Manual
Page 17

For example, if we want to set motor M1 to full speed forward using the compact protocol, we could send the
following byte sequence:
in hex: 0x8D, 0x7F
in decimal: 141, 127
The byte 0x8D is a command for M1 forward, and the data byte contains the motor speed. Note that every qik
command byte starts with 0x8_ or 0x9_ when using the compact protocol.
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 qik on a single serial line along with our other serial controllers (including additional qiks)
and, using this protocol, send commands specifically to the desired qik without confusing the other devices on the
line.
The Pololu protocol is to transmit 0xAA (170 in decimal) as the first (command) byte, followed by a device-
number data byte. The default device number for the qik is 10, but this is a configuration parameter you can
change. Any qik on the line whose device number matches the specified device number accepts the command
that follows; all other Pololu devices ignore the command. The remaining bytes in the command packet are the
same as the compact protocol command packet you would send, with one key difference: the compact protocol
command byte is now a data byte for the command 0xAA and hence must have its most significant bit cleared.
Therefore, the command packet is:
0xAA, device # byte, command byte with MSB cleared, any necessary data bytes
For example, if we want to set motor M1 to full speed forward for a qik with device number 10, we could send
the following byte sequence:
in hex: 0xAA, 0x0A, 0x0D, 0x7F
in decimal: 170, 10, 13, 127
Note that 0x0D is the command 0x8D with its most significant bit cleared. Since all compact-protocol command
bytes start with 0x8n or 0x9n, these bytes all turn into data bytes 0x0n or 0x1n, respectively.
The qik responds to both the Pololu and Compact protocols on the fly; you do not need to use a jumper or
configuration parameter to identify which protocol you are using.
Procedure for Daisy-Chaining
Daisy-chaining multiple qiks together on the same serial line is simple. Individually assign each qik a different
device ID using the set configuration parameter command (see
), and then connect your TTL serial
transmit line to each qik’s RX line or your RS-232 serial transmit line to each qik’s SIN line. If you wish, you
can connect all of the qiks’ ERR lines to a single input on your controlling module. When you issue your first
Pololu-protocol command, the qiks all automatically detect the baud from the initial 0xAA byte.
Connecting multiple serial outputs to one serial input is more complicated. Each device only transmits when
requested, so if each unit is addressed separately, multiple units will not transmit simultaneously. However, the
outputs are driven, so they cannot simply be wired together. Instead, you can use an AND gate (since the idle state
is high).
Qik 2s12v10 User's Guide
© 2001–2012 Pololu Corporation
4. Serial Interface
Page 17 of 33