Manual

Note: These lines are not compatible with RS-232 serial, which is inverted and uses voltages that
would be out of spec (e.g. -12V to 12V). To connect the qik to an RS-232 device, you will need
to use a converter such as our 23201a serial adapter [http://www.pololu.com/catalog/product/126], or a
level shifter and inverter.
4.b. Baud Rates
The qik can handle baud rates between 1200 and 38,400 bps. In its default state, the qik will start up in an
automatic baud detection phase, where it waits for you to send it the byte 0xAA (170). The qik will detect the
baud rate you are using from this byte and proceed to the normal operation phase. If you have the fixed-baud
jumper in place, the qik will skip the autodetect phase and will instead immediately begin normal operation at a
baud rate of 38,400 bps. Please see Section 3.d for more information.
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 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. range from 128 – 255) while data bytes always have their most significant
bits cleared (i.e. range from 0 – 127). 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 (which include bad commands, incorrectly formatted commands, or even
hardware-level serial errors). The qik has a configuration parameter that, if set, will shut down the motors if a
serial error occurs, but the qik itself will continue running and accepting commands. This is a safety precaution
taken in case the serial error occurred during a command that was intended to stop the motors.
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
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 will start with 0x8_ when using the compact protocol.
Qik 2s9v1 User's Guide © 2001–2012 Pololu Corporation
4. Serial Interface Page 13 of 24