Skip to main content
Sunday Ezeilo
Associate
July 25, 2017
Question

Help with Center aligned PWM

  • July 25, 2017
  • 1 reply
  • 1681 views
Posted on July 25, 2017 at 08:15

How can I generate 360 degree out of phase center-aligned PWM waveform (modified sine wave) on two pins with STM32F103?

#stm32f103-pwm
This topic has been closed for replies.

1 reply

Vangelis Fortounas
Associate II
July 25, 2017
Posted on July 25, 2017 at 15:15

Hello!

It is not posible with no external hardware to create theese waveforms  (you don't have negative voltage at any pin. In case you set VDD/2 as zero voltage you need  external componets to set. I do not suggest this.)

You can produce this waveform by a transformer in push pull setup .. (use mosfets or IGBT in case you make an inverter)

The drive circuit includes also Gate drivers (totem pole outputs) .

The MCU PWM output center mode is the less important in this setup.

Sunday Ezeilo
Associate
July 25, 2017
Posted on July 25, 2017 at 20:16

Thanks, Vangelis!

I thinks you didn't get it. To generate modified sine wave, you need to run your PWM hardware in center-aligned mode. In doing so you will have a pin generate the upper half of the waveform I attached to my previous post. Now having two pins generate signals in phase-shifted manner, you obtain exactly what you see in that picture. Now my challenge is just how to make the two signals out of phase. Special PWM chips do that by hardware but I want to use my MCU for other tasks too.

Hope you get it now.

Thank you!

Vangelis Fortounas
Associate II
July 25, 2017
Posted on July 25, 2017 at 20:48

Hello again Sunday!!!

Sorry still i dont understand . In Modified sine we have 3 states. (Squarewave has two states) 

1. upper peak.

2 .Zero state (or midle state)

3. Negative peak (or ground voltage state)

Please describe what the states of two

Digital

pins would be to complete the table.0690X00000603ySQAQ.jpg

Rgrds