Interrupt Programming Example - 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)
To determine the time between pulses generated by counter 0, multiply the load value by
500 ns (1/(2 MHz)). To determine the time between pulses generated by counter 1, multiply
the load value by the time between pulses of counter 0. The following section shows a sample
configuration procedure.

Interrupt Programming Example

The following example shows how to set up counter 0 to generate interrupts:
Write(IREG1, 0x00)
Write(IREG2, 0x00)
Write(CntrCnfg, 0x34)
Write(IREG2, 0x02)
Write(IREG2, 0x06)
Write(Ctr0, Data0)
Write(Ctr0, Data1)
The counter begins counting as soon as the most significant byte is written. When you are
ready to exit your program, disable the counter and interrupts as shown below.
Write(Cnfg, 0x30)
Write(IREG2, 0x00)
In order for any of the interrupts to be processed, you must write and install an
Note
interrupt service routine. Failure to do so could cause the system to fail upon the interrupt
generation.
© National Instruments Corporation
Disable all 82C55A interrupts
Disable counter interrupts
Set counter 0 to mode 2
Enable counter interrupts and select the
output from counter 0 before enabling board
interrupts
Enable board interrupts
Send the least significant byte
of the counter data to counter 0
Send the most significant byte
of the counter data to counter 0
Turn off counter 0
Disable all PCI-DIO-96/PXI-6508
interrupts
B-31
PCI-DIO-96/PXI-6508/PCI-6503 User Manual

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Pci-6503Pxi-6508

Table of Contents