2018-06-23 05:28 AM
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-interrupt2018-06-24 10:58 AM
Dupe
https://community.st.com/0D50X00009XkVtSSAV