cancel
Showing results for 
Search instead for 
Did you mean: 

Bare Metal Timer PWM generation using DMA

DJ1
Associate III

Hi guys, Can anyone list out a few steps which need to be followed for bare-metal code generation of using Timer in DMA for PWM generation. 

Thanks!

11 REPLIES 11
LCE
Principal

HAL stuff is hard to read and get through, but (most of) it works.
So you just need lots of concentration and perseverance...

When starting from scratch:
- read the RM
- "collect" relevant registers
- start simple: no settings, just a fixed frequency & duty cycle square
- then add stuff...

PS: DMA is one of the few things I use HAL, many of the HAL_DMA_Start functions are quite "slim" compared to the normal HAL stuff

Which STM32?

> I also tried developing code through registers but in that the PWM is not generating.

Show.

JW

PS. +1 to what @LCE  wrote above.