Skip to main content
sdbangar2807
Visitor II
May 27, 2023 8:05 AM UTC
Question

I am trying to toggle led(PA5) with timer and interrupt but it's not working

​using Nucleof446RE

I have set my prescaler value -700

ARR- ​60628

TIM6_clk ​=85MHz

Which would create 0.5s ​delay in toggle led PA5

​

​and also added (main code)

HAL_TIM_Base_Start(&htim);

And

Void H​AL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim){

HAL_GPIO_TogglePin(GPIOA,GPIO_PIN_5);

}

​

Code runs without any error ​

​But the led is not blinking I am confused what is problem

​

I am newbie in st community

Just started using ​STM32 4 days ago

​

​

​

This topic has been closed for replies.

1 reply

waclawek.jan
Super User
May 27, 2023 9:15 AM UTC

In debugger, read out and check/post content of TIM and relevant GPIO registers.

Also make sure you enable the interrupt in timer and in NVIC, and you have written and compiled the proper ISR with proper name. Generic interrupt-related checklist here.

JW