|
|||||||||||
Technical Support Support Resources
Product Information |
C166: Handling Unused InterruptsInformation in this article applies to:
QUESTIONWe would like to account for all interrupts in a C167/XC16x/XC2000 system - i.e. all unused interrupts would go to a common interrupt routine for logging or error handling. How do we do this? We see how to assign individual interrupt routines to the "table", but not how to load the same vector/function for multiple interrupt sources. ANSWERThe solution depends on the C166 version you are using. C166 < 4.10a: There is no easy way (in C) to assign a single interrupt routine to multiple traps or vectors. However, you can easily implement several interrupt routines that invoke a general purpose unused interrupt handler. For example, the following code shows you how to trap and "handle" the serial transmit and receive interrupts. Note that these interrupts use the same register bank. This may be undesirable.
Note that in this example, the interrupt functions pass the trap number to the bad IRQ handler. This may or may not be useful depending on your application. C166 > 4.10a: With version 4.10a, the L166 linker directive INTNO (interrupt_name (FILL)) was introduced. This directs all unused interrupt vectors to one common interrupt service routine. Example interrupt service routine:
Example L166 linker directive:
In µVision, you can specify the directive INTNO (MYINT (FILL)) in the dialog Options for Target - L166 Misc - Misc Controls.
MORE INFORMATION
SEE ALSOLast Reviewed: Thursday, February 25, 2021 | ||||||||||
|
Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.