MV1000 Application Notes


Interfacing the Kodak Megaplus (Model 1.6) Camera to the M-Vision 1000/1100

Overview

M-Vision-1000
The M-Vision-1000(MV-1000) is a monochrome 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 32 bit digital interface module(MV-1100).

Interfacing to the Megaplus 1.6 camera in digital mode requires the use of the MV-1100 digital module. This module accepts the RS-422 differential video and timing signals from the Megaplus 1.6 camera.

Kodak Megaplus 1.6
The Megaplus 1.6 is a 10 bit digital camera. In the digital mode, the Megaplus 1.6 outputs non-interlaced digital video and timing in RS-422(differential) format. It operates in three modes.- Continuous Mode, Controlled Mode and Triggered mode which are explained later.

The MV-1000/1100 fully supports the various capabilities of the Megaplus 1.6 camera.

Cable Connections

The J2 connector on the MV-1100 is a high density 51 slot female Airborne connector. The pinouts for this connector are listed in Appendix A of the MV-1100 User's guide and Technical Reference.

MuTech supplies a digital cable for interfacing to the Megaplus 1.6. The part number is MVCD-10. The MVCD-10 cable has a SCSI connector on the camera interface. For the Megaplus 1.6I, a female connector SCSI cable is required.

Camera Control Unit (CCU) Settings

Shutter:OFF
Exposure:100 msecs
Mode:Computer
Gain:0 or 6 db
black Level:Fixed

Software Overview

Camera Configuration Files
From a software point of view, the concept of video acquisition from standard or non-standard cameras is based on the use of a Camera Configuration File. Camera "Config" files are ASCII files that hold all of the values relevant to the proper usage of a particular camera with the MV-1000.

Camera Config files for most commercially available cameras are included on a MuTech distribution diskette and by default are loaded into the directory ..\mv-1000\camcfg. All MuTech distribution software uses these Camera Config Files to set the board and chip registers into the correct state to work with a particular camera.

MP16d.ini: This file configures the Megaplus 1.6 in continuous mode. In this mode, the camera control unit (henceforth called CCU) has complete control of the camera operation.

MP16dc.ini: This file configures the Megaplus 1.6 in controlled mode. In this mode, exposure is controlled by the width of the FRAME RESET/EXPOSURE signal on pin 17. of the DB-37 connector. The width can be changed by the Counter_Value in the MP16dc.ini file.

MP16dt.ini: This file configures the Megaplus 1.6 in the trigger mode. In this mode, exposure is initiated by the falling edge of the FRAME RESET/EXPOSURE signal on connector pin 17. The CCU terminates the exposure (as determined by the EXPOSURE switch setting) then outputs the video. The exposure can be changed by the exposure control knob on the CCU front panel.

These .ini files were generated by MuTech for use with the Megaplus 1.6 camera with the Camera Config utility program. This program is named "Camsetup.exe", and is located in the ..\mv-1000\win directory. It is a Windows based utility with an intuitive user interface, that has been designed for the easy generation of camera configuration files.

Application developers can read/modify/write the Camera Config files, which end in the suffix ".ini", to change any or all options. For more information see the M-Vision-1000 Camera Configuration Utility" document which is shipped with every board.

Explanation for Counter_Value
The Counter_Value is an important parameter in the above mentioned configuration files. As far as the control mode is concerned, the width of the FRAME RESET/EXPOSURE pulse determines the duration of the exposure. This corresponds to a certain value of Counter_Value in the ".ini" file. Each count approximates 25 msecs. Therefore a Counter_Value of "0x8" corresponds to "(8x25 msecs + 25 msecs)=225 msecs. The exposure can thus be controlled by simply changing this value. The addition of 25 msecs is explained in the subsequent paragraph.

As far as the trigger mode is concerned, the width of the FRAME RESET/EXPOSURE pulse has no significance whatsoever. In the trigger mode, the falling edge of this pulse is of paramount importance. Once the falling edge of the pulse is encountered, exposure can be controlled by adjusting the EXPOSURE knob on the CCU. The addition of 25 msecs is a safety measure of sorts. If it were not used, it will sometimes be impossible to use the camera in the trigger mode. Consider a Count_Value of "0x0"- in this case trigger mode will not commence because the pulse will not be present. The addition of 25 msecs means that 1 pulse is always present (regardless of the counter value) to facilitate trigger mode. Therefore a count value of 8 actually means 9.

DOS Utility - "Camtest.exe"
The easiest way to verify proper functioning of the Megaplus 1.6 camera with the MV-1000/1100 is through the DOS testing program "Camtest.exe". This program is included on the distribution diskette and is contained in the sub-directory "diag" under directory MV-1000.

To use Camtest.exe with the Megaplus 1.6 camera in normal digital mode, type...
"camtest ..\camcfg\MP16d.ini" at the DOS prompt. This assumes that the camtest program is in the ..\diag directory and .ini files are in the ..\camcfg directory. If the camera and the board are functioning properly live video should be displayed on the VGA monitor.

To use Camtest.exe with the Megaplus 1.6 camera in controlled mode, type...
"camtest ..\camcfg\MP16dc.ini" If camera and board are functioning properly, live video should be displayed. The exposure time would be controlled by the value specified against "Counter_Value" in the mp16dc.ini file. This value, as mentioned previously corresponds to the width of the FRAME RESET/EXPOSURE pulse. A software trigger "s" is available to move from one frame to the next. Every time the key "s" is entered, the above pulse is generated which sets the exposure time.

