beautypg.com

Pci initialization for the macintosh, Programming options, Pci initialization for the macintosh -4 – National Instruments 6508 PCI-DIO-96 User Manual

Page 50: Programming options -4, Using ni-daq and the driver toolkit -4

background image

Chapter 6

Programming

PCI-DIO-96 User Manual

6-4

© National Instruments Corporation

4.

Create the window data value by masking the new board address:

window data value = ((0xffffff00 and new board address) or
(0x00000080))

If you are not remapping the board, then the new board address is
the value in BAR1.

5.

Write the window data value to offset 0xc0 from the new MITE
address.

If you are not remapping the board, then the new MITE address is
the value in BAR0.

The following pseudocode re-maps the MITE to memory address
0xd0000 and the board to memory address 0xd1000.

CWrite(0x10, 0x000d0000)

Write(0xd0340,0x0000aeae)

CWrite(0x14,0x000d1000)

Write(0xd00c0,0x000d1080)

The new base address for the PCI-DIO-96 would now be 0xd1000, for
this example. It is important that the memory range to which you
re-map the board is not being used by another device or system
resource. You can exclude this memory from use with a memory
manager.

PCI Initialization for the Macintosh

Programming Options

To program at the register level, you must know the PCI-DIO-96 base
memory address and you must install an interrupt handler to generate
interrupts. Both of these operations are difficult tasks. To make this
process easier, National Instruments provides a driver toolkit and
additional NI-DAQ functions to perform these operations.

You have three options to program the PCI-DIO-96. The following
sections describe these options.

Using NI-DAQ and the Driver Toolkit

Included on the NI-DAQ installation media is a toolkit for creating
plug-in drivers for most of the devices which NI-DAQ controls. Using
this toolkit, you can write a plug-in driver for your PCI board, but
continue to use NI-DAQ for any other boards that are installed in your