PRU Interrupt Controller
347
SPRUH82C – April 2013 – Revised September 2016
Copyright © 2013–2016, Texas Instruments Incorporated
Programmable Real-Time Unit Subsystem (PRUSS)
The highest priority interrupt pending across all host interrupts is stored in the global prioritized index
register (GPIR). The highest priority pending interrupt with respect to each host interrupt can be obtained
using the host interrupt prioritized index registers (HIPIRn).
13.7.5.7 Interrupt Nesting
The INTC can also perform a nesting function in its prioritization. Nesting is a method of disabling certain
interrupts (usually lower-priority interrupts) when an interrupt is taken so that only those desired interrupts
can trigger to the host while it is servicing the current interrupt. The typical usage is to nest on the current
interrupt and disable all interrupts of the same or lower priority (or channel). Then the host will only be
interrupted from a higher priority interrupt.
The nesting is done in 1 of 3 methods:
•
Nesting for all host interrupts, based on channel priority: When an interrupt is taken, the nesting level is
set to its channel priority. From then, that channel priority and all lower priority channels will be
disabled from generating host interrupts and only higher priority channels are allowed. When the
interrupt is completely serviced, the nesting level is returned to its original value. When there is no
interrupt being serviced, there are no channels disabled due to nesting. The global nesting level
register (GNLR) allows the checking and setting of the global nesting level across all host interrupts.
The nesting level is the channel (and all of lower priority channels) that are nested out because of a
current interrupt.
•
Nesting for individual host interrupts, based on channel priority: Always nest based on channel priority
for each host interrupt individually. When an interrupt is taken on a host interrupt, then, the nesting
level is set to its channel priority for just that host interrupt, and other host interrupts do not have their
nesting affected. Then for that host interrupt, equal or lower priority channels will not interrupt the host
but may on other host interrupts if programmed. When the interrupt is completely serviced the nesting
level for the host interrupt is returned to its original value. The host interrupt nesting level registers
(HINLR1 and HINLR2) display and control the nesting level for each host interrupt. The nesting level
controls which channel and lower priority channels are nested. There is one register per host interrupt.
•
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-enables 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.
13.7.5.8 Interrupt Status Clearing
After servicing the interrupt (after execution of the ISR), interrupt status is to be cleared. If a system
interrupt status is not cleared, then another host interrupt may not be triggered or another host interrupt
may be triggered incorrectly.It is also essential to clear all system interrupts before the PRU is halted as
the PRU does not power down unless all the interrupt status are cleared. For clearing the status of an
interrupt, whose interrupt number is N, write a 1 to the Nth bit position in the system interrupt status
enabled/clear registers (SECR1-SECR2). System interrupt N can also be cleared by writing the value N
into the system interrupt status indexed clear register (SICR).
13.7.5.9 Interrupt Disabling
At any time, if any interrupt is not to be propagated to the host, then that interrupt should be disabled. For
disabling an interrupt whose interrupt number is N, write a 1 to the Nth bit in the system interrupt enable
clear registers (ECR1-ECR2). System interrupt N can also be disabled by writing the value N in the
system interrupt enable indexed clear register (EICR).
13.7.5.10 Configuring the Interrupt Controller
Follow these steps to configure the interrupt controller.
1. Set polarity and type of system event through the System Interrupt Polarity Registers (SIPR1 and
SPIR2) and the System Interrupt Type Registers (SITR1 and SITR2). Polarity of all system interrupts is
always high. Type of all system interrupts is always pulse.