MV1000 Application Notes


Interfacing the Pulnix TM-1001 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 TM-1001 in analog mode requires the use of the MV-1000. The digital mode requires the addition of the MV-1100 digital module. This module accepts the RS-422 differential video and timing signals from the TM-1001 camera. The MV-1100 can also output the necessary output signals to the camera.

Pulnix TM-1001
The TM-1001 is a 15 frame/second progressive scanning (non-interlaced) shutter camera. In digital mode, the TM-1001 outputs non-interlaced digital video and timing in RS-422 (differential) format. The TM-1001 has integration and asynchronous reset capability.

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 TM-1001 camera. The part number is MVCGEN. The MVCGEN cable has a 37 pin male D-sub connector on the camera interface. Another digital cable (supplied by Pulnix) is available to interface the Mutech cable to the digital connector on the back of the TM-1001 camera.

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/1100.

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 use these Camera Config Files to set the board and chip registers into the correct state to work with a particular camera. The easiest way to verify proper functioning of the TM-1001 camera is through the DOS diagonostic program "Camtest.exe." This program resides in the ..\diag subdirectory.

Camtest.exe uses Camera Configuration files that are included on the Mutech distribution diskette. These files are used to operate the TM-1001 camera in different modes.

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

To use Camtest.exe with the TM-1001 camera in integration mode, type...
"camtest ..\camcfg\tm1000di.ini" The tm1000di.ini file enables integration control in digital mode. When using it with Camtest.exe, hitting the "s" key enables integration for approximately 7 frame periods.

To use Camtest.exe with the TM-1001 camera in asynchronous reset mode, type...
"camtest ..\camcfg\tm1000dr.ini" The tm1000dr.ini file enables asynchronous shutter mode control. When using it with Camtest.exe, hitting the "s" key enables the asynchronous shutter mode on the camera, and immediately acquires the resulting image into the board memory.

To use Camtest.exe with the TM-1001 camera in analog mode, type...
"camtest ..\camcfg\tm1000a.ini" at the DOS prompt. The tm1000a.ini file is designed to enable analog acquisition from the camera. A coaxial video cable must be connected from the board to one of the analog video channels on the MV-1000 base board. Mutech provides a cable called the VC-7. The red cable of the VC-7 must be connected to the MV-1000 board.

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

Camera Control Settings
The following are the camera control settings that have to be followed when operating the camera in different modes.

Normal Grabbing:
The switch in the back should be in NRM position.
The switch in the back must be in the NSP position.
The rotary function dial must be set at 0.

Integration Mode:
The switch in the back should be in NRM position.
The switch in the back must be in the NSP position.
The rotary function dial must be set at 0.

Asynchronous Reset Mode:
The switch in the back should be in ASY position.
The switch in the back must be in the NSP position.
The rotary function dial may be set between 1 and 9.

Application Programs to demonstrate operation of TM-1001 with MV-1000/1100

The following program coded in C and compiled using a Watcom compiler displays a 512X512 image using the TM-1001 camera. in digital mode. Since this is a 8 bit camera and 8 bit image is to be displayed, jumpers JP7, JP8, JP19 and JP20 must be in the top position. Jumpers JP10 on the MV-1100 module is moved to JP17 and JP 11 is IN. The function "MV1LoadCameraConfigFile" must be used to load the "tm1000d.ini" camera configuration file.

In principle, when trying to operate the camera in normal digital mode, integration or asynchronous mode, the appropriate camcfg files need to be loaded using the above mentioned API function. The following example program demonstrates continuous digital acquisition. The tm1001d.ini file has been loaded using the function "MV1LoadCameraConfigFile". For enabling integration, the file tm1000di.ini has to be used instead, and for asynchronous reset capability, the file tm1000dr.ini has to be used. When developing custom applications, necessary changes may be made to the camcfg files and the appropriate file may then be loaded in. This is the simplest way to change the camcfg files and needs no further explanation.



#include < stdio.h >
#include < string.h >
#include < malloc.h >
#include "mv1.h"

INT VESA_VGA_MODE=0X103; /# Use VESA 800X600 graphics mode */
MV1Frame *Frame;
VoidMoveToVGA()
{
MV1WaitSync();
MV1FrameGrab2VGA)Frame,0,0);
}

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

