ARMCC: STR7 INTERRUPT HANDLERS
Information in this article applies to:
RealView-MDK, All Versions
What are the different ways to handle interrupts, on the ST Microelectronics STR7 series microcontrollers?
Keil supplies examples of two different methods to handle IRQ exceptions on the STR7xx devices: the Direct Vector method, and the Table method.
Direct Vector Method
The 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.
Another 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.
Last Reviewed: Tuesday, April 1, 2008
of your data.