ARM Technical Support Knowledge Articles

STR7 INTERRUPT HANDLERS

Applies to: RealView C Compiler

Answer


Information in this article applies to:

RealView-MDK, All Versions


QUESTION

What are the different ways to handle interrupts, on the ST Microelectronics STR7 series microcontrollers?

ANSWER

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.

Table Method

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.

SEE ALSO

Article last edited on: 2008-04-01 07:54:09

Rate this article

[Bad]
|
|
[Good]
Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential