[comp.os.vms] Need help with VAX/VMS DMA data transfers

terry@moogvax.UUCP (Terry Westley) (03/18/88)

H E L P  ! ! !

I am using a MicroVAX II with VMS for a real-time application in which
I need to perform some analog data acquisition in which other
processing is so heavy that I don't want to use a device driver.
I'd like to simply access the registers of my board (a Data Translation
3362) and DMA the acquired data into VAX memory.

I have been able to successfully perform data acquisition with a
programmed I/O technique, but I have discovered that DMA transfers
require a lot of knowledge about map registers and buffered data paths
that I do not possess.

Does anyone have a snippet of code in any language that shows how I can
set up and perform DMA transfers from any board.  High-level language
(C specifically) would be perferred, but "beggars can't be choosers."
I have a DEC manual on how to write device drivers, but am not able to
make heads or tails of it.

I would greatly appreciate receiving e-mail from anyone who could help
me out.  

Thank you.

-- 
  Terry Westley         
  Moog, Inc. (no, not the synthesizer company)
  East Aurora, NY  14052-0018
  {boulder,decvax,rocksanne,rutgers,ames}!sunybcs!moogvax!terry

ward@cfa.harvard.EDU (Steve Ward) (03/20/88)

In article <713@moogvax.UUCP>, terry@moogvax.UUCP (Terry Westley) writes:
> H E L P  ! ! !
> 
> I am using a MicroVAX II with VMS for a real-time application in which
> I need to perform some analog data acquisition in which other
> processing is so heavy that I don't want to use a device driver.
> I'd like to simply access the registers of my board (a Data Translation
> 3362) and DMA the acquired data into VAX memory.
> 
> I have been able to successfully perform data acquisition with a
> programmed I/O technique, but I have discovered that DMA transfers
> require a lot of knowledge about map registers and buffered data paths
> that I do not possess.
> 
> Does anyone have a snippet of code in any language that shows how I can
> set up and perform DMA transfers from any board.  High-level language
> (C specifically) would be perferred, but "beggars can't be choosers."
> I have a DEC manual on how to write device drivers, but am not able to
> make heads or tails of it.

If you might consider buying some software, DEC now sells a piece of
software called VAXlab or VAXstar or somesuch that supplies a full
library of drivers for all the standard Q-bus data acquisition and
parallel interface cards.  Also included is a menu interface that allows
configuration via a question-answer dialog.   Further, the package
includes display management and data analysis with plotting, data
capture and other features.

Of course, if you can't buy it then this will be of no help.  I believe
the approximate cost for a VAXstation II is around $2k, but you will
have to check with your salesman for the cost on your particular VAX.

Unfortunately I don't have any example code under VMS.

.

pstevens@pioneer.arpa (Paul Stevens RCE Sterling) (03/21/88)

Yes it is possible to do DMA without using a full fledged VMS device driver.
However, it is far from easy and not really recommended.  I know of one
group here who successfully accomplished this using a DR11-W on a UNIBUS,
unfortunately I do not have their source code.

You are going to have to wade through the Writing a Device Driver under VMS
manaual and come to terms with mapping registers etc.  You might want to
read the XADRIVER listing to get an idea of how a vanilla DMA driver works.

The other indespensible resource will be the VMS fiche or source if your
lucky enough to have it.  Without this, and in the absence of some person
on site who knows this stuff, it will be extremely difficult to do.

Your code will have to:
1) Allocate mapping registers sufficient to transfer your largest block, or
   allocate them as you need to (refer to the IOC$ALOUBAMAP executive 
   routine to see how VMS does this)
2) Load the mapping registers with the proper addresses for each DMA
   (the corresponding executive routine here is IOC$LOADUBAMAP)
3) Calculate the starting address to place into your device's address
   register (see XADRIVER for an example of how to do this on microVAX
   II machines)

If you have some specific questions try me at

PSTEVENS%EAR@io.arc.nasa.gov OR PSTEVENS%EAR@ames-io.ARPA