2020-08-15 11:40 PM
STM32F100RBT6 TIM15_CH1 and TIM15_CH1N complementary pwm mode does not generate the complementary output
I have a problem with my complementary output generation at Timer 15 Channel 1. I have set all parameters at CubeMX and have set
HAL_TIM_PWM_Start(&htim15,TIM_CHANNEL_1);
HAL_TIMEx_PWMN_Start(&htim15,TIM_CHANNEL_1);
inside USER CODE BEGIN 2.
The output for PB14 (TIM15_CH1) works very well but PB15 (TIM15_CH1N) is always set to 0 and nothing actually takes place. I don't know what is wrong since I have set all parameters the way I always do when dealing with for instance TIM1 for complementary output.
Below there is an image with further details regarding the pins and features I am using in the microcontroller.
Thank you in advance.
2020-08-16 12:45 AM
Read out and check/post content of TIM and relevant GPIO/AFIO registers.
JW
2020-08-16 02:22 AM
Did the ST standard example work?
https://github.com/STMicroelectronics/STM32CubeF1/tree/master/Projects/STM3210E_EVAL/Examples/TIM/TIM_ComplementarySignals
2020-08-16 10:01 AM
When I use TIM1 it works fine, but as soon as I try TIM15 the system only enables the non-complementary output, whereas the complementary remains inactive I don't know why.
2020-08-16 10:21 AM
I have read and I could enable the TIM15 non-complementary output (PB14). The complementary (PB15) has not been enabled though, and that makes no sense since I have enabled all things properly (I guess so) on CubeMX and the complementary is working the way I have set it.
2020-08-16 11:53 AM
> The complementary (PB15) has not been enabled though,
You mean TIM15_CCER.CC1NE = 0? Then you either find the bug in Cube which prevents it from being set, or simply don;'t use Cube.
JW
2020-08-16 12:33 PM
I tried setting TIM15_CCER.CC1NE=1 at the start up functions before while(1) yet it didn't work and only the non-complementary output is working. I'm struggling in order to find what is causing this failure.
2020-08-16 02:55 PM
Read out and post content of TIM and relevant GPIO/AFIO registers.
JW
2020-11-01 03:06 PM
See an old post about a missing setup of the complementary output:
It seems the MX cube has a bug so it wont create complementary output (CH1N)
I had a simelar example where I needed to add this to the code:
HAL_TIMEx_PWMN_Start(&htim1, TIM_CHANNEL_1);
Cheers
Klaus
2020-11-01 05:12 PM
> HAL_TIMEx_PWMN_Start(&htim1, TIM_CHANNEL_1);
Isn't the same line mentioned in the opening post?
JW