cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H750 driving a WS2812B

PNare
Associate III

Hello,

I'm looking to use Timer and DMA to drive a WS2812B LED with a STM32H7. TIM8 Ch2 is connected to the LED. I would like to explain what I understand so that its clear and I can get it working.

  • A half word transfer from a memory location to the CC register on every update is needed for the 24 bit value as well as the reset pulse, so that the PWM pulse is as per the CC value.
  • In CubeMX, the DMA request is then set to update, right? Which essentially means Bit 8 UDE: Update DMA request enable in DIER register is set
  • In DCR register, the DBL is 1 since its only to transfer to CC2 and DBA is also 1 for specifying CC2
  • I'm not sure of what to specify in the DMAR register, is it the address of the memory buffer?
  • DMA settings are straight forward - Normal mode, memory only increment, half word size for both and selecting any one stream for DMA
  • Timer settings are also straightforward - PWM generatation mode with ARR register setting the frequency.

Please let me know if I've missed anything or got anything wrong. Thanks a lot, Prithvi

0 REPLIES 0