PWM outputs not working when Automatic Output State (TIMx_BDTR->AOE) parameter is disabled, even though TIM Break Inputs (TIMx_BDTR->BRKE/BRK2E) are disabled.
- December 18, 2020
- 3 replies
- 2476 views
I'm trying to setup single-pin, unpiolar PWM Generation outputs on Timers 8, 16 and 17 of my STM32 MCU (STM32F303RBTx). I am using the latest version of STM32CubeMX and the STM32CubeF3 firmware package as of today (Dec 18th 2020) to generate the appropriate configuration code. Attached you will find the firmware that I used to test the PWM outputs, as well as the STM32CubeMX file and screenshots of the PWM configurations.
When I disable the Automatic Output State parameter while keeping the TIM Break Input parameter disabled in STM32CubeMX, I am getting no signal from the PWM pins. However, when I enable the Automatic Output State parameter without changing anything else in the code, the my logic analyzer picks up the PWM output with the correct frequency and duty cycle (100Hz and 50%, respectively).
The following is the only code that I have added inside the main() function:
LL_TIM_CC_EnableChannel(TIM8, LL_TIM_CHANNEL_CH3);
LL_TIM_CC_EnableChannel(TIM16, LL_TIM_CHANNEL_CH1);
LL_TIM_CC_EnableChannel(TIM17, LL_TIM_CHANNEL_CH1);
LL_TIM_EnableCounter(TIM8);
LL_TIM_EnableCounter(TIM16);
LL_TIM_EnableCounter(TIM17);The Prescaler, Auto-Reload Register and Compare values are part of the generated code (10, 65454 and 32727, respectively). The timebase frequency is 72MHz.
With the TIM Break Inputs disabled on all three timers, why is the Automatic Output State parameter affecting the PWM output signal? Thanks.
