![Texas Instruments AM1802 Скачать руководство пользователя страница 224](http://html.mh-extra.com/html/texas-instruments/am1802/am1802_reference-manual_1094556224.webp)
AINTC Methodology
3. Software manually performs the nesting of interrupts. When an interrupt is taken, the software will
disable all the host interrupts, manually update the enables for any or all the system interrupts, and
then re-enable all the host interrupts. This now allows only the system interrupts that are still enabled
to trigger to the host. When the interrupt is completely serviced the software must reverse the changes
to re-enable the nested out system interrupts. This method requires the most software interaction but
gives the most flexibility if simple channel based nesting mechanisms are not adequate.
The recommended approach is the automatic host interrupt nesting method (second method). Because
higher priority interrupts can preempt lower priority interrupts in this method, a software stack is used to
keep track of nest priorities. The base stack value should be initialized to the default nest priority of the
application. Take the following steps within the ARM hardware interrupt service routine to handle interrupts
using host interrupt priority nesting:
1. Disable the ARM hardware interrupt.
2. Clear the OVERRIDE bit in the host interrupt nesting level register n (HINLRn) to expose the priority
level of the active interrupt.
3. Push the active (or desired) interrupt priority value into the nest priority stack.
4. Write the active (or desired) priority level into HINLRn by setting the OVERRIDE bit.
5. Calculate and store the ISR address for the active interrupt. Unfreeze the host interrupt prioritized
index register n (HIPIRn) and the host interrupt prioritized vector register n (HIPVRn), if the
PRHOLDMODE bit in the control register (CR) is set.
6. Clear the system interrupt status by setting the appropriate bit in the system interrupt status
enabled/clear register n (SECRn) or by writing the appropriate index to the system interrupt status
indexed clear register (SICR).
7. Acknowledge and enable the ARM hardware interrupt.
8. Execute the ISR at the address stored from step 5. During this step, interrupts enabled by the new
nest priority level will be able to preempt the ISR.
9. Disable the ARM hardware interrupt.
10. Discard the most recent priority level in the nest priority stack and restore the previous priority level to
HINLRn by setting the OVERRIDE bit.
11. Enable the ARM hardware interrupt.
11.3.8 Interrupt Vectorization
The next stage of the AINTC is vectorization. Vectorization is an advanced feature that allows the host to
receive an interrupt service routine (ISR) address in addition to just the interrupt status. Without
vectorization the host would receive the interrupt and enter a general ISR that gets the prioritized system
interrupt to service from the AINTC, looks up the specific ISR address for that system interrupt, and then
jumps to that address. With vectorization the host can read a register that has the ISR address already
calculated and jump to that address immediately.
Vectorization uses a base and universal size where all the ISR code is placed in a contiguous memory
region with each ISR code a standard size. For this calculation, the vector base register (VBR) is
programmed by software to hold the base address of all the ISR code and the vector size register (VSR)
is programmed for the size in words between ISR code for each system interrupt. The index number of
each system interrupt is used to calculate the final offset. The specific system interrupt ISR address is
then calculated as:
ISR address = base + (index
×
size)
There is also a special case when there is no interrupt pending and then the ISR address is the ISR Null
address. This is in case the vector address is executed when there is no pending interrupt so that a Null
handler can be in place to just return from the interrupt. The vector null address register (VNR) holds the
address of the ISR null address. When there is a pending interrupt then the ISR address is calculated as
exact base + offset for that interrupt number.
224
ARM Interrupt Controller (AINTC)
SPRUGX5A
–
May 2011
Copyright
©
2011, Texas Instruments Incorporated
Содержание AM1802
Страница 1: ...AM1802 ARM Microprocessor System Reference Guide Literature Number SPRUGX5A May 2011 ...
Страница 2: ...2 SPRUGX5A May 2011 Submit Documentation Feedback Copyright 2011 Texas Instruments Incorporated ...
Страница 30: ...30 ARM Subsystem SPRUGX5A May 2011 Submit Documentation Feedback Copyright 2011 Texas Instruments Incorporated ...
Страница 144: ...144 Power Management SPRUGX5A May 2011 Submit Documentation Feedback Copyright 2011 Texas Instruments Incorporated ...