6043

Many modern devices, such as smartphones and other portable devices, no longer feature an analog audio jack. Instead, a digital connection via a USB-C port is gradually becoming the standard, handling audio, data, and power transmission all at once. This evolution opens up new possibilities for system interfacing, control, and integration.

This project explores USB OTG-based control of an 8-watt Xiegu X6200 HF/50 MHz digital radio, commonly used for portable amateur radio operations. This radio features two independent USB-C interfaces, one operating in host mode and the other in device mode, providing a practical example of USB role separation and communication mechanisms.

More broadly, this work aims to present USB device classes, host/device architectures, and the capabilities offered by USB-C and USB OTG for integration into embedded and electronic systems. The concepts discussed are applicable well beyond radio control and can be reused in a wide range of projects involving audio interfaces, HID devices, virtual serial communications, and data acquisition or control systems.

This controller project was chosen to be based on an Espressif ESP32 microcontroller, in order to minimize power consumption while taking advantage of the existing hardware ecosystem and the wealth of feedback from the community. The ESP32-S3-BOX-3 kit quickly emerged as a particularly suitable platform. Based on an ESP32-S3 with a native USB OTG (On-The-Go) interface, it supports operation in both host and device modes depending on the selected configuration. The kit also integrates, within a compact enclosure, a speaker, a microphone, and the associated analog-to-digital (ADC) and digital-to-analog (DAC) converters, connected to the microcontroller via an I2S interface. The system is rounded out by a touchscreen that facilitates remote control of the radio and an expansion connector that allows for the use of the interface card provided as standard as well as the development of a dedicated expansion card. As part of this project, a specific expansion card was prototyped to simplify management and switching between the various USB modes.
elektor



USB port in device mode

The Xiegu X6200's “DEV” USB port, which was originally limited to standard USB accessories, has been expanded using Linux scripts to enable HID control and full-duplex UAC2 audio transmission from an ESP32 running TinyUSB.
elektor



USB Port in Host Mode

The Xiegu X6200’s “HOST” USB port allows an ESP32 to access USB audio streams and CAT commands via the UAC1 and CDC-ACM classes, providing advanced control of the radio.
elektor


Dynamic Power Management

In USB, the general rule is that equipment configured in host mode supplies power to the connected device. Thus, when the controller operates in USB device mode, it is powered directly by the radio. Conversely, when configured in USB host mode, it must itself supply the power required by the various downstream circuits, notably the radio’s internal USB hub, the USB audio codec, and the USB/UART converter.
To ensure safe switching between USB roles, a dedicated power management circuit was prototyped. This circuit is based on the highly integrated MP2722 component, capable of managing and charging Li-ion or Li-polymer batteries up to 5 A. This circuit can operate either completely autonomously or via software control through an I2C interface. For this project, I2C control was chosen to allow the user to explicitly select the operating mode while incorporating several protection mechanisms to prevent any conflict between the two power sources.
Finally, two additional push buttons were integrated onto the board to provide remote PTT (Push-To-Talk) controls and to verify their proper operation in the various USB modes.
elektor
elektor

Conclusion and Outlook

Through this project, the capabilities now offered by modern USB OTG microcontrollers have been explored, both in host and peripheral modes.

In addition, Espressif recently announced the upcoming ESP32-H4 microcontroller, which notably includes support for Bluetooth Low Energy Audio. This could become an interesting feature to integrate into the project in the medium term.

Finally, a GitHub repository has been made available, containing the board schematics, PCB prototypes, and various research materials related to the Xiegu X6200 radio.
https://github.com/pier-cbd/xiegu_x6200_stuff
https://www.elektormagazine.fr/news/kit-aiot-open-source-esp32-s3-box-3-de-nouvelle-generation