2021-07-25 10:34 AM
I have a project which uses CH3N of Timer 1 (not CH3) and activated it as PWM. In Cube everything seems to be activated correctly.
When looking on the output signal, nothing is output unless I activate the CH3N output by Keil debugger or via code as follows:
// To activate PWM on CH3N: Set Register: TIM1_CCER Bit CC3NE = 1;
uint32_t tmpccer;
/* Get the TIMx CCER register value */
tmpccer = TIM1->CCER;
tmpccer |= TIM_CCER_CC3NE;
TIM1->CCER = tmpccer;
There is no parameter option to enable CH3N. Only CH3 is available.
BR
GS
Solved! Go to Solution.
2021-07-26 06:36 AM
For the complementary channels, you use HAL_TIMEx_PWMN_Start instead of HAL_TIM_PWM_Start.
2021-07-25 10:54 AM
> There is no parameter option to enable CH3N. Only CH3 is available.
What do you mean by this? HAL_TIMEx_PWMN_Start takes channel 3 as a parameter.
2021-07-26 01:28 AM
On STM32H74A3 there is Channel 3 and alternatively 3N available. But there is only a parameter TIM_CHANNEL_3 and not TIM_CHANNEL_3N available for HAL_TIM_PWM_Start. Therefore I had to implement the start (enable) for Channel 3N manually.
This was only a hint for the developers of CubeMX that there is a missing gap. I could finally solve the problem as described.
2021-07-26 06:36 AM
For the complementary channels, you use HAL_TIMEx_PWMN_Start instead of HAL_TIM_PWM_Start.
2021-07-26 07:04 AM
Ahhh - I did not know that there is a separate function available!
Thank you for this hint! I will try right away.