Interrupt Handling; Interrupt Programming Examples For The 82C55A - National Instruments PCI-DIO-96 User Manual

96-bit and 24-bit parallel digital i/o interface for pci, pxi, and compactpci
Hide thumbs Also See for PCI-DIO-96:
Table of Contents

Advertisement

Appendix B
Register-Level Programming — Port C Status-Word Bit Definitions for Bidirectional Data Path (Port A Only)

Interrupt Handling

You must set the INTEN bit of Interrupt Control Register 2 to enable interrupts. Clear this bit
first to disable unwanted interrupts. After all sources of interrupts have been disabled or
placed in an inactive state, you can set INTEN. You must set INTEN before you generate an
interrupt for proper operation.
To interrupt the computer using one of the 82C55A devices, program the selected 82C55A
for the I/O mode desired. In mode 1, set either the INTEA or the INTEB bit to enable
interrupts from port A or port B, respectively. In mode 2, set either INTE1 or INTE2 for
interrupts on output or input transfers, respectively. The INTE1 and INTE2 interrupt outputs
are cascaded into a single interrupt output for port A. After you enable interrupts from the
82C55A, set the appropriate enable bit for the selected 82C55A; for example, if you select
both mode 2 interrupts for PPI C, set CIRQ0 to interrupt the computer.
To interrupt the computer using one of the 82C53 counter outputs on the PCI-DIO-96 or
PXI-6508, program the counters as described in the
You can use external signals to generate interrupts when port A or port B is in mode 0 and the
low nibble of port C is configured for input. If port A is in mode 0, use PC3 to generate an
interrupt; if port B is in mode 0, use PC0 to generate an interrupt. After you have configured
the selected 82C55A, you must set the corresponding interrupt enable bit in Interrupt Control
Register 1. If you are using PC3, set xIRQ0; if you are using PC0, set xIRQ1, where x is the
letter corresponding to the PPI you want to generate interrupts (A–D). When the external
signal becomes logic high, an interrupt request occurs. To disable the external interrupt,
ensure that the interrupt service routine that you have written acknowledges the interrupt.
On the PCI-DIO-96 and PXI-6508, ensure that the interrupt service routine also writes the
interrupt clear register.

Interrupt Programming Examples for the 82C55A

The following examples show the process required to enable interrupts for several different
operating modes. You must write and install an interrupt service routine in order to process
the interrupt and gain any useful knowledge from it. You should clear all interrupt sources and
interrupt enable bits first to disable unwanted interrupts.
Mode 1 Strobed Input Programming Example
The following example shows how to set up interrupts for mode 1 input for port A.
Write (8255Cnfg, 0xB0)
Write (8255Cnfg, 0x09)
Write (IREG2, 0x04)
Write (IREG1, 0x01)
© National Instruments Corporation
Interrupt Programming Example
Set mode 1—port A is an input
Set PC4 to enable interrupts from
the 82C55A
Set INTEN bit
Set AIRQ0 to enable PPI A,
port A interrupts
B-29
PCI-DIO-96/PXI-6508/PCI-6503 User Manual
section.

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Pci-6503Pxi-6508

Table of Contents