R6522 Versatile Interface Adapter (VIA) INTERRUPT OPERATION Controlling interrupts within the R6522 involves three principal operations. These are flagging the interrupts, enabling interrupts and signaling to the processor that an active interrupts exists within the chip. Interrupt flags are set in the Interrupt Flag Register (FR) by conditions detected within the R6522 or en inputs to the R6522. These flags normally remain set until the interrupt has been serviced. To determine the source of an inter- rupt, the microprocessor must examine these flags in order, from highest to lowest priority. Associated with each interrupt flag is an interrupt enabie bit in the interrupt Enable Register (IER). This can be set or cleared by the processor to enable interrupting the processor from the corresponding interrupt flag. If an interrupt flag is set to a logic 1 by an interrupting condition, and the corresponding interrupt ena- bie bit is set_to a 1, the Interrupt Request Output (IRQ) will go tow. [RQ is an “open-collector” output which can be “wire-OR‘ed” with other devices in the system to interrupt the processor. interrupt Flag Register (IFR) In the R6522, all the interrupt flags are contained in one register, i.e., the IFR (Figure 29). in addition, bit 7 of this register will be read as a logic 1 when an interrupt exists within the chip. This allows very convenient polling of several devices within a sys- tem to locate the source of an Interrupt. The Interrupt Fiag Register (IFR) may be read directly by the proc- essor. In addition, individual flag bits may be cleared by writing a 1" into the appropriate bit of the FR. When the proper chip select and register signals are applied to the chip, the contents of this register are placed on the data bus. Bit 7 indicates the status of the IRQ output. This bit corresponds to the logic REG 13~—iINTERRUPT FLAG REGISTER TELLEELE SET BY CLEARED BY | CA2 ACTIVE EDGE | READ OR WRITE ca24 AEG 1{ORA}* CAI——~