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

Near- and Far-Field Measurements

April 16, 2024
In this comprehensive application note, we delve into the methods of measuring the transmission (or reception) pattern, a key determinant of antenna gain, using a vector network...

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.

Empowered by Cutting-Edge Automation Technology: The Sustainable Journey

April 16, 2024
Advanced automation is key to efficient production and is a powerful tool for optimizing infrastructure and processes in terms of sustainability.

Comments

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