To use Camtest.exe with the Megaplus 1.6 camera in trigger mode, type...
"camtest ..\camcfg\MP16dt.ini" If camera and board are functioning properly, live video should be displayed. As mentioned previously, the trigger will be initiated by the falling edge of the FRAME RESET/EXPOSURE pulse. The trigger mode is independent of the value against "Counter_Value" in the mp16dt.ini file.

The maximum capture size specified in the camera configuration file should not exceed 1 Mbyte. For applications requiring greater than 1 Mbyte, the MV-1200 may be used. With the optional MV-1200 memory expansion module, the on-board VRAM is expanded to 4 Mbytes.

Windows Utility - "WMV1Demo.exe"
The MuTech Distribution diskette includes a Windows utility that can be used to acquire video from the Megaplus 1.6 camera. The utility is named WMV1demo.exe and is under the mv-1000\win directory. To use this utility with the Megaplus 1.6, under "Video"==>"Set Camera" click "Non-Standard", then load MP16d.ini for continuous digital acquisition.

DOS and Windows Software Development Kits
The MV-1000 DOS and Windows Developer's Toolkits provide flexible high level functions that enable quick application development with the Megaplus cameras.

As has been described in the previous section, MuTech provides several Camera Configuration files for the Megaplus 1.6 camera in the standard release of its Software Development Tools.

Application Program to display 8 and 10 bit image using Megaplus 1.6

The following program coded in C and compiled using a Watcom compiler displays 8 bit and 10 bit images. The function "MV1LoadCameraConfigFile" may be used to load the "mp16d.ini" camera configuration file. The MV-1000 Look Up Tables(LUTs) can be programmed to work for different pixel sizes. The pixel size can be 8, 10 or 12 bits. Four functions in the SDK are important for programming the LUTs and have been used in the program. Software functions are available to configure the MV-1100 board to work for different pixel sizes. The pixel size can be 8, 10 or 12 bits.

Depending upon 8 bit or 10 bit display, certain jumper settings have to be changed. Jumpers JP7, JP8, JP19 and JP20 must be in the TOP position for 8 bit mode and in bottom position for 10 bit mode. Jumpers JP10 and JP11, located on the MV-1100, must be in IN and OUT respectively. The last two jumper changes are necessary when using the board with a 10 bit camera.

/* Application program to use the MP16 camera to display 8 and 10 bit data */

#include 
#include 
#include 
#include "mv1.h"

INT VESA_VGA_MODE=0x103;  /* Use VESA 800x600 graphics mode */
MV1Frame *Frame;
void MoveToVGA()
{
MV1WaitVSync();
MV1FrameGrab2VGA(Frame, 0, 0);
}

main()
{
int i, numboard, t;
char huge *buffer;

MV1InitCFG	board_init;
MV1GrabWindow	grabWindowMP16;
MV1Frame	MP16Frame;

/* Checking to see if the VGA card can support 800x600 mode resolution */
	if (MV1VGAInit(0x103, NULL))
	{
	printf("Your VGA card does not support the 800x600 mode resolution\n");
	exit(1);
	}

/* Checking for presence of board */
	if ((numboard=MV1Open()) < 0)
	{
	printf("MV-1000 board has not been installed on your PC\n");
	exit(1);
	}

/* Setting board number and initializing board */
	for (i=0; i < numboard; i++)
	{
	MV1SetCurrentBoard(i);
	MV1Init(MV1CamConfig*)NULL, (MV1InitCFG*)NULL);
	}

/* Setting parameters for MP 16 specifications */
	MV1SetCurrentCamera(1);
	MV1LoadCameraConfigFile("c:\\mv-1000\\camcfg\\mp16d.ini", "CamConfig");
	printf("Enter 0 for 8 bit display and 1 for 10 bit\n");
	printf("display\n");
	scanf("%d", &t);

	switch(t)
	{
	case 0:
	/* Select LUT tables */
	 MV1SelectPixelMode(MV1_10bit_Mode);
	 MV1SetLUTMode(MV1_10bit_Mode);
	 MV1SelectLUTBank(0);
	 MV1LoadLUTDefault10to8Bit(0);
	 MV1GraphMode(1);
	 break;

	case 1:
	MV1SetLUTMode(MV1_10bit_Mode);
	MV1SelectLUTBank(0);
	MV1SelectPixelMode(MV1_10bit_Mode);
	MV1LoadLUTDefault10Bit(0);
	MV1GraphMode(1);
	break;

	default:
	printf("Unknown choice\n");
	break;
	}

/* Defining a grab window to capture image frames */
	MV1SetGrabWindow(0, 0, 0, 512, 512, &grabWindowMP16);
/* Want to see full image */
	MV1CreateFrame(&MP16Frame, 0, 0, 512, 512, &grabWindowMP16);
	buffer=MTMALLOC(512*512);
	MV1StartGrab(MV1_Cont_Grab, MV1_Grab_Odd);

/* Display 1000 frames of live video */
	for (i=0;i<1000;i++)
	{
	MV1WaitVSync();
	MV1FrameRead(&MP16Frame, 0, 0, 512, 512, buffer);
	MV1DisplayData2VGA(&MP16Frame, 0, 0, buffer);

/* Stop the process by pressing any key */
	if (_KBHIT_()) {
	_GETCH_();
	break;
	}
	}

/* cleanup */

	MV1StopGrab();
	MV1TextMode();
	MTFREE(buffer);
	MV1Close();

	}



MuTech Corp. July 1996
Return to MuTech Homepage