EngineersGarage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise
You are here: Home / Replies /  interrupts are used when we

 interrupts are used when we

|

Microcontroller › 8051 › ASM software interrupt ›  interrupts are used when we

February 9, 2011 at 1:13 pm #5481
Amit Joshi
Participant

 interrupts are used when we need to perform a special task during regular task. the full attention of controller is removed from regular task to an important task until this important task is performed.

 

for example a controller is busy in blinking led on a port0. at Pin 1.0 a buzzer is connected. and a switch is connected to int0 pin. ur task is to on the buzzer when u want. if u use polling u have to monitor P3.2 continuously during led blinking process and this will consume ur 24 clock cycle in each poll. this is not efficient programming .  if u use interrupt concept there is no need to monitor the pin P3.2.

example code-

            ORG 0000H

            LJMP MAIN;

 

            ORG 0003H               // int0 isr address   

            SETB P1.0;                 // buzzer on when interrupt occur

            RETI;                          // return interrupt 

 

              ORG 0030H

MAIN:  SETB TCON.0;        // int0 an edge trigger interrupt

             MOV IE,#81H;        // enable harwre interrupt int0

HERE:   CPL P0;                   // led bilinking

             ACALL delay;

             SJMP HERE;

 

Delay:                                 // generate a delay subroutine 

 

END

RSS Recent Posts

  • reviving old swordfish program but? May 17, 2026
  • Assistance locating a 'trail' camera gadget, please ? May 16, 2026
  • Analog multiplexer has gone obselete May 16, 2026
  • Difference between TTL, RS232 and RS485 May 16, 2026
  • Smart Buoy project May 16, 2026

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2026 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise