1. Home
  2. Docs
  3. Camera breakout board
  4. 0.36MP MT9V034/MT9V022 Global Shutter
  5. Software Guide

Software Guide


This page describle the basic control over the sensor registers using Arducam camera breakout board, it might not be able to cover all the detail register operations, but give you an insight how to adjust these settings.

Sensor I2C Slave Address

The MT9V034/MT9V022 camera I2C 8-bit slave address is fixed to 0x90. With 8bit regsiter address, and 16bit register value.

There is a ” model_id ” register (0x00) which can help diagnose if the I2C bus is accessable and distinguish the camera models.

Camera Modelmodel_id register ( 0x00 )

Sensor Initialization

You need a basic settings to bring up the sensor and make it working in normal streaming mode. Here is the sample config for the Window GUI.

Camera Sample Config
MT9V034_640*480 (Color)MT9V034_VGA_8bit.cfg
MT9V022_640*480 (Monochrome)MT9V022_VGA_8bit.cfg

Manual Exposure Control

The MT9V034/MT9V022 is global shutter so all the pixels are exposed at the same time. In manual exposure mode, the total exposure time is determined by the coarse shutter and fine shutter width registers. The actual total integration time, tINT is defined as:

= (number of rows of integration x row time) + (number of pixels of integration x pixel time)

There are two sets of context that hold the coarse and fine shutter width.

ContextCoarse Shutter WidthFine Shutter Width
Context A0x0B0xD5
Context B0xD20xD8

The Coarse Shutter Width equals to number of rows times row time where the row time is defined by Windows Width + Horizontal Blanking registers times master clock.

ContextWindows WidthHorizontal Blanking
Context A0x040x05
Context B0xCC0xCD

In this case, the minimum exposure time is 260 master clock Time,and the maximum exposure time is one Frame time. Basically it equals to total vertical resolution times 1 Row Time, but sometimes the vertical blanking rows should be added to extend the exposure time if needed.

ContextCoarse Shutter Width TotalFine Shutter Width Total
Context A0x0B0xD5
Context B0XD20xD8

Given the master clock is 24MHz, the minimum exposure time is around 10.8us. And if Windows Width register equals to 640, Horizontal Blanking register equals to 94, the row time equals to 30.6us.

MT9V022 (Monochrome) Exposure Example

Exposure = 0.1ms, RegAddr = 11, Value = 3

MT9V022 (Monochrome) Exposure Example

Exposure = 1ms, RegAddr = 11, Value = 32

MT9V022 (Monochrome) Exposure Example

Exposure = 2ms, RegAddr = 11, Value = 64

Manual Gain Control

Gain settings are like the ISO settings in most digital cameras. There is also global gain setting to change all the four color gains.

Here we demonstrate how to change the gain through the analogue_gain_code_global_ register (0x35). Given the exposure register 11 is 480.

MT9V034 (Color) Gain Example

RegAddr = 0x35, Value = 0x10

MT9V034 (Color) Gain Example

RegAddr = 0x35, Value = 0x25

MT9V034 (Color) Gain Example

RegAddr = 0x35, Value = 0x40

White Balance Control

The MT9V034 (Color) sensor output is RAW bayer format, there is only globall gain register available, so white balance should be done through the RAW data.

External Trigger Mode

The MT9V022/MT9V034 CMOS image sensors are designed to be able to have the exposure starting time synchronized to an external control source. This feature, called snapshot exposure, coupled with the global shutter mode of operation, is ideal for supporting the demands of machine vision systems, security and interior and exterior automotive environments. When compared to the slave mode of operation, this mode offers a simpler interface.

Many imaging applications commonly require the image sensor to capture an image only after a triggering action has taken place. This triggering action can be the passing of an object on a conveyor belt, the flash of a strobe light, or the press of a button.
The MT9V022/MT9V034 offers the ability to synchronize the start of the image sensor’s exposure with this triggering action. This synchronization is controlled on the image sensor through the use of one trigger signal, the EXPOSURE input signal. Additionally, the image sensor offers the flexibility to program the exposure time remotely. This technical note only addresses the single image sensor (non-stereoscopic) snapshot mode of operation.

When the image sensor is set to snapshot mode (R0x07, bit 4 = 1), the beginning and
duration of the exposure time are controlled. The global shutter feature of the image
sensor allows all pixels to be exposed in parallel—all pixels start exposing (integrating
charge) simultaneously and stop exposing simultaneously. When exposure stops, the
per-pixel integrated charges are digitized and read out of the chip. A new exposure
begins only after the readout of all of the pixels is completed.

For Windows GUI, you can add the line REG=0x07, 0x398 to config files above to enable the external trigger function. For hardware connection please check Hardware Guide.

In external trigger mode, there will be error message like “USB transfer timeout error”. It is common because the sensor doesn’t output anything if isn’t triggered, and there is no incoming packets to USB host. The image will only update once the camera is triggered.

Was this article helpful to you? Yes 1 No