cancel
Showing results for 
Search instead for 
Did you mean: 

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

sdbangar2807
Associate

​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

1 REPLY 1

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