Use Four External Interrupts Through One 8051 Input

May 13, 2002
The 8051-compatible microcontrollers are equipped with up to two inputs that may be used as general-purpose interrupts. A simple way to increase the number of interrupt inputs is shown in the figure. The...

The 8051-compatible microcontrollers are equipped with up to two inputs that may be used as general-purpose interrupts. A simple way to increase the number of interrupt inputs is shown in the figure. The 74LS08 chip provides up to four interrupt inputs through the standard INT0 input.

This circuit is built so that Interrupt 1 has the highest priority and Interrupt 4 has the lowest priority. Intel standard assembler is used for the demonstration program shown in the code listing. The program code allows masking of the unusable or undesirable interrupts. Here, the variable IE_MASK is used to hide the interrupts by setting the appropriate bits of the high-order nibble to "1." Each time the corresponding interrupt is implemented, the interrupt handler switches on the appropriate LED.

You see from the code that Interrupts 2 and 3 are disabled, so only 1 and 4 will be processed. Of course, the program code is only a skeleton for more complicated applications that readers can build.

To download a listing, click Download the Code below.

Download the code.

Sponsored Recommendations

What are the Important Considerations when Assessing Cobot Safety?

April 16, 2024
A review of the requirements of ISO/TS 15066 and how they fit in with ISO 10218-1 and 10218-2 a consideration the complexities of collaboration.

Wire & Cable Cutting Digi-Spool® Service

April 16, 2024
Explore DigiKey’s Digi-Spool® professional cutting service for efficient and precise wire and cable management. Custom-cut to your exact specifications for a variety of cable ...

DigiKey Factory Tomorrow Season 3: Sustainable Manufacturing

April 16, 2024
Industry 4.0 is helping manufacturers develop and integrate technologies such as AI, edge computing and connectivity for the factories of tomorrow. Learn more at DigiKey today...

Connectivity – The Backbone of Sustainable Automation

April 16, 2024
Advanced interfaces for signals, data, and electrical power are essential. They help save resources and costs when networking production equipment.

Comments

To join the conversation, and become an exclusive member of Electronic Design, create an account today!