Archives: Uart

UART command and control for moteus

It has been quite some time since moteus gained the ability to be controlled or monitored over a different communication channel. In fact, the last time was with the permanent switch from RS-485 to CAN-FD way back in 2019 with the first moteus-r4. So, I’m happy to share that as of firmware 1.1.2 moteus now has a second supported communication transport out of the box, logic level UART!

Why UART?

Often it is useful to deploy moteus in a system where it is controlled and monitored by a microcontroller, there is only a single moteus controller, and the total distance between the microcontroller and the moteus is short and without significant electromagnetic interference (EMI). In those cases, using a logic level UART on the microcontroller can save the additional complexity and cost of integrating a CAN-FD controller and transceiver into the host system.

UART tunneling with moteus

With the release of more flexible I/O support, the moteus controller auxiliary port can be used to monitor encoders using an onboard UART. Now, with firmware release 2023-02-01, those UART pins can be used as an arbitrary logic level serial port controlled by the application! Let’s see how to use it below.

First, you will need to look at the pin configuration table to find pins that support UART functionality, and configure them as UART in the “aux?.pins” configuration tree. Next, “aux?.uart.mode” should be set to “kTunnel”, along with the desired baud rate. That’s it on the configuration front.