STM32F0 timer interrupt frequency speed droping
Hello everybody
I am using stm32f030F4 in my project and i need a timer with frequency 200kHz
I set timer1 for this frequency and toggled a pin in timer callback function and watch with oscilloscope
i can see a signal with frequency 100kHz this is ok so far but when i made some additional operations like toggle another pin the interrupt frequency speed droping about 4kHz if i add one more toggling it is dropping about 40kHz
And i tried to make it with flag and do the operations in while loop but it is also droping so i cant make the system work stable.
i am using stmcubemx to create project and i set timer and others clock 48 MHz
my timer configuration is like that:
htim1.Instance = TIM1;
htim1.Init.Prescaler = 0; htim1.Init.CounterMode = TIM_COUNTERMODE_UP; htim1.Init.Period = 239; htim1.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1; htim1.Init.RepetitionCounter = 0;I really need your helps.
Maybe i am missing somewhere because when i look datasheet i see it need to work.
thanks for your helps
#hal #frequency #timer #clock #stm32f0