UART Interface

Connection

Using the datasheet (Pro, S1) as a reference, UART should be connected like this:

  • Supply 3.3V - 5V to ISO VDD with respect to ISO GND. The logic level of UART TX and UART RX is defined by the voltage you supply to ISO VDD.

  • Connect UART TX <=> Rx of other device

  • Connect UART RX <=> Tx of other device

  • Connect ISO GND <=> GND of the other device

Configuration

The ODrive’s UART interface is disabled by default. Identify the RX and TX gpio numbers from the datasheet (Pro, S1) and enter the following to enable:

odrv0.config.enable_uart_a = True
odrv0.config.gpio(RX)_mode = GpioMode.UART_A
odrv0.config.gpio(TX)_mode = GpioMode.UART_A
odrv0.save_configuration()

Once enabled, the UART interface by default runs the ASCII Protocol at a baudrate of 115200. This setting is compatible with the Arduino Library.

For other use cases, you might want to change the baudrate or the protocol:

Name

Type

Default

odrv0.config.uart_a_baudrate

unsigned int

115200

odrv0.config.uart0_protocol

StreamProtocolType

StreamProtocolType.ASCII_AND_STDOUT