ODrive OA1 Communications Protocol

This page documents the ODrive OA1 communications protocol, for interfacing the encoder with a custom host or microcontroller. If you are looking to use the OA1 with an ODrive only, see RS-485 Encoders instead.

The OA1 is a UART / RS485 device using 2 Mbps, 8N1 framing. The default node address is 0x40. Commands are provided for angle reads, thermistor reads, LED control, configuration, and direct sensor register access.

Note

The RS485 baud rate (2 Mbps) is fixed and cannot be changed.

If you are adapting an existing system that uses AMT21 encoders, see AMT21 Compatibility.

Node Address and Command Encoding

The lower two bits of the node address must be zero. They are used to select one of four command types, so a command byte is the node address OR’d with the command bits. All examples below assume the default node address 0x40.

Single-Byte Commands

Command byte

Function

Response

0b00 (0x40)

Read angle

2 bytes: 14-bit angle with check bits

0b01 (0x41)

Read thermistor

2 bytes: ratiometric u16, low byte first

0b10 (0x42)

Multibyte command prefix

Depends on subcommand (see Multibyte Commands)

0b11 (0x43)

Read angle + thermistor + CRC

5 bytes: angle (2) + thermistor (2) + CRC-8 (1)

Angle Data Format

The angle is a 14-bit value, returned as two bytes, low byte first. Once each byte is reassembled by the UART, the bit layout is:

             bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0
Low byte:     B7   B6   B5   B4   B3   B2   B1   B0
High byte:    K1   K0   B13  B12  B11  B10  B9   B8

B0..B13 = angle bits      angle = ((high & 0x3F) << 8) | low
K1      = odd  check bit
K0      = even check bit

Each check bit is the inverted XOR of alternating angle bits:

K1 = !(B13 ^ B11 ^ B9 ^ B7 ^ B5 ^ B3 ^ B1)
K0 = !(B12 ^ B10 ^ B8 ^ B6 ^ B4 ^ B2 ^ B0)

If either check bit is incorrect, the reading is invalid and must be discarded.

The OA1 also uses the check bits to report when the field strength is out of range: it deliberately inverts a check bit, so an out-of-range field also shows up as a failed check. A single response cannot distinguish a field strength problem from a transmission error, so the reading must be discarded in either case. If the check fails persistently, the field strength is likely out of range. To read the field strength explicitly, use the combined read, which reports it in dedicated flag bits and protects the data with a CRC.

Thermistor Data Format

The thermistor reading is a ratiometric 16-bit value (0x00000xFFFF, low byte first, no check bits), where 0x0000 is 0 V at the input and 0xFFFF is full scale (the ADC reference). The input has an on-board 3.3 kΩ pull-up and a 2.2 µF filter capacitor. For an NTC thermistor referenced to ground, the resistance is:

R_thermistor = 3300 * raw / (65535 - raw)   [ohms]

The 2.2 µF capacitor low-pass filters the input, so allow a short settling time after large changes.

Combined Read with CRC

The 0b11 command returns the angle (2 bytes), the thermistor reading (2 bytes), and a CRC-8 byte computed over those four data bytes. The thermistor bytes use the same format as the 0b01 read. The angle bytes differ from the 0b00 read: the angle is the plain 12-bit sensor reading, and the two MSBs are field strength flags rather than check bits. Data integrity is instead guaranteed by the CRC. The bit layout is:

Low byte:     A7   A6   A5   A4   A3   A2   A1   A0
High byte:    FH   FL   0    0    A11  A10  A9   A8

A0..A11 = angle bits      angle = ((high & 0x0F) << 8) | low
FH      = field strength too high
FL      = field strength too low     (both set = detection failure)

The CRC is CRC-8/SMBUS:

Polynomial

0x07

Initial value

0x00

Reflect in / out

No / No

Final XOR

0x00

Multibyte Commands

Multibyte commands are introduced by the 0b10 prefix (0x42), followed by a subcommand byte and any parameter bytes. The table below lists the subcommand byte (the 0x42 prefix is omitted). All bytes of a multibyte command must be sent back-to-back (see Timing).

Subcmd

Parameters

Response

Description

0x00

none

2 bytes

Device ID. First byte: WHOAMI = 0x01. Second byte: HW revision in the upper nibble (currently 0x0), FW revision in the lower nibble (currently 0x1).

