2015-04-15 09:02 AM
Hi,
I have several time strict TIMER ISR and I tested the execution time of one of them.The result is that 47 instructions(indluding 3 branch instructions) costs 3 us.My chip is stm32f103 and all code and data is placed at internal flash ram.Can anyone tell me is that a normal case and whether the time can be reduced or not?Thank you in advance!2015-04-15 09:11 AM
My system core clock has been configured at 72MHz.
2015-04-15 09:15 AM
Interrupt entry/exit is expensive. The flash is slow, and uncached. Try running your code, and have your Vector Table, in RAM.
Not clear what your interrupt rate is, but >100KHz is probably too high. And 1MHz would be ridiculously high.2015-04-15 09:34 AM
> Can anyone tell me is that a normal case and whether the time can be reduced or not?
Post those 47 instructions. It may be an entertaining undertaking to discuss this in detail. JW2015-04-15 06:39 PM
2015-04-15 06:46 PM
This is the disassembly code from my ISR posted previously and the branch instructions seemingly are 4 and not 3.@clive1