Author :
Craig
Steiner
Source :
8052.com
Interrupt
Priorities
The 8051
offers
two
levels
of
interrupt
priority:
high and
low. By
using
interrupt
priorities
you may
assign
higher
priority
to
certain
interrupt
conditions.
For
example,
you may
have
enabled
Timer 1
Interrupt
which is
automatically
called
every
time
Timer 1
overflows.
Additionally,
you may
have
enabled
the
Serial
Interrupt
which is
called
every
time a
character
is
received
via the
serial
port.
However,
you may
consider
that
receiving
a
character
is much
more
important
than the
timer
interrupt.
In this
case, if
Timer 1
Interrupt
is
already
executing
you may
wish
that the
serial
interrupt
itself
interrupts
the
Timer 1
Interrupt.
When the
serial
interrupt
is
complete,
control
passes
back to
Timer 1
Interrupt
and
finally
back to
the main
program.
You may
accomplish
this by
assigning
a high
priority
to the
Serial
Interrupt
and a
low
priority
to the
Timer 1
Interrupt.