0x01

none

0x00 ACK

Start field strength estimation. The board is unresponsive for ~200 ms afterward.

0x02

none

field strength in mT (1 byte)

Read the estimated field strength. Only valid ≥200 ms after a 0x01 command.

0x03

new address (1 byte)

0x00 ACK / 0x01 ERR

Set the node address (lower two bits must be zero). On ACK the board reboots (~50–100 ms dropout).

0x04

R, G, B (3 bytes)

none

Set the LED color. Disables automatic field strength coloring until the next power cycle.

0x06

register (1 byte)

register value (1 byte)

Read an MA702 sensor register. Returns 0xFF if the register is invalid.

0x07

register (1 byte), value (1 byte)

0x00 ACK / 0x01 ERR

Write an MA702 sensor register (ERR if invalid or read-only). The board is unresponsive for ~20–30 ms.

Timing

The turnaround time for angle reads, measured from the end of the command byte’s stop bit to the start bit of the response, is 3.2 µs. A host driving an RS485 transceiver must release the bus within this window.

Within a multibyte command, the byte-to-byte timeout is 5.5 µs, measured from the end of one byte to the end of the next. A byte takes 5 µs on the wire at 2 Mbps, so this allows about 0.5 µs of bus idle time between bytes. If the timeout expires, the OA1 discards the partial command and returns to waiting for a top-level command byte.

Warning

Due to the byte-to-byte timeout, the host must stream the full command (including parameters) back-to-back, without pauses longer than about 0.5 µs between bytes.

Example

Example transactions for an OA1 at the default node address (0x40):

Read angle:                 send 0x40                        -> 2 bytes
Read thermistor:            send 0x41                        -> 2 bytes
Read angle+thermistor+CRC:  send 0x43                        -> 5 bytes
Read device ID:             send 0x42 0x00                   -> 0x01, HW/FW revision byte
Set LED to yellow:          send 0x42 0x04 0x7F 0x7F 0x00    (no response)

AMT21 Compatibility

The OA1’s RS485 protocol is generally compatible with that of the CUI AMT21 encoder family.

The following are identical:

  • The 2 Mbps, 8N1 framing.

  • The command byte encoding (node address OR’d with a 2-bit command index).

  • The angle read (0b00): response format, byte order, and check bits all match. An AMT21 driver that discards readings on a failed check also handles the OA1’s field strength signaling correctly, without changes.

  • Turnaround time: the OA1 responds after 3.2 µs, slightly above the 3.0 µs minimum in the AMT21 datasheet, so host timing that works for the AMT21 works for the OA1.

The differences:

  • The default node address is 0x40 (AMT21: 0x54).

  • 0b01 reads the thermistor input. On the AMT21 it reads the turn counter. The OA1 is a single-turn encoder and has no turn counter.

  • 0b10 introduces the OA1’s own multibyte commands. The AMT21 extended commands (set zero, reset) are not available. To zero the OA1, write the MA702 zero position registers using subcommand 0x07.

  • 0b11 is the combined read, which the AMT21 does not have.

  • The baud rate is fixed at 2 Mbps.

Bus Coexistence

Bus coexistence requires firmware revision 0x1 or later. The firmware revision is readable with the device ID subcommand (see Multibyte Commands), and units sold after approximately September 2025 ship with revision 0x1. Older OA1 units require a firmware update to share the bus with other devices. Contact us if this is needed.

After seeing a command byte addressed to a different node, the OA1 ignores the bus while the addressed device responds. The ignore window is 20.6 µs for a 0b00 or 0b01 command and 44.7 µs for a 0b10 or 0b11 command, measured from the start of the observed command byte. This prevents the OA1 from mistaking another device’s response for a command, and the windows are short enough that devices can be polled back-to-back at full speed.

The OA1 can share the bus with an AMT212B-V (not -OD) or with a second OA1 at a different node address. The angle read (0b00) and thermistor read (0b01) are validated on a shared bus. The ignore windows are sized to support all commands, but multibyte commands on a shared bus are currently untested.

Coexistence never applies to the AMT21 -OD variants, which send position data continuously without being polled, and thus cannot share the bus with any other device.

To run two RS485 encoders from one ODrive, see RS-485 Encoders.