cancel
Showing results for 
Search instead for 
Did you mean: 

Drive low TIM output in not active state

glory_man
Associate II
Posted on July 16, 2013 at 14:24

I have STM32F4-discovery board. And I use code from example to configure PWM output.

Chapter 14.4.9 TIMx capture/compare enable register (TIMx_CCER) of RM0090:

  Bit 0 CC1E: Capture/Compare 1 output enable.

    CC1 channel configured as output:

      0: Off - OC1 is not active

      1: On - OC1 signal is output on the corresponding output pin

CCxE bit = 0 - Output Disabled (OCx=0, OCx_EN=0)

I tried to use following  configuration for TIM3 in PWM mode:

  TIM_OCInitStructure.TIM_OCMode = TIM_OCMode_PWM1;

  TIM_OCInitStructure.TIM_OutputState = TIM_OutputState_Disable;

  TIM_OC1Init(TIM3, &TIM_OCInitStructure);

  TIM_OC1PreloadConfig(TIM3, TIM_OCPreload_Enable);

But in fact output line is in high state. Is it possible to drive timer/pwm output line to low state?

#discovery #stm32 #output #pwm
1 REPLY 1
Amel NASRI
ST Employee
Posted on July 31, 2013 at 11:39

The configuration should be similar to the following:

TIM_OCInitStructure.TIM_OutputState = TIM_OutputState_Enable; 
TIM_OCInitStructure.TIM_OutputNState = TIM_OutputNState_Enable; 
TIM_OCInitStructure.TIM_OCPolarity = TIM_OCPolarity_Low; 
TIM_OCInitStructure.TIM_OCNPolarity = TIM_OCNPolarity_Low; 
TIM_OCInitStructure.TIM_OCIdleState = TIM_OCIdleState_Set; 
TIM_OCInitStructure.TIM_OCNIdleState = TIM_OCIdleState_Reset;

-Mayla-

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.