15.7.3 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 factors 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 – although an interrupt function may call other functions, whether they be user-defined functions, library functions or implicitly called functions to implement a C operation, the compiler cannot know (in general) which resources are used by the called function. As a result, the compiler will save all the working registers and RCOUNT, even if they are not all used explicitly in the ISR itself. The increased latency associated with the call does not lend itself to fast response times.