17.6 Latency

There are two elements that affect the number of cycles between the time the interrupt source occurs and the execution of the first instruction of your ISR code. These are:

  • Processor Servicing of Interrupt – The amount of time it takes the processor to recognize the interrupt and branch to the first address of the interrupt vector. To determine this value, refer to the processor data sheet for the specific processor and interrupt source being used.
  • ISR Code – The compiler saves the registers that were used by the ISR. Moreover, if the ISR calls an ordinary function, then the compiler will save all the working registers, even if they are not all used explicitly in the ISR itself. This must be done, because the compiler cannot know, in general, which resources are used by the called function.