| |||||
Technical Support Support Resources
Product Information | ARMCC: STR7 INTERRUPT HANDLERSInformation in this article applies to: RealView-MDK, All Versions QUESTIONWhat are the different ways to handle interrupts, on the ST Microelectronics STR7 series microcontrollers? ANSWERKeil supplies examples of two different methods to handle IRQ exceptions on the STR7xx devices: the Direct Vector method, and the Table method. Direct Vector MethodThe STR7 interrupt controller uses a 16+16 bit (Base:Offset) to store interrupt vector addresses. All interrupt vectors use the same 16-bit base address which forms the upper 16 bits of the interrupt vector. The advantage to this method is that it is fast. The disadvantage is that all interrupt vectors must point to code within the same 64Kb block of memory. If each vector points directly to the handler code, then each handler must reside in the 64Kb space. Table MethodAnother method is to declare a single IRQ handler for the program, and use this routine as a dispatcher to call separate handler functions for each interrupt source. The advantage of this second method is that the dispatcher and the handler functions may reside anywhere in memory. The disadvantage is increased interrupt latency, due to the extra layer of overhead that the dispatcher adds to the program. To see examples of these different methods, see the following sample programs, in your RealView-MDK installation folder.
In the ST_Blinky example, the file 71x_it.c contains the handler table. Each interrupt source has an entry in the table. An example of an active entry looks like this: extern void TimeTick (void); void T3TIMI_IRQHandler(void) TimeTick(); TIM_FlagClear(TIM3, TIM_TO_IT); } Inactive entries simply contain stub functions. SEE ALSOLast Reviewed: Tuesday, April 01, 2008 | ||||
| |||||