EI
OR
STI
MAIN
PROGRAM
IR4
SERVICE
ROUTINE
Level Triggered Mode
When in the level triggered mode the 8259A
will
recog·
nize any active (high) level on
an
IR
input as an interrupt
request.
If
the
IR
input remains active
after
an
EOI
com·
mand has been issued (resetting its ISA bit), another in·
terrupt
will
be generated. This is providing
of
course, the
processor INT pin is enabled. Unless repetitious inter·
rupt generation is desired, the
IR
input must be brought
to
an inactive state before
an
EOI
command is issued in
its
service routine. However,
it
must not
go
inactive so
soon that
it
disobeys the necessary
timing
require·
ments
shown in Figure
16.
Note that the request
on
the
IR
input
must
remain
until
after the falling edge
of
the
first INTA pulse. If on
an~input,
the request goes
inactive before the
first
INTA pulse, the 8259A will
respond as
if
IA7 was active, In any design in which
there's a
possibility
of
this
happening, the IR7 default
feature can be used as a safeguard. This can be accom-
plished by using the IR7 routine as a "clean·up
routine"
which
might
recheck the 8259A status or merely return
program
execution
to
its
pre·interrupt location.
Depending upon
the
particular design and application,
the
level triggered mode has a number
of
uses. For one,
it
provides
for
repetitious interrupt generation. This is
useful in cases when a service routine needs
to
be con·
tinually
executed
until
the
interrupt
request goes inac-
tive. Another
possible
advantage
of
the level triggered
mode
is
it
allows
for "wire-OR'ed" interrupt requests.
That is, a
number
of
interrupt requests using the same
IR
input. This can't be done in the edge triggered mode,
for
if
a device makes an
interrupt
request while the IR
in-
put
is
high
(from another request),
its
transition
will
be
"shadowed",
Thus the 8259A
won't
recognize further
In·
terrupt requests because
its
IA input is already high.
Note
that when a
"wire-OR'ed"
scheme is used, the ac-
tual requesting device has to be determined by the
soft·
ware in the service routine,
IRO-3
ENABLED
IR4-7
DISABLED
IRO-3
ENABLED
1114-
7 DISABLED
1110-3.
S-7 ENABLED
1114
DISABLED
EOI
I EI
OR
S1I
I
I
MASK IR4
I
SET
SMM
I
~
I RESET
SMM
I
I I
I
~
tR._
Flgu,.
15. Specla' M
...
Mode EulllPle
(MCS
IO/I5
TII
OI'
MCa
..,..TII
I
~,
Precautions
must
be taken when eXiting an
interrupt
service
routine
which
has used the special mask mode.
A
non·specific
EOI command can't be used when in the
special mask mode. This is because a non-specific
won't
clear an ISR
bit
of
an
interrupt
which is masked
when
In
the special mask mode. In fact. the
bit
Will ap-
pear invisible.
If
the special mask mode is cleared
before an EOI
command
is issued a non-specific EOI
command
can be used. This
could
bethe
case
In
the
eIC-
ample
shown
in Figure
15,
but,
to
avoid any
confusion
it's
best
to
use the
specific
EOI whenever
using
the
special mask mode.
It
must
be remembered that the special mask
mode
ap-
plies
to all masked levels when set. Take, for instance,
IR1
interrupting
IR4 in the previous
eICample.
If
this
hap-
pened while in
the
special mask mode, and the
tR1
routine
masked
itself,
all interrupts would be enabled
except
IR1
and IA4
which
are masked.
3.3 INTERRUPT
TRIG~ERING
There are
two
classical ways
of
sensing an active inter·
rupt request: a level sensitive
input
or
an edge sensitive
input. The 8259A gives the user the
capability
for
either
method
with
the edge triggered mode and the level trig-
gered mode.
Selection
of
one
of
these
interrupt
trigger.
ing
methods
is done during the programmed initializa-
tion
of
the
8259A.
Caution
should
be taken when using
the
automatic
EOI
mode
and the level triggered
mode
together, Since in
the
automatic
EOI
mode
an EOI is
automatically
per·
formed
at
the
end
of
the
interrupt
acknowledge
se-
quence,
if
the processor enables interrupts while an IA
input
is
still
high, an
interrupt
will
occur
immediately. To
avoid
this
situation
interrupts
should
be kept disabled
until
the end
of
the service
routine
or
until
the
IR
input
returns
low,
Edge Triggered Mode
When
in
the edge triggered mode, the 8259A
will
only
recognize
interrupts
if
generated by an inactive (low)
to
active (high)
transition
on an IR inpul. The edge trig·
gered
mode
incorporates
an
edge
lockout
method
01
operation. This means that
after
the rising edge
of
an
interrupt
request and the acknowledgement
of
the
re-
quest, the positive level
of
the
IR
input
won't
generate
further
interrupts
on
this
level. The user needn't worry
about
quickly
removing the request
after
acknowledge·
ment
in fear
of
generating further interrupts as might be
the case in the level triggered mode. Before another in-
terrupt can be generated the
IR
input
must
return
to
the
inactive
state.
45