Skip to main content
sc0ffer
Associate
Dec 24, 2018 3:28 PM UTC
Question

Hello. I have STM32F334 MCU on Discovery board and I want to control two mosfets by alternately switching PWM channels (like on the picture).

 0690X000006CuzXQAS.gifPWM channel 01 controls Mosfet 1, PWM 02 - Mosfet 2. Also I need to insert dead time (dt) between channel switches. My MCU has HRTIM. Is there any way to solve this task using HRTIM? If it possible, what is the best way to reduce IRQ count to reach waveform (sine) generation stability (use DMA or something else)?

This topic has been closed for replies.

3 replies

S.Ma
Principal
Dec 24, 2018 6:34 PM UTC

difficult to know which way would be the most efficient. is a pulse corresponding to a timer full period?

With DMA, you could generate a train of pulses with muted time for each channel.

Or use 2 timers each one generating a pulse and triggered by other timers generating the "timer enable" timewindow... What are the dT value range, the pwm period and the active time of each PWM. Are PWM duty cycle dynamically changing?

sc0ffer
sc0fferAuthor
Associate
Dec 25, 2018 4:37 AM UTC

Yes, i plan to change duty cycle to get sine waveform.

OGhis
Senior
Apr 6, 2019 3:50 PM UTC

Hi,

do you have found a solution to change the duty cycle from a DMA to generate a sine waveform?