Saltar a contenido

85. NEOPIXEL con STM32

Modelo CJMCU-8*8 Características:

  • 64 programmable WS2812 LEDs – no need for a separate LED driver is required!
  • Dimensions (LxWxH): 65 x 65 x 3 mm
  • Control of all LEDs via a single data cable

Seguir este tutorial para manejar neopixel con dma

85.1 Alimentación y conexión

Basado en esta web

Consejos iniciales:

  • Siempre conectar primero "-" y desconectar el último

Necesita una alimentación de 5V Se recomienda añadir una resistencia entre 300 y 500 Ohm en la linea de datos (primer neopixel)

Before connecting a NeoPixel strip to ANY source of power, a large capacitor (500–1000 µF at 6.3 Volts or higher) across the + and – terminals provides a small power reservoir for abrupt changes in brightness that the power source might not otherwise handle — a common source of NeoPixel “glitching.”

** Estimación del consumo**

85.2 Configuracion

Seleccionamos TIM2 CH1: En el modo: * Clock source: Internal * Channels: to PWM generation CH1

El resto igual salvo: * Counter Settings - Counter Period to 60 - 1

Next in System Core, go to DMA, and click on Add. You should be able to pick TIM2_CH1 from the drop down menu. Set it to:

  • Direction: Memory to Peripheral
  • Mode: Circular
  • Increment Address: Memory
  • Peripheral Data Width: Word
  • Memory Data Width: Byte

85.3 Programación en STM32

Seguir esta web

85.4 Enlaces neopixel y proyectos

En este video se explica como es el protocolo neopixel y como usar DMA para controlarlo

https://www.thevfdcollective.com/blog/stm32-and-sk6812-rgbw-led

https://forum.digikey.com/t/controlling-neopixels-with-stm32/20527

Con libreria de Arduino