Skip to main content
JMene.1
Associate II
Oct 20, 2020 5:34 PM UTC
Solved

I'm using the Nucleo-L152. I want to use the External clock on timer 2 and the counter does not increment. I use the same configuration on timer 3 and the counter increments as expected. Is there any issue with Timer2_ETR?

..

This topic has been closed for replies.
waclawek.jan
waclawek.janBest answer
Super User
Oct 20, 2020 6:43 PM UTC

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

JW

2 replies

waclawek.jan
waclawek.janBest answer
Super User
Oct 20, 2020 6:43 PM UTC

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

JW

JMene.1
JMene.1Author
Associate II
Oct 21, 2020 11:44 AM UTC

Thanks for the tip. Yes I checked and the AFR was not configured correctly. I use the STM32CubeIDE to initialize the ports. When I use PD2 to connect to TIM3_ETR, everything is configured correctly. When I use PA0 to connect to TIM2_ETR, the AFR register is not configured.

Bug in STM32CubeIDE or I misuse it? Anyway, I found my bug.

regards