MV1InitCFG		board_init;
MV1GrabWindow	grabWindowtm1000d;
MV1Frame		tm1000dFrame;

/* Checking to see if 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("The MV-1000 board has not been installed in your PC\n");
exit(1);
}

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

/* Setting parameters for TM-1000 digital camera specification */
MV1SetCurrentCamera(1);
MV1LoadCameraConfigFile("c:\\mv-1000\\camcfg\\tm1000d.ini", "CamConfig");

/* Defining a grab window to capture image frames */
MV1SetGrabWindow(0,0,0,512,512,&grabWindowtm1000d);
MV1GraphMode(1);
buffer=MTMALLOC(512*512);
MV1StartGrab(MV1_Cont_Grab, MV1_Grab_Odd);

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

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

/* Cleanup */
MTFREE(buffer);
MV1StopGrab();
MV1TextMode();
MV1Close();
}



The MV-1000 software developent kit also provides the capability to change the camcfg files using the API. The choice of these two techniques is completely up to the user.

The API function "MV1SetDigCameraControl" is used to set various controls of the MV-1100 module to work with different digital cameras and to program the different registers on the MV-1100 board. In esssence, this function is used, instead of physically altering the ini files, as explained above. The program shown in the following application program uses the above function to change the tm1000d.ini file to enable operation in integration mode. The use of the integration mode is purely coincidental. Application users can change the program to work with asynchronous mode also. There is one change, however, that has to be made to the "tm1000d.ini" file. The flag for Tim_Gen_Enable has to be set to 1. This is necessary because at this point, there is no function in the API to enable the timing generator. The other changes that are necessary have been made using the above mentioned API function. The letter "q" allows the user to exit the program and the letter "i' enables integration.



#include < stdio.h >
#include < string.h >
#include < malloc.h >
#include "mv1.h"

INT VESA_VGA_MODE=0X103;  /* Use VESA 800X600 graphics mode */

MV1Frame *Frame;
VoidMoveToVGA()
{
MV1WaitSync();
MV1FrameGrab2VGA(Frame,0,0);
}

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

MV1InitCFG		board_init;
MV1GrabWindow	grabWindowtm1000d;
MV1Frame		tm1000dFrame;

/* Checking to see if 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("The MV-1000 board has not been installed in your PC\n");
exit(1);
}

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

/* Setting parameters for TM-1000 digital camera specification */
MV1SetCurrentCamera(1);
MV1LoadCameraConfigFile("c:\\mv-1000\\camcfg\\tm1000d.ini", "CamConfig");

/* Defining a grab window to capture image frames */
MV1SetGrabWindow(0,0,0,512,512,&grabWindowtm1000d);
/* Want to see full image */
MV1CreateFrame(&tm1000dFrame,0,0,512,512,&grabWindowtm1000d);
MV1GraphMode(1);
buffer=MTMALLOC(512*512);

while(1){
/*Selects digital camera as reference */
MV1SetDigCameraControl(MV1_Dig_Timing_Source,1);
/* Controls the output of pin MC0, MC1, MC2 on J2 connector */
MV1SetDigCameraControl(MV1_Dig_Mode_Control,0);
/* Detemine that the start of the MV-1100 counter is to be triggered by software signal */
MV1SetDigCameraControl(MV1_Dig_Trig_Enable,0);
/* Selects software trigger as the mode of trigger */
MV1SetDigCameraControl(MV1_Dig_Soft_Trig,0);

if(_KBHIT_()){
if((ch=_GETCH_())=='q');
break;
else if (ch=='i'){
/* Selects INTEG as output signal at pin 38 of J2 connector */
MV1SetDigCameraControl(MV1_Dig_Select_INTEG,0);
}

/* Grabbing and displaying frame */
MV1StartGrab(MV1_Single_Grab, MV1_Grab_Odd);
MV1WaitVSync();
MV1FrameRead(&tm1000dFrame,0,0,512,512,buffer);
MV1DisplayData2VGA(&tm1000dFrame,0,0,buffer);
getch();

/* cleanup */
MV1TextMode();
MTFREE(buffer);
MV1Close();
}
}
}



MuTech Corp. July 1996
Return to MuTech Homepage