Crazy-Geeks / STM32-ARGB-DMA

STM32 Library for Addressable LEDs: WS2812(b), WS2811, SK6812, etc. Supports RGB & RGBW LEDs.
MIT License
84 stars 25 forks source link

STM32F030K6T6 What I'm doing wrong? #12

Open maghostmil opened 10 months ago

maghostmil commented 10 months ago

Hi!

I'm trying to run this library on STM32F030K6T6, but I have a trouble with it. All configs are correctly set, but the frequency is 4 times slower than that supposed to.

Screens: obraz obraz obraz obraz

Of course I added the TIM_NUM 17 to ARGB.c and hard-coded frequency, which should not effect on performance: `void ARGB_Init(void) { u32_t APBfq = 48000000; // Clock freq

ifdef WS2811S`

ARGB.h: `#define WS2812 ///< Family: {WS2811S, WS2811F, WS2812, SK6812} // WS2811S — RGB, 400kHz; // WS2811F — RGB, 800kHz; // WS2812 — GRB, 800kHz; // SK6812 — RGBW, 800kHz

define NUM_PIXELS 100 ///< Pixel quantity

define USE_GAMMA_CORRECTION 1 ///< Gamma-correction should fix red&green, try for yourself

define TIM_NUM 17 ///< Timer number

define TIM_CH TIM_CHANNEL_1 ///< Timer's PWM channel

define DMA_HANDLE hdma_tim17_ch1_up ///< DMA Channel

define DMA_SIZE_WORD ///< DMA Memory Data Width: {.._BYTE, .._HWORD, .._WORD}`