0% found this document useful (0 votes)
259 views10 pages

Interrupts in 8051 Microcontroller

The document provides an overview of interrupts in the 8051 microcontroller, explaining their purpose, types, and execution process. It details various interrupt sources, the interrupt enable (IE) and interrupt priority (IP) registers, and includes an example of using an external interrupt to control an LED. Additionally, it discusses applications of interrupts for timers, serial communication, and external events.

Uploaded by

Gaurav Bhaisare
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
259 views10 pages

Interrupts in 8051 Microcontroller

The document provides an overview of interrupts in the 8051 microcontroller, explaining their purpose, types, and execution process. It details various interrupt sources, the interrupt enable (IE) and interrupt priority (IP) registers, and includes an example of using an external interrupt to control an LED. Additionally, it discusses applications of interrupts for timers, serial communication, and external events.

Uploaded by

Gaurav Bhaisare
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Interrupts in 8051

Microcontroller
Presented by: GAURAV BHAISARE

Scholar Number: 2311401162


What is an Interrupt?
Interrupt Concept Real-Time Use ISR Execution
An interrupt temporarily halts Enables immediate responses After ISR, program resumes from
normal execution for special without polling, e.g., button press where it paused.
processing. detection.
8051 Interrupt System Overview
Interrupt Sources More Interrupts
INT0 (External Interrupt 0) - P3.2 Timer 1 Overflow
Timer 0 Overflow Serial Communication (RI/TI)
INT1 (External Interrupt 1) - P3.3 Fixed vector addresses and priorities
IE Register 3 Enabling Interrupts
Master Control (EA) Individual Bits Example Setting
Bit 7 enables or disables all interrupts Bits enable serial, timer, and external MOV IE, #10000011B enables serial,
globally. interrupts selectively. INT0, and global interrupt.

IP Register 3 Interrupt Priority


Priority Bits More Priority Bits Priority Rules
PS: Serial Port Interrupt PT0: Timer 0 Interrupt High priority interrupts preempt low
PT1: Timer 1 Interrupt PX0: External Interrupt 0 priority ISRs.

PX1: External Interrupt 1


Interrupt Vector Table
Interrupt Vector Address (Hex)

Reset 0000H

INT0 0003H

Timer0 Overflow 000BH

INT1 0013H

Timer1 Overflow 001BH

Serial 0023H
Example 3 External Interrupt (INT0)

Toggle LED on interrupt using INT0 (P3.2)

ORG 0000H

AJMP MAIN

ORG 0003H ; INT0 vector

CLR P1.0 ; Turn off LED

RET

MAIN: MOV IE, #10000001B ; Enable INT0 and EA

SETB P1.0 ; LED ON initially

HERE: SJMP HERE ; Infinite loop


Explanation:
When INT0 pin goes LOW (edge-triggered), ISR at 0003H is executed.
LED is turned OFF.
Program returns to main loop.
Assembly Example 3 INT0 LED Control
Set Vector
1
ORG 0003H; ISR jumps here on INT0

Turn Off LED


2
CLR P1.0; LED off on interrupt

Enable Interrupt
3
MOV IE, #10000001B; Enable INT0 & global

Main Loop
4 Loop infinitely while ISR handles button press
Edge vs. Level Triggering (TCON Register)
Level Triggered Edge Triggered TCON Bits
Interrupt active as long as input stays Interrupt occurs only on falling edge IT0 controls INT0 trigger mode
LOW. transition. IT1 controls INT1 trigger mode

MOV TCON, #05H sets INT0 edge-


triggered.

Applications of Interrupts in 8051

Timer Interrupts Serial Interrupts External Interrupts Power Saving


Used for precise timing and Manage UART communication Detect switches, sensors, and Wake microcontroller from low
pulse generation. efficiently. alarms. power modes.
THANKYOU
DATE : 25 / 04 / 2025

You might also like