cancel
Showing results for 
Search instead for 
Did you mean: 

PWM with DMA, 8 bit

SumanB
Associate

I am using STM32F401CCU. I am trying to generate PWM, using DMA. WHen i select DMA data size as word (16bit) it is working. But when I am trying to do Byte (8 bit) it is not working. Is it because the CCRx register 16 bit wide?

Is there any way I can transfer 8 bit data to 16 bit register? I need this to save lot of RAM space.

Please advise

3 REPLIES 3
gbm
Lead III

Yes, this is how it works. No, you can't overcome this. If your task is WS2812 control, then forget the PWM and use SPI. Or change your MCU to F0/G0/L0/L4 and use UART.

My STM32 stuff on github - compact USB device stack and more: https://github.com/gbm-ii/gbmUSBdevice

yes, i am doing this for WS2812. How to do it with SPI? It will be great help, if you can share link for WS2812 control with SPI.

Thanks for your help

S.Ma
Principal

Why not PWM just with timer compare? Some STM32 have channel on compare to update them if dynamic pwm is needed.