C. command protocols, Compact protocol, Pololu protocol – Pololu Jrk USB User Manual
Page 29
start bit, 8 data bits, and a stop bit, each byte takes 10 bit times to transmit, so the fastest possible data rate in bytes
per second is the baud rate divided by ten. At the jrk’s maximum baud rate of 115,200 bits per second, the maximum
realizable data rate, with a start bit coming immediately after the preceding byte’s stop bit, is 11,520 bytes per second.
Whenever connecting devices, remember to wire the grounds together, and ensure that each device
is properly powered. Unpowered devices with a TTL serial port can turn on or partially on, drawing
power from the serial line, which means that extra care must be taken when turning power off and on
to reset the devices.
4.c. Command Protocols
You can control the jrk by issuing serial commands.
If your jrk’s input mode is Serial and its Serial Mode is “UART, detect baud rate”, you must first send it the byte
0xAA (170 in decimal) on the RX line (so it can detect the baud rate) before sending it any commands.
The jrk serial command protocol is fairly straightforward. 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.
The jrk 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 jrk is the only
device connected to your serial line. The jrk compact protocol command packet is simply:
command byte (with MSB set), any necessary data bytes
For example, if we want to set the target to 4080 (the highest value achievable using the low resolution Set Target
commands), we could send the following byte sequence:
in hex: 0xE1, 0x7F
in decimal: 225, 127
The byte 0xE1 is the Set Target Low Resolution Forward command, and the data byte contains the motor speed.
Note that the Set Target High Resolution command uses some of the bits in the command byte to represent data, so
there is not a one-to-one correspondence between command bytes and commands.
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 jrk on a single serial line along with our other serial controllers (including additional jrks) and,
using this protocol, send commands specifically to the desired jrk 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 jrk is 11, but this is a configuration parameter you can change. Any
Pololu Jrk USB Motor Controller User's Guide
© 2001–2014 Pololu Corporation
4. Using the Serial Interface
Page 29 of 45