5. UART Interface

5.1. Introduction

UART is used to connect third-party platforms with EP. You can easily establish a connection between the MCU mounted on EP and EP through UART and implement the interactive logic on the MCU. Then, you can use the cleartext SDK to communicate with the EP robot to implement automatic EP control.

5.2. Pin description

The UART interface of EP is on the motion controller, and the pins are described as follows:

../_images/uart.png

5.3. Serial port configuration

5.4. Third-party platform connection method

Refer to UART connection.

5.5. Python programming example

  1. The PC is connected to the UART interface of the EP motion controller through a serial-to-USB adapter.

  2. Turn on the serial-port debugging assistant on the PC. Then, select and enable the COM port corresponding to the serial port.

  3. Open the official app that has established a connection with EP and enter the Python programming mode.

  4. On the Python programming page, write a simple program, using read_string() to read data from the serial port. Next, output the data and forward it with write_string(). Then, click the “Start” button to run the program.

  5. Send a string by using the serial-port debugging assistant to see if you can receive the string correctly. Meanwhile, check whether the string is correctly output on the app.

    ../_images/uart_serial.png

    The serial debugging assistant sends and echoes the string

    ../_images/uart_pc.png

    The app outputs the received string and then forwards it

5.6. Cleartext SDK example

  1. The PC is connected to the UART interface of the EP motion controller through a serial-to-USB adapter.

  2. Turn on the serial-port debugging assistant on the PC. Then, select and enable the COM port corresponding to the serial port.

  3. Send the command; string through the serial-port debugging assistant. If you receive ``ok’’ from EP, the cleartext SDK successfully parsed the sent string.

    ../_images/uart_serial_sdk.png

    The serial debugging assistant sends the SDK string and receives the response

警告

When sending a cleartext SDK command through UART, you must append a semicolon (;) after the command, otherwise parsing will fail.

5.7. Python API

Refer to UART.