AnsweredAssumed Answered

Disabling an PWM output enabled channel with SPL lib - STM32F103RB

Question asked by Eugenia Suarez on Mar 22, 2018
Latest reply on May 20, 2018 by Jason Dough

Hello to all of you, 

 

I'm using SPL libs for STM32f103 64 pin mcu and I need 6 tim channel to generate 6 independent pwm signals. But due to the project pinout needs I must to configure the channels from 3 timers. So, I'm using 3 timers: 1, 2 and 3. 

 

SPL lib provide a lot of timer functions, as initialization of output compare structs and output compare channel x. In this init function the channel ccer bit is enabled driving pwm signal to the output channel pin: 

 

/*channel 1 of tim 2*/

TIM_OC2Init(TIM2, TIM_OCInitStruct);

 

My question is, 

 

is there a function that can disable the pwm channel as there is a function for init and start the pwm signal? if not, does it means that these channels will be generating pwm signal -once they are enabled- for ever until the app stops running? What to do if you want to stop only some pwm channel (or more than one) ? is there a type of function for turning back to idle state reset (so Low level signal)?

 

Advanced timers as tim 1 and tim 8 must be enabled and can be disabled with the same function, but this function is only available for them: 

 

TIM_CtrlPWMOutputs(TIM1, ENABLED); //on

TIM_CtrlPWMOutputs(TIM1, DISABLED); //off

 

Any information will be helpful. 

 

Thanks in advance.

Outcomes