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

  • Quick question on capacitors value in UF December 9, 2025
  • EEPROM not being written or read on dsPIC30F2010 December 9, 2025
  • Want Thermal Camera with Fixed Thermal Span option December 9, 2025
  • Printer loop December 9, 2025
  • mechanism to shutdown feeding when sensor temperature rises December 9, 2025

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2025 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