cancel
Showing results for 
Search instead for 
Did you mean: 

Is my stm32f103 chip's execution speed too slow?

360804365
Associate II
Posted on April 15, 2015 at 18:02

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!
5 REPLIES 5
360804365
Associate II
Posted on April 15, 2015 at 18:11

My system core clock has been configured at 72MHz.

Posted on April 15, 2015 at 18:15

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.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on April 15, 2015 at 18:34

> 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.

JW

360804365
Associate II
Posted on April 16, 2015 at 03:39

 0690X00000605GNQAY.png

This is one of my ISR,and the current interrupt rate is 40KHz(4 channels will interrupt concurrently).I got the execution time by measuring the pulse width on PD15 and don't know why the pulse was a little wider when I placed all the ISR code and data in internal SRAM.

360804365
Associate II
Posted on April 16, 2015 at 03:46

0690X000006059rQAA.png

This is the disassembly code from my ISR posted previously and the branch instructions seemingly are 4 and not 3.@clive1