2014-07-30 3:31 AM
Hi,
setting up timer TIM1 in OnePulse mode does not work on channel 3 and 4.As I figured out, only channels 1 and 2 are handled by HAL_TIM_OnePulse_ConfigChannel.Finally, I have the following issues to be discussed.Any comments are welcome.1. The controller reference manual does not contain such a restriction. Does anyone can tell why channels beyond 2 are disallowed?2. Why does a configuration request for channels 3 and 4 response with HAL_OK despite they are not accepted by the function HAL_TIM_OnePulse_ConfigChannel?3. There is a missing assertion in HAL_TIM_PWM_ConfigChannel:assert_param(IS_TIM_FAST_STATE(sConfig->OCFastMode));In function HAL_TIM_OC_ConfigChannel there is such a assertion despite this configuration parameter is not used.Thanks. #stm32cube-onepulse-pwm2014-09-11 1:59 AM
Hisphere,
You can find below answers to your questions:1.
There is no really such restriction to use Timer in the One Pulse mode. You've just to call HAL_TIM_OnePulse_Init() to Set/Reset the OPM bit. If you need to implement, in addition, the example described within the reference manual, where a TIM channel is used as a trigger and another one as an output channel for the one pulse generated signal, you can use the following provided APIs:HAL_TIM_OnePulse_Start()
HAL_TIM_OnePulse_ConfigChannel()
By the way, the STM32CubeMX tool offers, a checkbox ''one pulse'' to enable/disable the OPM bit.
2.
Although they are not accepted by the function HAL_TIM_OnePulse_ConfigChannel(), the configuration requests for channels 3 and 4 response with HAL_OK. This is due to the disable of the IS_TIM_OPM_CHANNELS assert.3.
Yes, we confirm that an assert is missed. In fact, the fast mode acts only in PWM mode.