Interrupt Controller

-

It’s time to manage interrupt sources.

We have several interrupt sources in the machine:

VBL is traditionally directly connected to NMIB on the CPU, so we have that covered.

We are left with DLI, SD-1 IRQ, INTA, INTB, and 4 IO interrupts. Eight interrupt sources might get a bit difficult to manage in software. Also, not every interrupt source provides open-drain mode, so there is a need for some logic chip (8-input AND) to combine them.

If we need a dedicated chip to handle interrupt signals, we might as well have a proper interrupt controller. There were dedicated chips designed for this purpose, but they are no longer produced. Fortunately, there is an I2C I/O extender that can be used as an interrupt controller: PCF8574A.

Interrupt Controller

If any of the I/O extender pins change state, the chip will signal an interrupt. Then the CPU needs to read the input register to check which of the devices is signaling an interrupt. This will also clear the extender interrupt line, just like a dedicated interrupt controller. We will simply ignore the possibility of setting the extender lines as outputs.