2.0 Functional Description (Continued)
2.5 INTERRUPT PRIORITY MODES
The bits of the ISRV registers are changed with either the
Set Bit Interlocked or Clear Bit Interlocked instructions (SBI-
TIW or CBITIW). The in-service bit is cleared to enable low-
er priority interrupts and set to disable them.
The NS32202 ICU can operate in one of four interrupt priori-
ty modes: Fixed Priority; Auto-Rotate; Special Mask; and
Polling. Each mode is described below.
Note: For proper operation of the ICU, an interrupt service routine must set
its ISRV bit before executing the RETI instruction. This prevents the
RETI cycle from clearing the wrong ISRV bit.
2.5.1 Fixed Priority Mode
In the Fixed Priority Mode (also called Fully Nested Mode),
each interrupt position is ranked in priority from 0 to 15, with
0 being the highest priority. In this mode, the processing of
lower priority interrupts is nested with higher priority inter-
rupts. Thus, while an interrupt is being serviced, any other
interrupts of the same or lower priority are inhibited. The ICU
does, however, recognize higher priority interrupt requests.
2.5.4 Polling Mode
The Polling Mode gives complete control of interrupt priority
to the system software. Either some or all of the interrupt
positions can be assigned to the polling mode. To assign all
interrupt positions to the polling mode, the CPU interrupt
enable flag is reset. To assign only some of the interrupt
positions to the polling mode, the desired interrupt positions
are masked in the Interrupt Mask registers (IMSK). In either
case, the polling operation consists of reading the Interrupt
Pending (IPND) registers.
When the interrupt service routine executes its RETI instruc-
tion, the corresponding ISRV bit is cleared. This allows any
lower priority interrupt request to be serviced by the CPU.
At reset, the default priority assignment gives interrupt IR0
priority 0 (highest priority), interrupt IR1 priority 1, and so
forth. Interrupt IR15 is, of course, assigned priority 15, the
lowest priority. The default priority assignment can be al-
tered by writing an appropriate value into register FPRT (L)
as explained in Section 3.9.
If necessary, the IPND read can be synchronized by setting
the Freeze (FRZ) bit in the Mode Control register (MCTL).
This prevents any change in the IPND registers during the
read. The FRZ bit must be reset after the polling operation
so the IPND contents can be updated. If an edge-triggered
interrupt occurs while the IPND registers are frozen, the in-
terrupt request is latched, and transferred to the IPND regis-
ters as soon as FRZ is reset.
Note: When the ICU generates an interrupt request to the CPU for a higher
priority interrupt while a lower priority interrupt is still being serviced by
the CPU, the CPU responds to the interrupt request only if its internal
interrupt enable flag is set. Normally, this flag is reset at the beginning
of an interrupt acknowledge cycle and set during the RETI cycle. If the
CPU is to respond to higher priority interrupts during any interrupt
service routine, the service routine must set the internal CPU interrupt
enable flag, as soon during the service routine as desired.
The polling mode is useful when a single routine is used to
service several interrupt levels.
3.0 Architectural Description
2.5.2 Auto-Rotate Mode
The NS32202 has thirty-two 8-bit registers that can be ac-
cessed either individually or in pairs. In 16-bit data bus
mode, register pairs can be accessed with the CPU word or
double-word reference instructions. Figure 3–1 shows the
ICU internal registers. This figure summarizes the name,
function, and offset address for each register.
The Auto Rotate Mode is selected when the NTAR bit is set
to 0, and is automatically entered after Reset. In this mode
an interrupt source position is automatically assigned lowest
priority after a request at that position has been serviced.
Highest priority then passes to the next lower priority posi-
tion. For example, when servicing of the interrupt request at
position 3 is completed (ISRV bit 3 is cleared), interrupt po-
sition 3 is assigned lowest priority and position 4 assumes
highest priority. The nesting of interrupts is inhibited, since
the interrupt being serviced always has the highest priority.
Because some registers hold similar data, they are grouped
into functional pairs and assigned a single name. However,
if a single register in a pair is referenced, either an L or an H
is appended to the register name. The letters are placed in
parentheses and stand for the low order 8 bits (L) and the
high order 8 bits (H). For example, register R6, part of the
Interrupt Pending (IPND) register pair, is referred to individu-
ally as IPND(L).
This mode is used when the interrupting devices have to be
assigned equal priority. A device requesting an interrupt, will
have to wait, in the worst case, until each of the 15 other
devices has been serviced at most once.
The following paragraphs give detailed descriptions of the
registers shown in Figure 3–1.
2.5.3 Special Mask Mode
The Special Mask Mode is used when it is necessary to
dynamically alter the ICU priority structure while an interrupt
is being serviced. For example, it may be desired in a partic-
ular interrupt service routine to enable lower priority inter-
rupts during a part of the routine. To do so, the ICU must be
programmed in fixed priority mode and the interrupt service
routine must control its own in-service bit in the ISRV regis-
ters.
3.1 HVCT Ð HARDWARE VECTOR REGISTER (R0)
The HVCT register is a single register that contains the in-
terrupt vector byte supplied to the CPU during an Interrupt
Acknowledge (INTA) or Return From Interrupt (RETI) cycle.
The HVCT bit map is shown below:
7
6
5
4
3
2
1
0
B
B
B
B
V
V
V
V
13