Electronics > Projects, Designs, and Technical Stuff

STM32 pins for 2 PWM signals in phase and 180 out of phase

(1/1)

ricko_uk:
Hi,
I am new to STM32 and am using a STM32L452RET6 to generate two PWM signals so that they can be configured via software to sometimes work in phase with each other (as if they are the same signal) and some other times to work 180 out of phase (when one is low the other is high and viceversa).

I am currently using PA0 to generate the first PWM. But looking at the datasheet I am not sure which mode and pin could be used for a complimentary signal that could also be in phase just by different configuration.

Could someone please point me in the right direction?

If for some reason it is preferred to use another pair of pins, could you please suggest which ones.

Thank you ‌

thm_w:
You can use STM32Cube to look at pin functions. Click on Timers then TIM1 on the left side.
You could use TIM1_CH1 and TIM1_CH1N, then you only need to set the Polarity and one will be inverted from the other or not.

Its also possible to just use another PWM channel, then set the settings for each one to be the same, other than Polarity, eg:
PA0 = TIM2_CH1. PA1, TIM2_CH2.

ricko_uk:

Thank you thm_w

Navigation

[0] Message Index

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod