Home Dev-board Bootloader TFTP DMX512 RDM Pixel LTC SMPTE Ethernet Memory GitHub Contact PayPal.Me Donate

Modern, high-performance pixel control for Cortex-M

A highly optimized Art-Net and sACN pixel controller for GD32 Cortex-ARM microcontrollers, built around a Timer → DMA → GPIO architecture for deterministic timing, minimal CPU overhead, and maximum output efficiency. This design uses the hardware exactly where Cortex-ARM performs best: timers for precise scheduling, DMA for data movement, and GPIO for direct waveform generation.

Key features: Support for: Quick links:

Timer → DMA → GPIO

The output engine uses two timers in master-slave mode. The master generates the DMA requests and the slave acts as the pixel buffer counter. There is just one interrupt for the transfer lifecycle. This makes the design exceptionally efficient for Cortex-M, because the waveform generation is handled by hardware rather than software polling or tight interrupt loops.

Why this architecture is so effective on Cortex-ARM

RTZ protocol DMA requests

For RTZ protocol pixels there are three DMA requests:

  1. Always the HIGH output.
  2. The LOW output for a 0 code.
  3. Always the LOW output after T1H.
Timer DMA GPIO waveform generation for WS2812B

Timers used

2 Master → TIMER2_TRGO
3 Slave → ITI2

DMA channels used

MCU Family Channnel 0 Channnel 1 Channnel 2 Channnel 3 Channnel 4 Channnel 5 Channnel 6 Channnel 7
GD32F20x DMA 0 TIMER2_CH2 TIMER2_CH3 TIMER2_CH0
DMA 1
GD32F4xx DMA 0 TIMER2_CH3 TIMER2_CH0 TIMER2_CH2
DMA 1

SPI/I2S

As the SPI speed cannot be specified exaclty, the I2S peripheral is used instead. SPI speed = I2S bitrate = Audio sample rate * number of bits per channel * number of channels. Therefore, the Audio sample rate = SPI speed / 16 / 2. For the WS2812B type protocol, the SPI speed must be (close to) 6.4Mhz.

Clock tree

MCU CK_SYS CK_I2S
GD32F103RC 108MHz 108MHz
GD32F303RC 120MHz 120MHz
MCU CK_SYS HXTAL PREDV1 PLL2MF CK_PLL2 x2 CK_I2S
GD32F107RC - 25MHz /5 x16 80Mhz 160Mhz
GD32F207RG - 25MHz /5 x16 80Mhz 160Mhz
GD32F207VC - 25MHz /5 x16 80Mhz 160Mhz

I2S prescaler Configuration

I2S bitrate = CK_I2S / (DIV * 2 + OF)
MCU CK_I2S DIV OF I2S bitrate
GD32F103RC 108MHz 8 1 6.352.941
GD32F107RC 160Mhz 12 1 6.400.000
GD32F207RG 160Mhz 12 1 6.400.000
GD32F207VC 160Mhz 12 1 6.400.000
GD32F303RC 120MHz 9 1 6.315.790

Development boards

GD32F207RG-Pixel-8U-board GitHub forks GitHub Repo stars
GD32F450VI-Pixel-DMX512-board GitHub forks GitHub Repo stars
GD32F470VG-Pixel-16U-board GitHub forks GitHub Repo stars