Generation of PWM wave with DMA
- July 13, 2019
- 5 replies
- 1731 views
Hello all,
Good day!
I am working on a project to drive WS2812B RGB leds using STM32F030R8.
These leds needs precisely timed signals of 800KHz.
I am using a timer in PWM generation mode with DMA.
These leds require each bit of data to be 1.25us long.
When we have to send '1' then the High time needs to be (2/3)rd of 1.25us, and for sending '0' high time needs to be (1/3)rd of 1.25us.
I am storing data for LED in LEDBuffer array and pass it to DMA to send in coordination with timer. But it is not generating the waves as per requirements.
In order to verify my code, I tried sending only 1 byte from LEDBuffer, and it works as expected, but the same doesn't work for more than 1 byte.
I have attached my project and CubeMX file.
I will be really very grateful if someone can help me out of this.
Thanking you in anticipation.