
Appendix B
Register-Level Programming — Port C Status-Word Bit Definitions for Bidirectional Data Path (Port A Only)
©
National Instruments Corporation
B-31
PCI-DIO-96/PXI-6508/PCI-6503 User Manual
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)
Disable all 82C55A interrupts
Write(IREG2, 0x00)
Disable counter interrupts
Write(CntrCnfg, 0x34)
Set counter 0 to mode 2
Write(IREG2, 0x02)
Enable counter interrupts and select the
output from counter 0 before enabling board
interrupts
Write(IREG2, 0x06)
Enable board interrupts
Write(Ctr0, Data0)
Send the least significant byte
of the counter data to counter 0
Write(Ctr0, Data1)
Send the most significant byte
of the counter data to counter 0
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)
Turn off counter 0
Write(IREG2, 0x00)
Disable all PCI-DIO-96/PXI-6508
interrupts
Note
In order for any of the interrupts to be processed, you must write and install an
interrupt service routine. Failure to do so could cause the system to fail upon the interrupt
generation.