back to menue

Simple STM32G431 based USB to DMX512 Interface

A simple and compact USB to DMX512 interface based on the STM32G431KB microcontroller (32 pin LQFP) is presented.
A compact and easy to build Veroboard compatible design has been developed. A TIF file for etching a 1-layer PCB is available, but this is only recommended if you have appropriate tools and skills.

DMX commands and power supply are provided via USB.
It is accepted by a host PC as a MIDI interface or as a virtual COM port.

Accordingly, DMX control is possible by MIDI messages as well as by ASCII text based commands.

The USB interface is "full speed USB2.0" grade. The host sided USB class selection between MIDI and virtual COM port is made by a jumper on the SWD connector (may be extended to a switch). The 5V supply (total current no DMX load ca. 30 mA, with terminated DMX bus up to 60 mA) is scaled down by a linear low drop regulator to 3.3V which supplies the microcontroller.

photo of assembled PCB In MIDI as well as in ASCII mode,

When USB works as virtual COM port, the basic MIDI channel and user specific USB Vid/Pid can be configurated specifically. The user setup is stored nonvolatile in the microcontroller flash.

Because no RS-232 interface is installed on the board, the board is programmed (and debugged) via SWD ("Serial-Wire Debug") interface, preferably with ST-LINK, which is connected to the 3 pin socket next to the USB connector.

The source code is quite well suitable as a template for further own development, especially concerning DMX and USB. It is programmed directly on register level, no external libraries or drivers are used.

A detailled construction- and operation manual is provided here (PDF file).

Downloads:
The subsequently downloadable material is copyrighted (c)2020-25 by Wolfgang Schemmert.
Assembly of the devices, programming and use of the software is permitted for free by everybody for any purpose ("freeware"). For commercial use, restrictions of third-party software contributors (Segger GmbH, STM) must be respected.
All information is based on best knowledge, but "as is" and without any warranty. Any responsibility is excluded. Use for dangerous, life-threatening and medical applications is forbidden.

PCB layout for the USB-DMX-G431 Veroboard version
(1:1 TIF format. BOTTOM layer as well as component placement view are "from component side", i.e. BOTTOM layer shown mirrored "through the PCB" (as needed for PCB production))

Firmware "usbdmx-g431.hex" for the for the STM32G431 based USB-DMX interface  (26 January 2025).
Only change against 2021 firmware is change of DMX "Break switch" from PA5 to PA15

Source code "usbdmx-g431v6.zip" for the STM32G431 based USB-DMX interface
(state 26 January 2025) This source code is provided as complete "Segger Embedded Studio" project (ZIP file, 322 kB).
Parts published by Segger GmbH are under license of Segger&|Rowley, parts published by STM are under license of STM, parts programmed by me are provided under GNU GPL3 license.)

This project is programmed directly on register level, no external libraries (except "cmsis", startup code and Segger system code), no external drivers or HAL are used.


back to menue


* State of information January 2025.
* Right of technical modifications reserved. Provided 'as is' - without any warranty. Any responsibility is excluded.
* This description is for information only. No product specifications are assured in juridical sense.
* Trademarks and product names cited in this text are property of their respective owners.