beautypg.com

Get error flags occurred, G. variable reading commands – Pololu Jrk USB User Manual

Page 35

background image

This command is equivalent to reading the “Currently stopping motor?” column in the Errors tab of the configuration
utility, and then clicking the “Clear Errors” button.

If an error is stopping the motor (besides the Awaiting Command error bit), the jrk will turn the red LED on and drive
the ERR line high, and this command can be used to determine the cause of the error.

Get Error Flags Occurred

Compact protocol: 0xB5
Pololu protocol: 0xAA, device number, 0x35

This command generates a two-byte serial response reporting which errors have occurred since the last time the Get
Error Flags Occurred command was received. Unlike the Get Error Flags Halting command, this command has no
effect on the motor.

Note: If the jrk is connected to the configuration utility, then the Get Error Flags Occurred command
will give unreliable responses, because the configuration utility runs this command regularly. This
command will report all the errors that have occurred since the last time the Get Error Flags Occurred
command was received, regardless of whether that last command came from the configuration utility,
from your microcontroller, or from the jrk’s virtual Command Port.

4.g. Variable Reading Commands

Compact protocol: read variable command byte
Pololu protocol: 0xAA, device number, read variable command byte with MSB clear

The jrk has several serial commands for reading its variables. Most of the variables are two bytes long. For each of
those variables, three variable reading commands are provided:

Two bytes: These commands will result in a two-byte serial response from the jrk containing both bytes of
the variable. All variables are little endian, so the first byte transmitted will be the least-significant byte, and the
second byte transmitted will be the most-significant byte. For variables that can have negative values, the two’s
complement system is used (a response of 0xFE, 0xFF means -2).

Low byte: These commands will result in a one-byte serial response from the jrk containing just the least-
significant byte of the variable.

High byte: These commands will result in a one-byte serial response from the jrk containing just the most-
significant byte of the variable.

The command bytes are listed in the table below.

Pololu Jrk USB Motor Controller User's Guide

© 2001–2014 Pololu Corporation

4. Using the Serial Interface

Page 35 of 45