User manual

Appendix F DMA Programming Examples
VXI-MXI-2 User Manual F-2 © National Instruments Corporation
Parameter Descriptions
The parameters for both functions are ADDRESS_SPACE, ADDRESS,
TRANSFER_SIZE, and DATA.
ADDRESS_SPACE represents the VMEbus address space in which
the write or read will take place. The examples assume the
VXI-MXI-2 is located in A24 space.
ADDRESS represents the address in the memory space to which to
perform the write or read. In the examples, A24BASE represents
the base A24 address of the VXI-MXI-2. Any register name in the
examples represents the offset of that register defined in Chapter 5,
Register Descriptions.
The TRANSFER_SIZE parameter can be one of BYTE, WORD, or
LONGWORD representing 8-bit, 16-bit, and 32-bit data transfers,
respectively.
The DATA parameter is a constant for writes that represents the
data to be written and is a program variable for reads that store the
data read.
Example 1: DMA Operation without Interrupt
This example simply programs DMA controller 1 to move data from
the source on the VMEbus to the destination on the MXIbus. The
source is located in A24 space beginning at address location 200000
hex. VMEbus 32-bit block cycles are used to read data from the source.
The destination is located in A32 space beginning at address location
40000000 hex. MXIbus 32-bit synchronous burst cycles are used to
write data to the destination.
/************************************************************
* *
* Initialization: This section needs to be executed only *
* once prior to any DMA activity and does not have to be *
* repeated for each DMA operation. *
* *
************************************************************/