cancel
Showing results for 
Search instead for 
Did you mean: 

TIM2 interrupt at 100 kHz frequency

wir2ozz
Associate
Posted on August 14, 2015 at 08:39

Hello!

I have a little question about STM8S interrupt controller. I'm using IAR and the following code isn't quite clear for me.


INTERRUPT_HANDLER(TIM2_UPD_OVF_BRK_IRQHandler, 13) 

{ 

//Here are 100 kHz

if
(TIM2->SR1&TIM2_SR1_UIF) 

{ 

TIM2->SR1 &= ~TIM2_SR1_UIF; 

//Here is 1 kHz

//with my TIM2 settings

} 


}

I need 1 kHz interrupt and I got it. But why

IM2_UPD_OVF_BRK_IRQHandler switches at 100 kHz frequency? Why not 1 kHz? Or any frequency else?

I hope you got it clear. Thanks! #interrupt #stm8 #iar #timer
0 REPLIES 0