# 8. Command reference

#### Overview

All of the Tic’s serial commands are available on its TTL serial, I²C, and USB interfaces, with the exception of a few commands that are unique to USB. Each command uses one of these four formats:

1. Quick command: no data
2. 7-bit write command: writes a 7-bit value to the Tic
3. 32-bit write command: writes a 32-bit value to the Tic
4. Block read command: reads a block of data from the Tic; the block starts from the specified offset and can have a variable length

Descriptions of how these command formats are encoded for each interface can be found in the following sections (Section 9 for TTL serial, Section 10 for I²C, and Section 11 for USB). (Note that the USB-only “set setting” command is a special case that uses its own unique format.)

#### Set target position

Command 0xE0 32-bit write target position, signed 32-bitRange: −2,147,483,648 to +2,147,483,647 = −0x8000 0000 to +0x7FFF FFFFUnits: microsteps ticcmd -p NUMticcmd --position NUM tic.setTargetPosition(int32_t position)

This command sets the target position of the Tic, in microsteps.

If the control mode is set to Serial / I²C / USB, the Tic will start moving the motor to reach the target position. If the control mode is something other than Serial / I²C / USB, this command will be silently ignored.

In the Tic Control Center, the controls in the “Set target” box can be used to set a target position. These controls are on the “Status” tab and are only available when the control mode is Serial / I²C / USB.

#### Set target velocity

Command 0xE3 32-bit write target velocity, signed 32-bitRange: −500,000,000 to +500,000,000Units: microsteps per 10,000 s ticcmd -y NUMticcmd --velocity NUM tic.setTargetVelocity(int32_t velocity)

This command sets the target velocity of the Tic, in microsteps per 10,000 seconds.

If the control mode is set to Serial / I²C / USB, the Tic will start accelerating or decelerating the motor to reach the target velocity. If the control mode is something other than Serial / I²C / USB, this command will be silently ignored.

In the Tic Control Center, the controls in the “Set target” box can be used to set a target velocity. These controls are on the “Status” tab and are only available when the control mode is Serial / I²C / USB.

#### Halt and set position

Command 0xEC 32-bit write current position, signed 32-bitRange: −2,147,483,648 to +2,147,483,647 = −0x8000 0000 to +0x7FFF FFFFUnits: microsteps ticcmd --halt-and-set-position NUM tic.haltAndSetPosition(int32_t position)

This command stops the motor abruptly without respecting the deceleration limit and sets the “Current position” variable, which represents what position the Tic currently thinks the motor is in. Besides stopping the motor and setting the current position, this command also clears the “position uncertain” flag, sets the input state to “halt”, and clears the “input after scaling” variable.

If the control mode is something other than Serial / I²C / USB, this command will be silently ignored.

In the Tic Control Center, the “Set current position” button can be used to halt the motor and set the Tic’s current position to the specified value. This button is on the “Status” tab and is only available when the control mode is Serial / I²C / USB.

#### Halt and hold

Command 0x89 Quick none ticcmd --halt-and-hold tic.haltAndHold()

This command stops the motor abruptly without respecting the deceleration limit. Besides stopping the motor, this command also sets the “position uncertain” flag (because the abrupt stop might cause steps to be missed), sets the input state to “halt”, and clears the “input after scaling” variable.

If the control mode is something other than Serial / I²C / USB, this command will be silently ignored.

In the Tic Control Center, the “Halt motor” button can be used to halt the motor. This button is on the “Status” tab and is only available when the control mode is Serial / I²C / USB.

#### Go home

Command 0x97 7-bit write 0: Go home in the reverse direction1: Go home in the forward direction ticcmd --home rev or ticcmd --home fwd tic.goHomeReverse() or tic.goHomeForward()

Starts the Tic’s homing procedure as described in Section 5.6.

#### Reset command timeout

Command 0x8C Quick none ticcmd --reset-command-timeout tic.resetCommandTimeout()

If the command timeout is enabled, this command resets it and prevents the “command timeout” error from happening for some time. See Section 5.4 for more information about the command timeout.

