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
Sarim-Jalil
Associate II

Hi,

I am not sure if it will answer your query properly but I think this Timer + DMA + PWM  might help you.

Hi thanks but i am looking for Bare-Metal approach of code rather than using HAL Libraries. Because in the reference manual there are no clear step for using Timer DMA

Sarra.S
ST Employee

Hello @DJ1 , 

A similar question has been raised and answered by Jan, you may want to check it out here 

 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

DJ1
Associate III

Hi sarra, thanks but the thing is i am able to generate PWM using timers but not using timer DMA. If you can help me that !

Issamos
Lead II

Hello @DJ1 

This tutorial (guide + vidéo) is downing exactly what you are looking for.PWM with DMA in STM32.

Best regards.

II

You can always explore the HAL function to know what they are doing that you need to do for bare metal to work.

Johi
Senior III

I made some examples in LL_ instead of HAL_ is LL_ ok for you or not "Bare metal" enough?

What *exactly* do you want to do? Details matter.

On what STM32?

What do you already have?

JW

PS. Maybe have a look at "breathing" demo (table-driven version, as the other one is slightly crazy) here.

Hi, so the thing is earlier i tried on how to increase the clock frequency using PLL through bare metal coding/scratch. Now i want to use timers for generating PWM using DMA. So what would be the steps to follow for using PWM with DMA that to coding from scratch/using register without using HAL libraries. I went through the HAL_TIM_PWM_Start_DMA function but could not get much through it.

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