Interrupt requests come from various sources such as internal timers or I/O devices. There are a total of 8 unique interrupt requests that can be made. They can be prioritized and masked, which gives the user control over what interrupts can fire and when. The ISR[7] will only be executed when all other ISRs have been completed. It has the lowest priority. ISR[0], if un-masked, will always have the highest priority and be run first.

Mask

Using the interrupt mask register, you are able to disable any interrupt request from reaching the CPU. This also means that if a disabled interrupt is triggered from an external I/0 device, it will never get latched.

This is done by setting the corresponding BIT[0..7] to HIGH.

BIT7BIT6BIT5BIT4BIT3BIT2BIT1BIT0
IRQ7IRQ6IRQ5IRQ4IRQ3IRQ2IRQ1IRQ0

Example:

Priority

This register sets a “cutoff” level for disabling any interrupt below a specified priority level. This differs from masking because it will still allow deprioritized interrupts to be latched, but they are just prevented from causing an interrupt request.

BIT3BIT2BIT1BIT0
P3P2P1P0

When IRQ[x] < PRIORITY an interrupt request is initiated.

  • A Priority 8+ level will enable all IRQs
  • A Priority 7 level, will enable IRQ[0..6]
  • A Priority 6 level, will enable IRQ[0..5]
  • A Priority 5 level, will enable IRQ[0..4]
  • A Priority 4 level, will enable IRQ[0..3]
  • A Priority 3 level, will enable IRQ[0..2]
  • A Priority 2 level, will enable IRQ[0, 1]
  • A Priority 1 level, will enable IRQ[0]

A Priority 0 level, will disable all IRQs

Example:

Example Usage

Lets say you want to enable 4 interrupts, but you want to be sure that while executing a specific interrupt service routine, you temporarily disable the CPU from triggering another interrupt request. You can do the following:

PCB Gerber/Traces

Schematic Diagram

Parts & Components List

PART #DESCRIPTIONQTYSHEETLINK
74HC32Quad 2-input OR gates2DATAMouser
74HC00Quad 2-input NAND gates1DATAMouser
74HC5748-Bit, Edge-Triggered, flip-flop’s3DATAMouser
74HC2458-bit, Tri-State Transceiver1DATAMouser
CD4075CMOS Triple 3-Input OR Gate1DATAMouser
74HC1484 to 16 line, decoder1DATAMouser
CD40634-Bit Magnitude Comparator1DATAMouser
Ceramic Capacitor3
Resistors14
Light Emitting Diodes (LED)13
Header Pins