AutomationShield
Arduino library and MATLAB/Simulink API for the AutomationShield Arduino expansion boards for control engineering educa…
STM32Duino library for RGB, Monochrome and Two-color led matrix panels
git clone https://github.com/board707/DMD_STM32.gitboard707/DMD_STM32This is a library that supports almost all types of monochrome and RGB LED panels using the HUB08, HUB12, and HUB75 interfaces. It runs on the STM32 and RP2040-based controllers in the Arduino environment.
The library’s main purpose is to collect knowledge about LED panel types and protocols. Please note: this project is not a finished product. It is an experimental platform for testing and implementing different software and hardware approaches for working with matrix panels.
There is no strict development plan. The project evolves in directions that interest the author and users. The project does not receive commercial support. The author would be grateful for your ideas, links to documentation, and samples of unusual panels and controllers for study.
If you find this library interesting, please consider starring it.
Starting with v1.2.12, we began gradually adding support for STMicroelectronics (STM32duino) package for STM32. The Monochrome and RGB classes are partially implemented. RGB DMA mode and sPWM drivers are not yet supported.
The latest library versions are experimental and are not included in the official release. Please use the GitHub "Download" button to update. If you are using RP2040 or an STM32 with the old RogerClark add-on, we recommend still using release 1.2.11.
Since v1.2.5 release the library introduces comprehensive support for a set of new "PWM-type" LED drivers previously unsupported by most known libraries. The supported chips represents a three distinct PWM driver control architectures:
Compatibility and Requirements: In case of STM32 core using a STM32F4 boards is strongly recommended. See Notes about using a SPWM Drivers for details. Recommended to use a dmd_spwm_panel example as a starting point.
Attention! Recent versions are incompatible with code prior v1.0.0 The main difference from 0.x.x versions is a new panel template format. You can see a brief explanation in the Wiki/About matrix patterns and in the comments of the DMD_Panel_Templates.h file.
Last version with old panel templates v0.9.5
The library initially started out as STM32 port of Freetronics DMD library (https://github.com/freetronics/DMD). Now it has grown into a separate project with support for different types of monochrome, two-color and RGB panels.
One of the important features of the library is support of Adafruit GFX format fonts: https://learn.adafruit.com/adafruit-gfx-graphics-library/using-fonts. Using Adafruit fontconvert utility allows users to convert and display on DMD matrix Truetype fonts, including Unicode fonts with national characters of almost any language. The library includes Cyrillic and Turkish fonts. For using of national fonts, see the examples dmd_rgb.ino and dmd_rgb_turk.ino (Turkish).
The main advantage of the library, which distinguishes it from its analogues, is the very wide range of supported RGB panels. Modules of almost any size, multiplexing type and scanning pattern can be used. All these are configured by "matrix pattern" - a strings of digits, represents a key characteristics of given panel. The library does provide to users a rich set of predefined matrix patterns, and if some panel is missing from the list, it can be easily added without changing the main library code.
| Description | Interface | Pixels | Scan | Code module |
|---|---|---|---|---|
| Monochrome P10 panels | HUB12 | 32x16 | 1/4 | DMD_Monochrome_SPI.h DMD_Parallel.h |
| Indoor RGB | HUB75 | 32x16 | 1/8 | DMD_RGB.h |
| 32x32 | 1/16 | |||
| 64x32 | 1/16 | |||
| 64x64 | 1/32 | |||
| 80x40 | 1/20 | |||
| 128x64 | 1/32 | |||
| Outdoor RGB | HUB75 | 32x16 | 1/2 1/4 1/8 | DMD_RGB.h |
| Two-color indoor | HUB08 | 64x32 | 1/16 | DMD_RGB.h (work as RGB) |
| RGB with FM6126a driver | HUB75 | 64x32 | 1/16 | DMD_RGB_6126a.h |
| RGB S-PWM driver panels | HUB75 | 128x64 | 1/32 | DMD_SPWM_Driver.h |
| supports FM6353/6363/6373 | 64x32 | 1/16 | ||
| ICND1065/2153/2055, DP3264, SM16380sh |
Read more about supported panels in the Wiki/Supported panels. The set of supported matrices is constantly updated.
Adding a new panels to the library
If your panel is not supported by the library yet, please feel free to open an issue using template
There are two ways to install the library:
Sketch > Include Library > Add . ZIP Library. Choose the zip file you just downloaded.Sketch > Include Library > Manage Libraries inside your Arduino IDE and search for the library, then click Install.Adafruit_GFX library
DMD_STM32a project requires Adafruit GFX library
STM32 — two cores, selected automatically at compile time:
| Core | Arduino package | When active |
|---|---|---|
| Roger Clark (libmaple) | Arduino_STM32 | __STM32F1__ / __STM32F4__, without ARDUINO_ARCH_STM32 |
| STM32duino | Arduino Core STM32 | ARDUINO_ARCH_STM32 → DMD_STM32DUINO |
Roger Clark uses the original path (stm_int.h, libmaple timers/GPIO). STM32duino uses a compatibility layer (DMD_STM32duino.h / DMD_STM32duino.cpp). Paths are split with #if defined(DMD_STM32DUINO); building for one core does not replace the other.
Upstream board707/DMD_STM32 documents Roger Clark only. STM32duino support is present in this tree as an additional port.
Roger Clark: core versions before d05a128 (28 Apr 2024) are incompatible with recent Adafruit GFX. Use core ≥ d05a128 or Adafruit GFX ≤ 1.7.0 (v1.7.0).
STM32duino: using DMA in RGB and Monochrome modes are disabled; RGB uses bit-bang, Monochrome SPI uses polling. OE PWM via
DMD_STM32duinoshim.
STM32duino port verified on: STM32F103 (CBT), STM32F401, STM32F411 — RGB panels (DMD_RGB), dual buffer, GFX/Cyrillic fonts. Example: examples/STM32duino/dmd_rgb_effects.
Raspberry Pi Pico/ Pico2
This code requires Earle Philhower core https://github.com/earlephilhower/arduino-pico
For detailed info about matrix connection see Wiki:
Consult the examples for recommended pin combinations.
Sometimes wiring can be tricky so here I will put links to useful PCB-boards for use with this code (are not affiliated with the DMD_STM32)
(09 Dec 2025 - v1.2.4) - Introduced a new class for SPWM type drivers
(22 Dec 2023 - v1.1.2) - Introduced multicolor for fixed and scrolling text
(30 Nov 2023 - v1.1.0) - Add support of panels with FM6353/6363 S-PWM drivers
(25 Mar 2023 - v1.0.4) - Add support of panels with FM6126a chip
(12 Feb 2023 - v1.0.0) - New panel template model with multi-parameter specialization
(16 Sep 2022 - v0.9.0) - Add support of RP2040-based boards and using the DMA in the RGB modes for STM32F4 boards
(10 Jul 2022 - v0.8.0) - Add support of STM32F4 blackpills - STM32F401CC & STM32F411CE (Custom STM32 repo required! see below)
(19 Feb 2022 - v0.7.0) - Add support of "Outdoor" RGB panels with 1/2 1/4 1/8 scans
For full version history see CHANGES.txt
This software is experimental and a work in progress. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
more like this
Arduino library and MATLAB/Simulink API for the AutomationShield Arduino expansion boards for control engineering educa…
☢️ ESP8266 / ESP32 Firmware for collecting and reporting statistics from Geiger counters
search projects, people, and tags