You are on page 1of 13

Interrupt is an external or internal event that

interrupts the micro controller to inform the


micro controller that an event has occurred
and it needs to be serviced.
In polling, the micro controller constantly
monitors the status of a device, when the
condition is met it performs the service.

Interrupts
1.

2.

Each device can get the


assign

Polling
Not possible to

attention based on the


uses

priority since it

priority assigned to it .
method.

Round Robin

The Micro Controller can

Not possible.

Ignore the signal and


refuse to service it.
3.

Efficient use of

Waste of time.

The program which is associated with the


Interrupt is called the Interrupt service
routine or interrupt handler.
When an interrupt is invoked, the micro
controller runs the interrupt service routine.
The group of memory locations set aside to
hold the addresses of ISR is called the
interrupt vector table.

INTERRUPT
(Interrupt Vector)

ROM Location

PIN

(hex)
1. Reset
2. External hardware
interrupt 0 (INT0)
3. Timer 0
interrupt (TF0)
4. External hardware
interrupt 1(INT1)
5. Timer 1 interrupt (TF1)
6. Serial COM interrupt
(R1 and T1)

0000
0003

9
P3.2

000B
0013
001B
0023

P3.3

EA

----- ET2 ES

BIT SYMBOL
7

6
5
4
3
2
1
0

ET1 EX1 ET0 EX0

FUNCTION0

EA

Enable Interrupts bit.if EA=0, no interrupt

--ET2
ES
ET1
EX1
ET0
EX0

is acknowledge, if EA=1enables individual


interrupts which are enabled.
unused, reserved for future use
unused, reserved for future use
Enable serial interrupt
Enable timer 1 interrupt
Enable external interrupt 1
Enable timer 0 interrupt
Enable external interrupt 0

TF INTERRUPT
TF0

Timer 0

Interrupt VectorTF1
00BH

Jumps to

Timer 1 Interrupt Vector

001BH
Jumps to

External Interrupts INT0 and INT1


INT0 and INT1 are located on pins P3.2 and P3.3
of port 3,these are enabled and disabled using the
IE register
There are two activation levels for the
external hardware interrupts:
(1) Level triggered,and
(2) Edge triggered

Level triggered Interrupts


INT0 and INT1 are normally high in this mode and
if a low-level signal is applied to them, it triggers the
interrupt then micro
controller stops what ever it
is doing and jumps to the interrupt
vector table to
service that interrupt.
1 MC
1.085 s

4 machine cycles

to INT0
or INT1 PINS

4*1.085 s

Minimum duration of the low level triggered interrupt


XTAL=11.0592MHZ

Edge triggered Interrupts

The external source must be held high for at


least one
machine cycle, and then low for at least
one machine cycle to
ensure that the transition is
seen by the micro controller.

Minimum pulse duration to


1 MC
Detect edge-triggered 1.085 s
Interrupts.
XTAL=11.0592 MHZ

1.085 s
1 MC

TCON
TF0

TR0

TF1

TR1

Register
IE1

IT1

IE0

IT0

IE1 External Interrupt 1 edge control flag.


Set by a CPU when the external interrupt edge (H to L) is
detected.
IT1 External interrupt 1 type control bit.
Set or cleared by the user to specify falling edge/low level
triggered external
interrupt.

is

IE0 External Interrupt 0 edge control flag.


Set by a
CPU when the external interrupt edge (H to L)
detected

IT0 External interrupt 0 type control bit.


Set or cleared by the user to specify falling edge/low level
triggered external
interrupt.

INTERRUPT PRIORITY IN THE 8051:

8051 INTERRUPT PRIORITY UPON RESET


Highest to lowest priority
1.External interrupt 0 (INT0)
2.Timer Interrupt 0
(TF0)
3.External interrupt 1
(INT1)
4.Timer interrupt 1
(TF1)
5.Serial Communication (RI+TI)

INTERRUPT PRIORITY(IP)
------

------

Bit
7
8
9
10
bit
11
12
bit
13
Q : Program
0
priority to
bit

------

PS

Symbol
---------------PS
PT1
PX1
PT0
the IP
PX0register

PT1

PX1

PT0

PX0

Definition
Reserved
Reserved
Reserved
Serial port interrupt priority
Timer 1 interrupt Priority bit
External interrupt 1 priority
Timer 0 interrupt Priority bit
toExternal
assign interrupt
the highest
0 priority

INT1 (external interrupt 1)

A :priority
MOV IP,#00000100B ; IP.2 = 1 to assign INT1

You might also like