cancel
Showing results for 
Search instead for 
Did you mean: 

problem with interrupt in stm32f103

farzane senobari
Associate
Posted on June 23, 2018 at 14:28

Hello everyone;

I'm using stm32f103c8t6 with HAL drivers, 

I'm running my code in an interrupt routine every 40 ms (in other words,I have an internal interrupt every 25 HZ), this specific time is of great importance to me and should be precise. (I read this time interval with systick)

my clock frequency is 28 MHz, so in stmcubemx I set the prescaler=81 and counter period=14001 in order to have a 25 Hz interrupt but recently I found a problem:

when I just type in 'HAL_TIM_PeriodElapsedCallback ' to show me the systick value everything is ok and I'll have it's value with 40ms intervals but when I add my code the interval value will decrease to 1ms (I test with different codes,i.e.  for a simple calculation it'll just reduce to 29ms but for more complex one it'll show me 1ms interval!)  

if any one knows the reason and the solution to this problem I'll be so grateful to know.

#stm32f103-interrupt
1 REPLY 1
Posted on June 24, 2018 at 19:58

Dupe

https://community.st.com/0D50X00009XkVtSSAV

 
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..