cancel
Showing results for 
Search instead for 
Did you mean: 

delay pwm on time

newbie_to_stm32
Associate

hi there,

i have a NUCLEO-H7S3L8 dev kit and i am trying to generate a specific number of pwm pulse. i want to generate 10 pwm pulse with ability to delay the  t-on. i am trying to workout how to do this in stm32. i am thinking of using pwm with dma. am i in the right track or how should i approach this problem?

below is the example waveform i want to generate. Led0-ref is the reference pwm that will have t-on of 10us and total cycle of 120us. led 1 will use led 0 as the reference to control the delay. as you can see below when there is no delay cycle t-on is 10us and total cycle is 120us. when there is a delay of 3us, the delay total cycle stays the same 120us, only the start of the t-on is on delayed by 3us.

time delays.PNG

 

2 REPLIES 2
whitesmaverick
Associate

For generating 10 PWM pulses with adjustable on-time delay on STM32, using PWM with DMA is a good approach. You can synchronize pulse generation based on your reference PWM and adjust delays using DMA for precise timing control.

AScha.3
Chief II

Hi,

depends on which timer you want to do it....if TIM1 or 8 , it should work with the timer settings :

can set combined mode, to set begin and end of a output pulse, as you want:

AScha3_0-1721025749682.png

+ make just 10 pulses, maybe using the 

AScha3_1-1721026052367.png

 

If you feel a post has answered your question, please click "Accept as Solution".