AN2109 Freescale Semiconductor / Motorola, AN2109 Datasheet - Page 39

no-image

AN2109

Manufacturer Part Number
AN2109
Description
MPC555 Interrupts
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
Freescale Semiconductor, Inc.
7.3.4 Example 4: ISR Using C Only – One Interrupt Source
Summary: This example shows how to implement an interrupt exception entirely in C.
Operation: This differs mainly from Example 3 in that no assembly language is used other than macros
in a C function. Also, only a simple check of one interrupt source is done by the interrupt service.
The files used are:
main.c: adds “Ext_ISR” function as the interrupt handler
exceptions.s: not used in this example! Context save/restore and interrupt and level testing done in C.
makefile: Added the Diab compiler option switch –Xnested-interrupts
link file: used etas_evb.lin as in other examples
Using C to write complete interrupt service routines is compiler dependent. How it is done, if at all, may
differ among compiler vendors. In addition, implementations using C++ can differ from C implementa-
tion within a compiler vendor. This example was done using the Diab Data compiler.
Stack Frame: Using the pragma statements and –Xnested-interrupt compiler option, the same regis-
ters were saved on the stack as in example 3. Hence the stack size was the same.
MPC555 Interrupts
MOTOROLA
Rev. 0, 26 July 2001
39
For More Information On This Product,
Go to: www.freescale.com

Related parts for AN2109