I want to generate 2 PWM on PC6 & PC7 on an STM32f10x , it work fine but , the problem that I have is that I want to make them phase shifted to each other , say 45° and I really don't how to do that, since the PWM started at the same time. any idea how tihis could be made.

thanks for any hint

  • \$\begingroup\$ A complex waveform like PWM has many frequencies and therefore many phase relationships. 45 degrees is meaningless - I think you want a fixed time displacement. \$\endgroup\$ – Andy aka Jul 10 '15 at 8:19
  • \$\begingroup\$ @Andyaka NO the fequency it'S about to signals with the same frequency that are phase shifted to eached other \$\endgroup\$ – Engine Jul 10 '15 at 8:26
  • \$\begingroup\$ that makes absolutely no sense \$\endgroup\$ – Andy aka Jul 10 '15 at 8:27
  • \$\begingroup\$ why not how do you want to control a 3 or 4 phase motor ? \$\endgroup\$ – Engine Jul 10 '15 at 8:32
  • 1
    \$\begingroup\$ I am not familiar with that STM32, but PWM engines that have that possibility are generally advertised as such. Instead of one match register per channel they have two (plus one to reset the counter). \$\endgroup\$ – Wouter van Ooijen Jul 10 '15 at 8:35

If you want to do that inside your code, try taking a look at this solution. Alternatively, you could use a special IC for this task. Here is the example


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.