Manual

5. Serial Commands
5.a. 0x81: Get Firmware Version
Compact protocol: 0x81
Pololu protocol: 0xAA, device ID, 0x01
This command returns the a single ASCII byte that represents the version of the firmware running on the qik. All
qiks produced so far have firmware version ‘1’ or ‘2’.
Firmware version 2 makes a slight change to the LED feedback used during the automatic baud detection phase. If
a serial byte other than 0xAA is received in this phase, or if 0xAA is transmitted at an invalid baud rate, firmware
version 2 turns the red error LED on and keeps it on until the automatic baud detection phase ends. Firmware
version 1 flashes the red LED very briefly if a serial byte other than 0xAA is received in this mode, which can
make it difficult to tell that the qik detected any serial activity.
5.b. 0x82: Get Error Byte
Compact protocol: 0x82
Pololu protocol: 0xAA, device ID, 0x02
The qik maintains an error byte, the bits of which, when set, reflect various errors that have been detected since
the byte was last read using this command. If we call the least-significant bit 0, the bits of the error byte are as
follows:
bits 0 – 2: unused
bit 3: Data Overrun Error
A hardware-level error that occurs when serial data is received while the hardware serial receive buffer is
full. This error should not occur during normal operation.
bit 4: Frame Error
A hardware-level error that occurs when a byte’s stop bit is not detected at the expected place. This error can
occur if you are communicating at a baud rate that differs from the qik’s baud rate.
bit 5: CRC Error
This error occurs when the qik is running in CRC-enabled mode (i.e. the CRC-enable jumper is in place) and
the cyclic redundancy check (CRC) byte added to the end of the command packet does not match what the
qik has computed as that packet’s CRC. In such a case, the qik will ignore the command packet and generate
a CRC error. See Section 6 for more information on cyclic redundancy checking.
bit 6: Format Error
This error occurs when the qik receives an incorrectly formatted or nonsensical command packet. For
example, if the command byte does not match a known command, data bytes are outside of the allowed range
for their particular command, or an unfinished command packet is interrupted by another command packet,
a format error will be generated.
bit 7: Timeout
It is possible to use a configuration parameter to enable the qik’s serial timeout feature (see Section 5.c).
When enabled, the qik will generate a timeout error if the timeout period set by the configuration parameter
elapses. The timeout timer is reset every time a valid command packet is received.
An error will cause the red LED to light and the ERR pin to drive high until this command is called. Calling this
command will clear the error byte, turn the red LED off, and set the ERR pin as high-impedance (causing it to be
Qik 2s9v1 User's Guide © 2001–2012 Pololu Corporation
5. Serial Commands Page 15 of 24