The Tic Control Center constantly sends this command while it is connected to a Tic.

#### De-energize

Command 0x86 Quick none ticcmd --deenergize tic.deenergize()

This command causes the Tic to de-energize the stepper motor coils by disabling its stepper motor driver. The motor will stop moving and consuming power. This command sets the “position uncertain” flag (because the Tic is no longer in control of the motor’s position); the Tic will also set the “intentionally de-energized” error bit, turn on its red LED, and drive its ERR line high.

The “energize” command will undo the effect of this command (except it will leave the “position uncertain” flag set) and could make the system start up again.

In the Tic Control Center, the red “De-energize” button in the lower left can be used to de-energize the motor.

#### Energize

Command 0x85 Quick none ticcmd --energize tic.energize()

This command is a request for the Tic to energize the stepper motor coils by enabling its stepper motor driver. The Tic will clear the “intentionally de-energized” error bit. If there are no other errors, this allows the system to start up.

In the Tic Control Center, the green “Resume” button in the lower left can be used to attempt to energize the motor.

#### Exit safe start

Command 0x83 Quick none ticcmd --exit-safe-start tic.exitSafeStart()

In Serial / I²C / USB control mode, this command causes the “safe start violation” error to be cleared for 200 ms. If there are no other errors, this allows the system to start up.

In the Tic Control Center, the green “Resume” button in the lower left will additionally exit safe start if the control mode is Serial / I²C / USB.

#### Enter safe start

Command 0x8F Quick none ticcmd --enter-safe-start tic.enterSafeStart()

If safe start is enabled and the control mode is Serial / I²C / USB, RC speed, analog speed, or encoder speed, this command causes the Tic to stop the motor (using the configured soft error response behavior) and set its “safe start violation” error bit. If safe start is disabled, or if the Tic is not in one of the listed modes, this command will cause a brief interruption in motor control (during which the soft error response behavior will be triggered) but otherwise have no effect.

In Serial mode, an “exit safe start” command is required before the Tic will move the motor again. In the speed control modes, the input must be moved to a neutral position before the Tic will exit safe start and move the motor again. See Section 5.4 for more information about safe start.

#### Reset

Command 0xB0 Quick none ticcmd --reset tic.reset()

This command makes the Tic forget most parts of its current state. Specifically, it does the following:

• Reloads all settings from the Tic’s non-volatile memory and discards any temporary changes to the settings previously made with serial commands (this applies to the step mode, current limit, decay mode, max speed, starting speed, max acceleration, and max deceleration settings)
• Abruptly halts the motor
• Resets the motor driver
• Sets the Tic’s operation state to “reset”
• Clears the last movement command and the current position
• Clears the encoder position
• Clears the serial and “command timeout” errors and the “errors occurred” bits
• Enters safe start if configured to do so

The Tic’s serial and I²C interfaces will be unreliable for a brief period after the Tic receives the Reset command, so we recommend waiting at least 10 ms after sending a Reset command before sending additional I²C or serial commands.

This command does not modify the “intentionally de-energized” error bit. Since this command does not trigger a full microcontroller reset, it does not affect the “up time” variable (which indicates the time elapsed since the Tic’s last full microcontroller reset) or the “device reset” variable (which indicates the cause of the Tic’s last full microcontroller reset).

#### Clear driver error

Command 0x8A Quick none ticcmd --clear-driver-error tic.clearDriverError()

This command attempts to clear a motor driver error, which is an over-current or over-temperature fault reported by the Tic’s motor driver. If the “Automatically clear driver errors” setting is enabled (the default), the Tic will automatically clear a driver error and it is not necessary to send this command. Otherwise, this command must be sent to clear the driver error before the Tic can continue controlling the motor. See Section 5.4 for more information about driver errors.

#### Set max speed

Command 0xE6 32-bit write max speed, unsigned 32-bitRange: 0 to 500,000,000Units: microsteps per 10,000 s ticcmd --max-speed NUM tic.setMaxSpeed(uint32_t speed)

