Strange values when reading timer CNT
I have a timer (TIM10) with a period of 500 us, running without interrupt or any other function.
Then I have a rising+falling signal interrupt on PB0 (EXTI0) driven with a 31.25 kHz square wave.
In EXTI0 I read the CNT value into a variable New, evaluate the difference with the previous CNT value Old (obviously considering the case when Old value is greater than New value) and copy the New into Old for the next EXTI0 interrupt.
What I see is that many times the difference between New and Old, which should be about 16 us, is even 40, 80, 100 us or more!
I've checked with a signal output on a pin and a scope that I have EXTI0 interrupts correctly every 16 us, without any interrupt loose or other strange behaviours.
Seem's like sometimes (many times...) the CNT value read is not the current one but some strange old value.
What could be the problem?
Thanks
