Skip to main content
FAleg.1
Associate II
August 16, 2020
Question

STM32F100RBT6 TIM15_CH1 and TIM15_CH1N complementary pwm mode does not generate the complementary output

  • August 16, 2020
  • 7 replies
  • 5264 views

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.

0693W000003PPEjQAO.png

This topic has been closed for replies.

7 replies

waclawek.jan
Super User
August 16, 2020

Read out and check/post content of TIM and relevant GPIO/AFIO registers.

JW

FAleg.1
FAleg.1Author
Associate II
August 16, 2020

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.

prain
Visitor II
August 16, 2020

Did the ST standard example work?

​https://github.com/STMicroelectronics/STM32CubeF1/tree/master/Projects/STM3210E_EVAL/Examples/TIM/TIM_ComplementarySignals

FAleg.1
FAleg.1Author
Associate II
August 16, 2020

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.

waclawek.jan
Super User
August 16, 2020

> 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

FAleg.1
FAleg.1Author
Associate II
August 16, 2020

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.

waclawek.jan
Super User
August 16, 2020

Read out and post content of TIM and relevant GPIO/AFIO registers.

JW

KKrag.1
Associate
November 1, 2020

See an old post about a missing setup of the complementary output:

https://community.st.com/s/question/0D50X00009XkZaBSAV/hal-bug-report-f4xx-timer-complimentary-outputs?t=1604270842087

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

waclawek.jan
Super User
November 2, 2020

> HAL_TIMEx_PWMN_Start(&htim1, TIM_CHANNEL_1);

Isn't the same line mentioned in the opening post?

JW

KKrag.1
Associate
November 2, 2020

Yes, my point was merely that it seems to be an old problem with the MX Cube, still existing problem

waclawek.jan
Super User
November 2, 2020

Ah I see.

JW