beautypg.com

B. baud rates, C. command protocols, Compact protocol – Pololu Qik 2s12v10 User Manual

Page 16: B. baud rates 4.c. command protocols

background image

information. Information requests result in the transmission of a single byte per request. If you aren’t interested in
receiving feedback from the qik, you can leave this line disconnected.

Note: Only the SIN line is compatible with RS-232 serial, which is inverted and uses voltages that
would be out of spec (e.g. -15 to 15 V). You should not connect RS-232 serial lines to RX or TX.
The qik does not provide RS-232 serial output.

4.b. Baud Rates

The qik 2s12v10 can handle baud rates between 1200 and 115,200 bps. In its default state, the qik starts up in an
automatic-baud-detection phase and waits to receive the byte 0xAA (decimal 170). The qik detects the baud rate
from this byte and proceeds to the normal operation phase at this baud rate. If you have the one or both of the
fixed-baud jumpers in place, the qik skips the autodetect phase and instead immediately begins normal operation
at a baud rate as indicated in the table below.

BAUD1

Jumper

BAUD2

Jumper

Baud Mode

OFF

OFF

auto-detect baud rate (1200 – 115,200 bps)

ON

OFF

fixed baud rate at 115,200 bps

OFF

ON

fixed baud rate at 38,400 bps

ON

ON

fixed baud rate at 9,600 bps

Please see

Section 3.d

for more information on the fixed-baud jumpers.

4.c. Command Protocols

Once the qik has entered the normal operation phase, you can control it by issuing serial commands. If your qik
is set to automatically detect the baud, you must first send it the byte 0xAA (170 in decimal) in order to exit
autodetect mode and enter normal operation.

The qik serial command protocol is fairly simple. 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 (i.e. they range from 128 – 255, or 0x80 – 0xFF in hex) while data bytes always
have their most significant bits cleared (i.e. they range from 0 – 127, or 0x00 – 0x7F in hex). This means that each
data byte can only transmit seven bits of information.

One significant improvement over earlier Pololu serial controllers is the qik’s error handling, which allows the
user to specify responses to serial errors (including unknown commands, incorrectly formatted commands, and
hardware-level serial errors), motor fault errors, and motor over-current errors. The qik has a configuration
parameter that determines if the motors shut down when various errors occur, but the qik itself continues running
and accepting commands.

The qik responds to two sub-protocols:

Compact Protocol:

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

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

Qik 2s12v10 User's Guide

© 2001–2012 Pololu Corporation

4. Serial Interface

Page 16 of 33