This command temporarily sets the Tic’s maximum allowed motor speed in units of steps per 10,000 seconds. The provided value will override the corresponding setting from the Tic’s non-volatile memory until the next Reset (or Reinitialize") command or full microcontroller reset.

#### Set starting speed

Command 0xE5 32-bit write starting speed, unsigned 32-bitRange: 0 to 500,000,000Units: microsteps per 10,000 s ticcmd --starting-speed NUM tic.setStartingSpeed(uint32_t speed)

This command temporarily sets the Tic’s starting speed in units of steps per 10,000 seconds. This is the maximum speed at which instant acceleration and deceleration are allowed; see Section 5.1 for more information. The provided value will override the corresponding setting from the Tic’s non-volatile memory until the next Reset (or Reinitialize) command or full microcontroller reset.

#### Set max acceleration

Command 0xEA 32-bit write max accel, unsigned 32-bitRange: 100 to 2,147,483,647 = 0x64 to 0x7FFF FFFFUnits: microsteps per 100 s² ticcmd --max-accel NUM tic.setMaxAccel(uint32_t accel)

This command temporarily sets the Tic’s maximum allowed motor acceleration in units of steps per second per 100 seconds. The provided value will override the corresponding setting from the Tic’s non-volatile memory until the next Reset (or Reinitialize) command or full microcontroller reset.

If the provided value is between 0 and 99, it is treated as 100.

This command does not affect the max deceleration, even if the “Use max acceleration limit for deceleration” checkbox in the Tic Control Center is checked. See the set max deceleration command.

#### Set max deceleration

Command 0xE9 32-bit write max decel, unsigned 32-bitRange: 100 to 2,147,483,647 = 0x64 to 0x7FFF FFFFUnits: microsteps per 100 s² ticcmd --max-decel NUM tic.setMaxDecel(uint32_t decel)

This command temporarily sets the Tic’s maximum allowed motor deceleration in units of steps per second per 100 seconds. The provided value will override the corresponding setting from the Tic’s non-volatile memory until the next Reset (or Reinitialize) command or full microcontroller reset.

If the provided value is 0, then the max deceleration will be set equal to the current max acceleration value. If the provided value is between 1 and 99, it is treated as 100.

#### Set step mode

Command 0x94 7-bit write step mode, unsigned 7-bit0: Full step1: 1/2 step2: 1/4 step3: 1/8 step4: 1/16 step (Tic T834 and Tic T825 only)5: 1/32 step (Tic T834 and Tic T825 only)6: 1/2 step 100% (Tic T249 only) ticcmd --step-mode MODE(full, half, 1, 2, 2_100p, 4, 8, 16, 32) tic.setStepMode(TicStepMode mode)(TicStepMode::Full, TicStepMode::Half, TicStepMode::Microstep1, …, TicStepMode::Microstep32)

This command temporarily sets the step mode (also known as microstepping mode) of the driver on the Tic, which defines how many microsteps correspond to one full step. The provided value will override the corresponding setting from the Tic’s non-volatile memory until the next Reset (or Reinitialize) command or full microcontroller reset.

#### Set current limit

Command 0x91 7-bit write current limit, unsigned 7-bitRange: 0 to 124Units: See Section 6 ticcmd --current NUM(in mA) tic.setCurrentLimit(uint16_t limit)(in mA)

This command temporarily sets the stepper motor coil current limit of the driver on the Tic in units of 32 milliamps. The provided value will override the corresponding setting from the Tic’s non-volatile memory until the next Reset (or Reinitialize) command or full microcontroller reset.

Note that the Tic Command-line Utility and the Tic Arduino library use units of milliamps instead.

#### Set decay mode

Command 0x92 7-bit write decay mode, unsigned 7-bitTic T500:0: AutomaticTic T834:0: Mixed 50%1: Slow2: Fast3: Mixed 25%4: Mixed 75%Tic T825:0: Mixed1: Slow2: FastTic T249: 0: Mixed ticcmd --decay MODE(mixed, slow, fast, mixed25, mixed50, mixed75) tic.setDecayMode(TicDecayMode mode)(TicDecayMode::Mixed, TicDecayMode::Slow, TicDecayMode::Fast,TicDecayMode::Mixed25, TicDecayMode::Mixed50, TicDecayMode::Mixed75)

This command temporarily sets the decay mode of the driver on the Tic. For more information about the decay mode, see Section 6 and the driver datasheet. The provided value will override the corresponding setting from the Tic’s non-volatile memory until the next Reset (or Reinitialize) command or full microcontroller reset. If the command contains an unrecognized decay mode, the Tic will use decay mode 0. Although the decay mode on the Tic T500 and Tic T249 is not configurable, those Tics still accept this command.

#### Set AGC option

Command 0x98 7-bit write Upper 3 bits specify which AGC option to temporarily change:0: AGC mode1: AGC bottom current limit2: AGC current boost steps3: AGC frequency limitThe lower 4 bits specify the new value of that option. See the documentation of the corresponding settings in Section 6. ticcmd --agc-mode MODE (on, off, active_off)ticcmd --agc-bottom-current-limit LIMIT (45, 50, 55, 60, 65, 70, 75, 80)ticcmd --agc-current-boost-steps STEPS (5, 7, 9, 11)ticcmd --agc-frequency-limit LIMIT (off, 225, 450, 675) tic.setAgcMode(TicAgcMode mode)tic.setAgcBottomCurrentLimit(TicAgcBottomCurrentLimit limit)tic.setAgcCurrentBoostSteps(TicAgcCurrentBoostSteps steps)tic.setAgcFrequencyLimit(TicAgcFrequencyLimit limit)(see Tic.h for allowed enum values)

This command is only valid for the Tic T249. It temporarily changes one of the configuration options of the Active Gain Control (AGC). The provided value will override the corresponding setting from the Tic’s non-volatile memory until the next Reset (or Reinitialize) command or full microcontroller reset.

#### Get variable

Command 0xA1 Block read block of data from variables ticcmd -sticcmd --status(shows info with important variables) ticcmd -s --fullticcmd --status --full(shows info with all variables) (see the tic.get____() functions)

This command reads a block of data from the Tic’s variables; the block starts from the specified offset and can have a variable length. See Section 7 for the offset and type of each variable.

#### Get variable and clear errors occurred

Command 0xA2 Block read block of data from variables (see tic.getErrorsOccurred())

This command is identical to the Get variable command, except that it also clears the “Errors occurred” variable at the same time. The intended use of this command is to both read and clear the “errors occurred” variable so that whenever you see a bit set in that variable, you know it indicates an error that occurred since the last “Get variable and clear errors occurred” command.

#### Get setting

Command 0xA8 Block read block of data from settings ticcmd --get-settings FILE(reads all settings from device to file) tic.getSetting(uint8_t offset, uint8_t length, uint8_t * buffer)

This command reads a block of data from the Tic’s settings (stored in non-volatile memory); the block starts from the specified offset and can have a variable length. While some of the Tic’s settings can be overridden temporarily using other commands documented in this section, the settings that this command accesses are stored in non-volatile memory and can only be changed using the Set setting USB command. See Section 6 for the offset and type of each setting.

#### Set setting (USB only)

Command 0x13 special (see Section 11) setting data, 8-bit ticcmd --settings FILE(writes all settings from file to device)

This command writes a byte of data to the Tic’s settings (stored in non-volatile memory) at the specified offset. It is not available on the TTL serial and I²C interfaces. The Tic Control Center software uses this command when you click the “Apply settings” button.

Be careful not to call this command in a fast loop to avoid wearing out the Tic’s EEPROM, which is rated for only 100,000 write cycles.

#### Reinitialize (USB only)

Command 0x10 Quick none

This command reloads all settings from the Tic’s non-volatile memory and discards any temporary changes to the settings previously made with serial commands (this applies to the step mode, current limit, decay mode, max speed, starting speed, max acceleration, and max deceleration settings). It does not have any of the other effects of the Reset command, instead applying the new settings seamlessly if possible. This command is not available on the TTL serial and I²C interfaces.