Skip to main content
sc0ffer
Associate
December 24, 2018
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).

  • December 24, 2018
  • 2 replies
  • 1847 views

 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.

2 replies

S.Ma
Principal
December 24, 2018

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
December 25, 2018

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

OGhis
Senior
April 6, 2019

Hi,

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