CForth based USB/DMX controller with STM32G431
This is an experimental approach for a minimal user programmable USB/DMX512 controller with rather complex built-in possiblities to create auto-running or interactive lighting sequences.
Originally this project was designed with a more conventional ASCII and MIDI based command set without possibililty to create some kind of time-based action flow.
This device it is not intended for big stage shows. But the CForth interpreter provides possibilities to create time based and sensor controlled animated lighting art objects or light installations for buildings or similar.
Two different hardware solutions are provided with almost the same circuit layout.
The firmware is a special version of the
CForth interpreter with
an additional set of DMX related kernel operators (Forth "words") as:
- select the DMX channel ("slot") for subsequent actions
- set DMX levels by different methods
- Hue, Saturation and Luminance of RGB lamps can be set with one command (group of 3 DMX channels)
- set the fade time for DMX level transitions
- "Panic" switch: all DXM levels to zero
- up to 97 lighting scenes can be stored permanently in the microcontroller flash and can be reloaded completely or in parts by CForth command.
- read actual DMX levels ASCII text formatted via terminal
Most essential general features of the CForth-DMX module:
- The terminal is provided via USB as virtual COM port
- With an external USB power bank, standalone operation of a programmed sequence is possible.
- For this reason, an AUTOEXE feature is implemented, which starts a complex program sequence at power on.
- Some manual control of a running show is possible via terminal.
- In addition to DMX bus control, some analog or digital inputs, 1 (or 2) DAC are provided and handled by CForth kernel operators
- An SPI interface, an I2C bus and two PWM pulse outputs are supported by firmware and externally accessible via connector array.
- As an alternative to CForth control, the firmware supports the MiniDMX protocol (selectable on the PCB with a jumper or switch).
A hardware DIY Construction Manual for STM32G431/G441 and STM32F042 (HTML file) is provided here.
Downloads:
The subsequently downloadable material is copyrighted (c)2020-24 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.
Firmware "CForth-G4xx-MINI48.hex" for "minimal USB/DMX conroller", SysClock = 48MHz
(14 March 2024 - improvements and minor bugfixes)
Firmware "CForth-G4xx-MINI144.hex" for "minimal USB/DMX conroller", SysClock = 144MHz
(14 March 2024 - improvements and minor bugfixes)
Firmware "CForth-G4xx-MICRO48.hex" for "minimal USB/DMX conroller", SysClock = 48MHz
(14 March 2024 - improvements and minor bugfixes)
Firmware "CForth-G4xx-MICRO144.hex" for "minimal USB/DMX conroller", SysClock = 144MHz
(14 March 2024 - improvements and minor bugfixes)
Source code "CForth-G4xx-v61.zip"
(state 14 March 2024) This source code is provided as complete "Segger Embedded Studio" project (ZIP file, 1024 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" and startup code), no external drivers or HAL are used.
* State of information March 2024.
* 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.