Skip to the content.

Command Reference

This document provides detailed specifications for each command in the turntable protocol and how it would be used (read or write) from the perspective of the THREE i2c master.

Command Summary Table

Register Name Direction Data Bytes CRC Description
0x00 STOP_ROT Write 0 Stop rotation immediately
0x02 STATUS_W_POS Read 3 Read status and position
0x03 POSITION Write 2 Set absolute position
0x04 ROTATE_ABS Write 2 Rotate to absolute position
0x08 RAMP_DIST Write 1 Set ramp distance
0x0B ERROR Read 1 Read and clear error code

0x00 - STOP_ROT (Stop Rotation)

Type: Write Command
Purpose: Immediately halt any ongoing rotation

Command Format

[0x00] [CRC]

Parameters

None

Response

No immediate response. Status can be checked with STATUS_W_POS command.

Firmware Behavior

Example

Master writes: [0x00] [0x07]
               Command  CRC

Notes


0x02 - STATUS_W_POS (Status with Position)

Type: Read Command
Purpose: Read current status byte and position in a single transaction

Command Format

Write: [0x02] [CRC]
Read:  [STATUS] [POS_LOW] [POS_HIGH] [CRC]

Parameters

None (write)

Response

Firmware Behavior

Example

Master writes: [0x02] [0x05]
               Command  CRC

Turntable at 90° (0x005A), rotating, boot complete:
Master reads:  [0xC0] [0x5A] [0x00] [0x5E]
               Status  Pos_L  Pos_H  CRC
               
Status 0xC0 = STAT_BOOT (0x80) | STAT_TURN (0x40)

CRC Calculation for Response

// Reverse order: POS_HIGH, POS_LOW, STATUS
data[] = {0x00, 0x5A, 0xC0}
CRC = calculate_reverse_crc(data, 3)

Notes


0x03 - POSITION (Set Position)

Type: Write Command
Purpose: Set the current absolute position without moving the motor

Command Format

[0x03] [POS_LOW] [POS_HIGH] [CRC]

Parameters

Response

No immediate response. New position can be verified with STATUS_W_POS command.

Firmware Behavior

Example

Set position to 0° (zero/home position):
Master writes: [0x03] [0x00] [0x00] [0x5A]
               Cmd    Pos_L  Pos_H  CRC

Set position to 180°:
Master writes: [0x03] [0xB4] [0x00] [0x43]
               Cmd    Pos_L  Pos_H  CRC

Notes


0x04 - ROTATE_ABS (Rotate to Absolute Position)

Type: Write Command
Purpose: Begin rotation to an absolute target position

Command Format

[0x04] [POS_LOW] [POS_HIGH] [CRC]

Parameters

Response

No immediate response. Rotation status tracked via STATUS_W_POS command.

Firmware Behavior

Rotation Direction

The turntable should automatically determine the shortest path:

Example

Rotate to 270°:
Master writes: [0x04] [0x0E] [0x01] [0x9F]
               Cmd    Pos_L  Pos_H  CRC

Status while rotating:
[STATUS] includes STAT_TURN (0x40) set

Status when complete:
[STA~10 seconds
Position reads 270° (0x010E)

Timing Expectations

Error Conditions

Notes


0x08 - RAMP_DIST (Set Ramp Distance)

Type: Write Command
Purpose: Configure the deceleration distance for rotation operations

Command Format

[0x08] [RAMP_ANGLE] [CRC]

Parameters

Response

No immediate response.

Firmware Behavior

Deceleration Profile

The THREE expects smooth deceleration, typically:

Example

Set ramp distance to 15° (default):
Master writes: [0x08] [0x0F] [0x08]
               Cmd    Ramp   CRC

Set ramp distance to 5° (aggressive):
Master writes: [0x08] [0x05] [0x02]
               Cmd    Ramp   CRC

Dynamic Adjustment

The THREE will adjust ramp distance during error recovery:

Initial rotation:     RAMP_DIST = 15°
If timeout/error:     RAMP_DIST = 5-15° (based on remaining distance)
Multiple retries:     RAMP_DISTa djusted down to minimum 5°

Notes


0x0B - ERROR (Read Error Code)

Type: Read Command
Purpose: Read the current error code and clear error state.

Command Format

Write: [0x0B] [CRC]
Read:  [ERROR_CODE] [CRC]

Parameters

None (write)

Response

Firmware Behavior

Example

Read error (rotation timeout):
Master writes: [0x0B] [0x0C]
               Cmd    CRC

Turntable responds: [0x08] [0x0F]
                    Error  CRC
                    
Error 0x08 = ERR_ROT_TIME

Error Code Meanings

Code Mask Name THREE Response
0x01 ERR_PARAM_COUNT Wrong number of bytes Throws exception, stops operation
0x02 ERR_BAD_COM CRC/bus error Throws exception, stops operation
0x04 ERR_UNRECOGNIZED_COM Unknown command Throws exception, stops operation
0x08 ERR_ROT_TIME Rotation timeout Attempts recovery up to 3 times
0x10 ERR_ROT_DIR Wrong rotation direction Throws exception, stops operation

Multiple Errors Example

If both timeout and bad communication occur:
ERROR_CODE = 0x08 | 0x02 = 0x0A

Notes


Command Sequencing

Typical Operation Sequence

Initialization:

1. Open I2C to address 0x45
2. Read STATUS_W_POS → verify STAT_BOOT is set
3. Write POSITION 0° → set home position
4. Write RAMP_DIST 15° → set default ramp
5. Read STATUS_W_POS → verify position is 0°

Normal Rotation:

1. Write ROTATE_ABS target_angle → begin rotation
2. Read STATUS_W_POS → check progress (STAT_TURN should be set)
3. Poll STATUS_W_POS every 100ms → track position
4. Continue polling until STAT_TURN clears and position = target

Error Handling:

1. Read STATUS_W_POS → STAT_ERR is set
2. Read ERROR → get error code, clears errors
3. If ERR_ROT_TIME: adjust RAMP_DIST and retry ROTATE_ABS
4. If other errors: report to user, stop operation

Shutdown:

1. Write STOP_ROT → halt any motion
2. Close I2C connection

Next: See Integration Guide for implementation guidance and requirements.