cancel
Showing results for 
Search instead for 
Did you mean: 

Pwm mode 2 question

jiu
Associate

Hi, I'm studing STM32F4.

I'm looking at pwm mode in timer, and I wonder if there's a difference between using pwm mode 2 and using pwm mode 1 to invert using CCMR1 register.

2 REPLIES 2
MikaelM
ST Employee

Hello @jiu ,

actually they are each other opposite :

MikaelM_0-1697610634902.png

You could find the information in the reference manual of stm32f4 :

https://www.st.com/resource/en/reference_manual/rm0090-stm32f405415-stm32f407417-stm32f427437-and-stm32f429439-advanced-armbased-32bit-mcus-stmicroelectronics.pdf

best regards

Mikael

If you feel a post has answered your question, please click Accept as Solution.

> difference between using pwm mode 2 and using pwm mode 1 to invert using CCMR1 register

You mean, is PWM mode 2 identical to PWM mode 1 inverted using TIMx_CCER.CCxP? In the simple case of simple PWM output, yes.

Difference occurs only in more complex usage, involving OCxRef signal, e.g. using the Fast mode (set by TIMx_CCMRx.OCxFE) and OCxRef clear (see TIMx_CCMRx.OCxCE). Output polarity also matters in states involving Break, see Advanced Timers.

JW