Author :
Craig
Steiner
Source :
8052.com
Setting
Up
Interrupts
By
default
at power
up, all
interrupts
are
disabled.
This
means
that
even if,
for
example,
the TF0
bit is
set, the
8051
will not
execute
the
interrupt.
Your
program
must
specifically
tell the
8051
that it
wishes
to
enable
interrupts
and
specifically
which
interrupts
it
wishes
to
enable.
Your
program
may
enable
and
disable
interrupts
by
modifying
the IE
SFR
(A8h):
Bit |
Name |
Bit Address |
Explanation of Function |
7 |
EA |
AFh |
Global Interrupt Enable/Disable |
6 |
- |
AEh |
Undefined |
5 |
- |
ADh |
Undefined |
4 |
ES |
ACh |
Enable Serial Interrupt |
3 |
ET1 |
ABh |
Enable Timer 1 Interrupt |
2 |
EX1 |
AAh |
Enable External 1 Interrupt |
1 |
ET0 |
A9h |
Enable Timer 0 Interrupt |
0 |
EX0 |
A8h |
Enable External 0 Interrupt |