| MV1000 Application Notes |  |

Using the MV-1000 for Master Mode transfer and Interrupt Generation/Handling
Overview
M-Vision-1000
The M-Vision-1000 (MV-1000) is a monochrome video digitizer board, which interfaces to the PCI bus. The MV-1000 product line includes a base board with analog camera support, a 3 Megabyte memory upgrade module (MV-1200), and a 8/10/16/32 bit digital interface module(MV-1100). Recent additions include the Color Camera Interface Modules (CCIM), the MV-1300 (RGB color interface module) and the MV-1350 (Composite / S-Video /VCR color interface module).
The MV-1000 can be used as a PCI Bus Master Initiator (Master) as far as moving data from VRAM is concerned. The MV-1000 Master Transfer Controller and the on-board VRAM can support a maximum burst transfer of two PCI clock cycles (60 ns at 33 Mhz bus clock frequency) which corresponds to about 40 to 50 Mbyte per second. The on-board VRAM is always the master transfer source, regardless of the destination which can be a memory area on system RAM or VGA board. The MV-1000 can also generate three kinds of interrupts, one of them is triggered by error and two of them are generated by specific events. Interrupt events can occur at the end of the frame or field depending upon which one has been specified, and/or at the end of master mode transfer.
This application note/program demonstrates the salient features of master mode transfer and interrupt generation/handling. Part of the digital image that is grabbed is sent to the system memory. The data can also be displayed depending on the user's preference. It is important for application programmers to use the system memory as the main buffer for images. The API function MV1SetMasterModeTransfer() is used to prepare the board to do master mode transfer. The other API functions used are explained in detail in the M-Vision 1000 Video Digitizer Manual. Sometimes it becomes important for the user to interrupt the process of data transfer from VRAM. The interrupt event is independent of master mode transfer The API function "MV1ConnectInterruptToCallback()" connects the interrupt generated by the MV-1000 board to a user defined call back function defined at the end of the code (refer DMASTER.C). The MV1IRQEnable() API function enables the MV-1000 to generate interrupt at the end of a frame grab and/or at the end of a master mode transfer. Mutech provides example programs both under DOS and Windows to illustrate the use of these functions.
Sections of DOS code to demonstrate movement of data from VRAM to system memory:
The following sample sections of code are from a modified version of the DMASTER.C (SDK version 2.02) program under :\MV-1000\SAMPLE\DOS. Users are requested to refer to this sample program and are requested to use this application note when making changes to it. The MV1SetGrabWindow() API function defines a camera grab window in which the user can set one or more frames. Under master mode, the first 64 Kbytes of VRAM is reserved for internal use and therefore starting address has to be set beyond that region, i.e., 0x10000. The MV1CreateFrame() API function creates a view frame to MV-1000 memory space with respect to a pre-defined Grab Window. For eg, if user has set Grab Window for 640x480 but wants the view frame to be only a portion of it, eg., 320x240, the functions would be used as follows:
MV1SetGrabWindow(0x10000,0,0,640,480,&grabWindow);
MV1CreateFrame(&Frame,0,0,320,240,&grabWindow);
To transfer this portion of the frame to system memory, a buffer of size 320x240 has to be created and the following functions should be used:
MV1SetMasterModeTransfer(&Frame, buffer, (long)320*(long)240,0);
The API function MV1DisplayData2VGA(&Frame,0,0,buffer) displays this buffer size. If user wishes to just transfer from VRAM to system memory and does not care for display, this function needs to be commented out in the DMASTER.C program. This function is available only under DOS.
Sections of Windows code to demonstrate movement of data from VRAM to system memory:
The windows program :\MV-1000\SAMPLE\WIN\WMASTER.C (SDK version 2.02) is a combination of Mutech API functions and the Windows SDK functions. The following API functions set the sizes for grab and view windows.
#define DEFAULT_CAMERA{320,240,0}
/* sets grab size to 640x480 */
MV1SetGrabWindow(0x10000L,0,0,CamCurrent.dx*2L,CamCurrent.dy*2L, &GrabAreaCtl_B1);
/* creates frame structure using half the size of the grab window */
MV1CreateFrame(&CamCurrent.frame,100,100,(long)CamCurrent.dx, (long)CamCurrent.dy, &GrabAreaCtl_B1);
The VRAM data is transferred to a system buffer which is created using the Windows API function CreateBitmap(). The Windows API function BitBlt() is used to display the data on VGA. If user does not wish to display and is only interested in transfer to system memory, this function may be commented out.

MuTech Corp. July 1996
Return to MuTech Homepage