2015-05-29 05:49 AM
Hello
What is the delay between interrupt occurance(e.g. external interrupt on a pin) and interrupt service routine entry?by some initial measurements, it's about 30 cpu clocks.Is it interrupt type(external pin, specific peripheral) dependent?Thanks.2015-05-29 06:22 AM
Depends on filtering in the peripheral, bus clocks.
The processor has to stack it's internal state, takes 12 cycles on entry, 12 on exit, as I recall. If the processor is in a higher priority interrupt. How many cycles it takes you to load registers, write a GPIO, and for it to propagate through the write buffers and buses.2015-05-29 06:29 AM
Also, when the interrupt vectors and interrupt-service-routine are in FLASH, and the processor clock is sufficiently fast (say over 30 MHz) to require wait-states for random FLASH accesses, then you have a couple of sets of wait-states to add.
2015-05-29 06:47 AM
Also, if FPU is enabled and lazy stacking is disabled, the FPU context is saved together with the ''main'' registers on entry.
Also, what you percept as execution of first instruction of your C code might be delayed by function prologue added by the compiler. JW