Skip to main content
fvi
Visitor II
May 28, 2022
Question

nucleo-f439zi pwm not working?

  • May 28, 2022
  • 1 reply
  • 818 views

I am trying to configure PWMs on the user leds uisng the nucleo-f4329zi board (default preconfigured project) and the visual configuration of the STM32CubeIDE, but for some reason some PWM are not working.

My setup for all all PWM (aside from default values):

  1. clock source = internal clock
  2. channelX = PWM Generation CHX (or CHXN)
  3. counter period = 999
  4. auto-reload preload = enabled
  5. pulse = 499
  6. in main.c = using HAL_TIM_PWM_Start() after timer MX_TIMX_Init()

I tried the following PWMs:

  • TIM1_CH2N (PB0 - Green LED) - Fail
  • TIM8_CH2N (PB0 - Green LED) - Fail
  • TIM3_CH3 (PB0 - Green LED) - Fail
  • TIM1_CH2N (PB14 - Red LED) - Fail
  • TIM8_CH2N (PB14 - Red LED) - Fail
  • TIM12_CH1 (PB14 - Red LED) - Pass
  • TIM4_CH2 (PB7 - Blue LED) - Pass

I was wondering why this is happening, but I have not managed to figure it out yet. Any thoughts?

Thanks.

This topic has been closed for replies.

1 reply

waclawek.jan
Super User
May 29, 2022

TIM1 and TIM8 are Advanced timers, you need to set BDTR.MOE for them to enable outputs.

TIM3_CH3 on PB0 - I don't know, check connections/jumpers/solder bridges on the board, and if it still does not work, read out and check/post content of TIM and relevant GPIO registers.

JW