Difference between revisions of "GX mipi camera manual"

From wiki_veye
Jump to navigation Jump to search
 
Line 410: Line 410:
 
'''Script functions:''' <code>trgnum</code>, <code>trginterval</code>, <code>trgsrc</code>, <code>trgexp_delay</code>, <code>trgdelay</code>, <code>triggercyclemin</code>
 
'''Script functions:''' <code>trgnum</code>, <code>trginterval</code>, <code>trgsrc</code>, <code>trgexp_delay</code>, <code>trgdelay</code>, <code>triggercyclemin</code>
  
====== Trigger Source ======
+
======Trigger Source======
 
The camera supports two types of trigger sources: '''software trigger''' and '''hardware trigger'''. The only difference between them is the source of the trigger signal. Configurations and functions such as '''trigger delay''', '''exposure delay''', '''trigger frame count''', and '''trigger interval''' are identical for both sources.
 
The camera supports two types of trigger sources: '''software trigger''' and '''hardware trigger'''. The only difference between them is the source of the trigger signal. Configurations and functions such as '''trigger delay''', '''exposure delay''', '''trigger frame count''', and '''trigger interval''' are identical for both sources.
  
Line 417: Line 417:
 
'''Script function:''' <code>trgsrc</code>
 
'''Script function:''' <code>trgsrc</code>
  
* '''Software Trigger'''
+
*'''Software Trigger'''
  
 
A software trigger is initiated by writing <code>1</code> to the corresponding register of the camera via the I²C bus.
 
A software trigger is initiated by writing <code>1</code> to the corresponding register of the camera via the I²C bus.
Line 425: Line 425:
 
'''Script function:''' <code>trgone</code>
 
'''Script function:''' <code>trgone</code>
  
* '''Hardware Trigger'''
+
*'''Hardware Trigger'''
  
 
In hardware trigger mode, the camera detects trigger signals via the '''TrigIN IO''' level changes. For details, see the '''IO Control''' section.
 
In hardware trigger mode, the camera detects trigger signals via the '''TrigIN IO''' level changes. For details, see the '''IO Control''' section.
Line 431: Line 431:
 
'''Script function:''' <code>trgedge</code>
 
'''Script function:''' <code>trgedge</code>
  
====== Trigger Statistics ======
+
======Trigger Statistics======
 
The trigger statistics function tracks the '''total number of triggers''' and the '''number of lost triggers'''.
 
The trigger statistics function tracks the '''total number of triggers''' and the '''number of lost triggers'''.
  
* '''Definition of total triggers:'''
+
*'''Definition of total triggers:'''
** In hardware trigger mode: the number of triggers after trigger filtering.
+
**In hardware trigger mode: the number of triggers after trigger filtering.
** In software trigger mode: all triggers are counted.
+
**In software trigger mode: all triggers are counted.
  
 
If the camera receives a hardware or software trigger signal while it is already within a trigger cycle, it cannot respond to the new signal, causing trigger loss.
 
If the camera receives a hardware or software trigger signal while it is already within a trigger cycle, it cannot respond to the new signal, causing trigger loss.
Line 444: Line 444:
 
'''Script functions:''' <code>trgcount</code>, <code>trgclr</code>
 
'''Script functions:''' <code>trgcount</code>, <code>trgclr</code>
  
===== Synchronization Mode =====
+
=====Synchronization Mode=====
 
'''Applicable models:''' GX-MIPI-IMX662, GX-MIPI-IMX664
 
'''Applicable models:''' GX-MIPI-IMX662, GX-MIPI-IMX664
  
Line 454: Line 454:
  
 
'''Script function:''' <code>slavemode</code>
 
'''Script function:''' <code>slavemode</code>
 +
 +
<br />
 +
 +
=== Image Properties ===
 +
 +
==== Image Orientation ====
 +
Used to set or read the output orientation of the camera image.
 +
 +
'''Values:'''
 +
 +
* 0 — Normal
 +
* 1 — Mirror (horizontal flip)
 +
* 2 — Flip (vertical flip)
 +
* 3 — Flip & Mirror (horizontal + vertical flip)
 +
 +
'''Script function:''' <code>imgdir</code>[[File:Test11.png|alt=Gx Camera Mirror/Flip|center|thumb|597x597px|Gx Camera Mirror/Flip|link=http://wiki.veye.cc/index.php/File:Test11.png]]<br />
 +
 +
==== Day/Night Mode and ICR (IR-CUT) Control ====
 +
This feature is used in surveillance scenarios. Typically, day/night mode, infrared (IR) illuminators, and ICR work together to achieve clear, color images during the day and high-contrast, discreet images at night.
 +
{| class="wikitable"
 +
!Mode
 +
!Image
 +
!IR Illuminator
 +
!ICR
 +
|-
 +
|Day Mode
 +
|Color
 +
|Off
 +
|IR Filter
 +
|-
 +
|Night Mode
 +
|B/W
 +
|On
 +
|Glass
 +
|}
 +
Among these three, the camera only controls '''day/night mode''' and '''ICR status''', not the IR illuminator.
 +
 +
Typically, the IR illuminator board supports day/night detection and outputs a level signal to the camera to trigger day/night mode switching. The GX series cameras use '''J2-1 pin''' to receive this signal.
 +
 +
===== Day/Night Mode Values: =====
 +
 +
* 0: Color mode
 +
* 1: B/W mode
 +
* 2: External trigger mode
 +
 +
In modes 0 and 1, day/night mode is controlled via software registers, ignoring the J2-1 signal. In mode 2, the J2-1 pin level determines day/night mode.
 +
 +
'''Script function:''' <code>daynightmode</code>
 +
 +
===== Trigger Pin Polarity =====
 +
Configures the polarity of the J2-1 pin. By default, high = day, low = night. Setting this value to 1 reverses the polarity (high = night, low = day).
 +
 +
'''Script function:''' <code>pinpolarity</code>
 +
 +
===== ICR Control =====
 +
ICR (IR-CUT) usually has two control pins to switch between IR filter and clear glass in front of the sensor, controlling light filtering.
 +
 +
The camera supports the <code>ircutdir</code> parameter to adapt to different ICR pin configurations.
 +
 +
'''J4: IRCUT Function Table'''
 +
{| class="wikitable"
 +
!Mode
 +
!Pin
 +
!Name
 +
!Polarity
 +
!Filter Position (ircutdir=0)
 +
!Filter Position (ircutdir=1)
 +
|-
 +
|1
 +
|J4-1
 +
|IRCUT1
 +
| -
 +
|IR Cut
 +
|Full Spectrum Pass
 +
|-
 +
|
 +
|J4-2
 +
|IRCUT2
 +
| +
 +
|
 +
|
 +
|-
 +
|2
 +
|J4-1
 +
|IRCUT1
 +
| +
 +
|Full Spectrum Pass
 +
|IR Cut
 +
|-
 +
|
 +
|J4-2
 +
|IRCUT2
 +
| -
 +
|
 +
|
 +
|}
 +
The camera supports periodic ICR control:
 +
 +
* '''Enabled:''' outputs a control signal at a default cycle. Suitable for unstable or high-vibration scenarios but slightly increases overall power consumption.
 +
* '''Disabled:''' outputs control signal only during mode switching. Suitable for stable, low-vibration environments.
 +
 +
'''Script functions:''' <code>ircutdir</code>, <code>ircuttimer</code>
 +
 +
==== MIPI Signal Parameters ====
 +
 +
===== Number of MIPI Lanes =====
 +
Reads the current number of MIPI lanes. This is read-only. Default: 2 lanes.
 +
 +
'''Script function:''' <code>lanenum</code>
 +
 +
===== MIPI Lane Data Rate =====
 +
Reads the current MIPI lane data rate. This is read-only. Default: 1188 Mbps.
 +
 +
'''Script function:''' <code>mipidatarate</code>
 +
 +
==== Test Image ====
 +
 +
===== Vertical Color Stripes =====
 +
[[File:Vertical color stripes.png|center|thumb|800x800px|Gx Vertical color stripes|link=http://wiki.veye.cc/index.php/File:Vertical_color_stripes.png]]'''Script function:''' <code>testimg</code>

Latest revision as of 10:29, 10 March 2026

查看中文

GX Series MIPI Camera Module Manual

1 Overview

The GX series camera modules feature a high-performance ISP (Image Signal Processor), supporting multiple operating modes and providing extensive configuration options. The products have been thoroughly validated in terms of system stability, manufacturing quality control, and supply capability, making them suitable for embedded vision systems and AI vision applications.

GX series MIPI camera modules use a standard 22-pin FPC user interface, which simplifies system integration. They can be directly connected to a variety of mainstream embedded platforms, such as platforms based on Raspberry Pi Ltd, NVIDIA Jetson series, and the Rockchip RK3588 platform.

This document mainly introduces the functional features and working principles of the GX series products.

For the following topics, please refer to the corresponding dedicated documentation:

  • Hardware Interface Manual
  • Register Description Document
  • Configuration Script Guide
  • Driver and User Guides for each embedded platform

In this document, each functional section includes a [Script Function] column. This column lists the relevant commands of the gx_mipi_i2c.sh script to help users configure and debug specific features conveniently.

1.1 Camera Model List

Series Model Max Resolution Shutter Mode
GX series GX-MIPI-IMX662 1920×1080@60 fps Rolling Shutter
GX series GX-MIPI-IMX664 2688×1520@30 fps Rolling Shutter
GX series GX-MIPI-AR0234 1920×1200@54 fps Golbal Shutter

2 Basic Functions

This chapter introduces the basic management functions of the camera, including device information access, parameter management, and system control.

Through these registers, users can obtain device identification information, manage camera configuration parameters, and perform system-level operations.

2.1 Device Information

The camera provides several read-only registers for querying basic device information. These parameters can be used for device identification, system management, and software debugging.

The information includes:

  • Manufacturer name
  • Product model
  • Sensor model
  • Device serial number
  • Firmware version
2.1.1 Manufacturer Name

The name of the camera manufacturer.

Script Function: manufacturer

2.1.2 Product Model

The model identifier of the camera.

Script Function: model

2.1.3 Sensor Model

The image sensor model used by the camera.

Script Function: sensorname

2.1.4 Serial Number

Each camera is assigned a unique serial number during manufacturing.

The serial number contains information about the production date, batch, and unit number.

Script Function: serialno

2.1.5 Firmware Version

Returns the firmware version information of the camera.

This register is a 32-bit value in the format:

Where:

  • AA.BB represents the control firmware version (C version)
  • CC.DD represents the logic firmware version (L version)

2.2 Parameter Management

The camera supports saving the current configuration parameters to internal Flash memory.

Saved parameters are automatically loaded when the camera powers on.

2.2.1 Save Parameters

Saves the current camera configuration parameters to Flash.

Notes:

  • This operation erases and rewrites the system Flash memory
  • The power supply must remain stable during the operation
  • Frequent execution of this operation is not recommended

Script Function: paramsave

2.2.2 Restore Factory Parameters

Restores all camera parameters to the factory default configuration.

Notes:

  • This operation erases and rewrites the system Flash memory
  • The power supply must remain stable during the operation
  • Frequent factory resets are not recommended

Script Function: factoryparam

2.3 System Control

The camera provides several basic system control functions, such as device reboot and system uptime query.

2.3.1 System Reboot

Executing this operation will restart the camera.

Script Function: reboot

2.3.2 System Timestamp

The elapsed running time since the camera was powered on.

This parameter can be used for:

  • System debugging
  • Device uptime statistics
  • Simple synchronization reference

Script Function: timestamp

2.3.3 I²C Address Configuration

The camera allows the I²C communication address to be configured through a register.

Users can modify the camera's I²C address according to system requirements to avoid address conflicts in multi-device systems.

Configuration details:

  • Configurable address range: 0x08 – 0x77
  • After modification, the Save Parameters operation must be executed
  • The new address takes effect after the device is rebooted

Script Function: i2caddr

3 Image Acquisition

3.1 Rolling Shutter and Global Shutter

Image sensors can be classified into two types based on their exposure method: rolling shutter and global shutter.

Different exposure methods behave differently when capturing moving objects or operating in triggered modes.

3.1.1 Rolling Shutter

The operation of a rolling shutter sensor is illustrated in the following figure.

In this mode, the rows of the image start exposure sequentially:

  • The first row begins exposure first.
  • After one row period, the second row starts exposure.
  • This process continues, with the Nth row starting exposure immediately after the (N−1)th row.

Once the first row finishes exposure, data readout begins. Reading each row of data takes one row period, including the row blanking time.

When the first row has been read out, the second row begins reading. Subsequent rows are read sequentially until the entire image is output.

Rolling shutter sensors have the following characteristics:

  • Relatively simple structure
  • Lower cost
  • Capable of achieving high resolution

Therefore, rolling shutter is suitable for imaging applications involving static scenes or slowly moving targets.

Rolling shutter mode
Rolling shutter mode
3.1.2 Global Shutter

The operation of a global shutter sensor is illustrated in the following figure.

In global shutter mode:

  • All pixels on the sensor begin exposure simultaneously.
  • All pixels end exposure simultaneously.

After the exposure ends, the sensor transfers the charges from the photosensitive area to the storage area, and then reads out pixel data row by row.

This method ensures that:

  • All pixels are sampled at the same time.
  • The image is free from motion distortion.

Therefore, global shutter is particularly suitable for capturing fast-moving targets, such as:

  • Industrial inspection
  • Robotic vision
  • Motion tracking
Global shutter mode

3.2 Start/Stop Acquisition

Users can send a start acquisition or stop acquisition command to the camera at any time.

When the camera receives a start acquisition command:

  • If it is currently operating in video streaming mode, the camera will immediately begin exposure and continuously output images.
  • If it is currently operating in trigger mode, the camera will enter a waiting for trigger signal state.

At this point, the camera status changes to Running.

When the camera receives a stop acquisition command:

  1. The camera will first complete the transmission of the current image frame to ensure frame data integrity.
  2. Then it will stop outputting images.
  3. The camera status changes to Standby.

Note:

If the current configuration is multi-frame trigger mode and the trigger sequence is not yet complete, the stop acquisition command will interrupt the ongoing trigger process. Therefore, stopping acquisition only guarantees the integrity of the current frame, but does not guarantee the integrity of the entire trigger sequence.

In general, the driver automatically sends start/stop acquisition commands, so users do not need to manually control the registers.

Script function: imgacq

3.3 Video Mode

The GX series cameras support multiple video modes, with each mode corresponding to a specific resolution, maximum frame rate, and image readout method.

Readout methods include Normal Mode, Binning Mode, and Subsampling Mode. In video streaming mode, the camera continuously exposes images and outputs image data in real time according to the resolution, frame rate, and readout method of the selected video mode.

The supported image modes may vary depending on the camera model. Details are provided in the table below:

Model videomode Resolution Minimum Frame Rate Maximum Frame Rate Readout Method
GX-MIPI-IMX662 1 1920×1080 0.065fps 60fps Normal
GX-MIPI-IMX664 1 2688×1520 TBD 30fps Normal
2 1344x760 TBD 100fps Binning
GX-MIPI-AR0234 1 1920×1200 TBD 54 fps Normal
2 1920×1080 TBD 60fps Normal
3 1600×1200 TBD 60fps Normal

Script function:videomodecap,videomodenum, vidoemodewh1-vidoemodewh8,videomodeparam1-videomodeparam8,videomode,fps,maxfps, curwh.

3.3.1 Pixel Readout Modes

The GX series cameras support multiple pixel readout modes: Normal Mode, Binning Mode, and Subsampling Mode. Each mode has different characteristics in terms of resolution, signal-to-noise ratio (SNR), and data bandwidth, and can be selected according to application requirements.

  • Normal Mode

The sensor reads out the full pixel array row by row, with every pixel participating in acquisition and output. This mode provides the highest resolution and best image detail, but requires higher data bandwidth.

  • Binning Mode

Adjacent pixels are combined internally on the sensor before output, improving SNR and low-light performance while reducing resolution and data bandwidth. This mode is suitable for low-light or high-sensitivity applications.

  • Subsampling Mode

Pixels are read out at fixed intervals, reducing resolution and data volume while keeping SNR largely unchanged. This mode is suitable for scenarios that require higher frame rates or lower bandwidth.

Mode Comparison

Mode Readout Method Resolution SNR Data Bandwidth
Normal Full Pixel Readout High Baseline High
Binning Pixel Binning Medium Improved Low
Subsampling Interval Medium Largely Unchanged Low
3.3.2 Current Image Parameters

The camera provides a set of registers that allow accurate reading of the current image width, height, and readout mode during secondary development or debugging.

Script functions: curwh, readmode

3.3.2.1 Pixel Format

The camera’s output format complies with the MIPI CSI-2 standard. Currently supported pixel formats are UYVY and YUYV, with UYVY as the default.

Script function: pixelformat

3.3.3 Frame Rate Configuration
3.3.3.1 Frame Rate Range

The camera provides the minimum and maximum frame rates supported in the current operating mode, which can be read via read-only registers.

Script functions: minfps, maxfps

3.3.3.2 Setting the Frame Rate

Within the range of minimum and maximum frame rates, the current frame rate can be freely set. Note that the frame rate must be configured while acquisition is stopped (Standby state) to ensure the setting takes effect.

Script function: fps

3.3.3.3 Frame Count Statistics

The camera supports statistics for both sensor output frames and camera output frames. The frame count is reset each time acquisition is started.

Script function: framecount

3.4 Work Modes

The camera may support multiple work modes, including Video Stream Mode, Normal Trigger Mode, Level Trigger Mode, and Multi-Camera Synchronization Mode.

The types of operating modes supported may vary depending on the camera model and can be queried using the workmodecap command.

Script functions: workmodecap, workmode

3.4.1 Switching Work Modes

Operating modes cannot be switched directly while the camera is running.

The following sequence must be followed:

  1. Send a stop acquisition command.
  2. Wait for the camera to enter Standby state.
  3. Modify the operating mode configuration.
  4. Start acquisition again.

Script function: workmode

3.4.2 Video Stream Mode

In video stream mode, the camera continuously exposes and outputs image data according to the configured video mode (videomode) and frame rate (fps).

In general, the driver automatically sets the registers based on the application layer’s configuration for video mode and frame rate, so users do not need to manually operate the registers.

Script functions: videomode, fps, maxfps

3.4.3 Normal Trigger Mode
3.4.3.1 Rolling Shutter

Applicable models: GX-MIPI-IMX662, GX-MIPI-IMX664

To ensure consistency of triggered images, the generation of a complete image frame (from exposure to output) requires three consecutive image cycles. Therefore, the maximum frame rate in video stream mode for these models is only one-third of the selected video mode frame rate.

These three consecutive image cycles are defined as a Trigger Cycle.

In normal trigger mode, if multiple frames are output per trigger, the trigger delay starts from the current trigger signal, while the trigger interval and exposure delay take effect before each trigger cycle begins, ensuring consistent image output for every cycle.

The figure below shows an example with trigger frame count set to 2:

GX trigger timing( Rolling shutter)


Script functions: trgnum, trginterval, trgsrc, trgexp_delay, trgdelay, triggercyclemin

3.4.3.2 Global Shutter (Smartsens Type)

Applicable models: GX-MIPI-AR0234

For Global Shutter sensors of this type, the acquisition of one frame consists of two stages:

  1. Exposure Stage
  2. Readout Stage

The next frame’s exposure can only start after readout is complete.

Thus, in trigger mode, a Trigger Cycle consists of one exposure period + one readout period.

Because the exposure time affects the total duration of the trigger cycle, the maximum frame rate in trigger mode is usually lower than that in video stream mode.

The figure below shows an example with trigger frame count set to 2:

Normal trigger mode (Global shutter)


Script functions: trgnum, trginterval, trgsrc, trgexp_delay, trgdelay, triggercyclemin

3.4.3.3 Trigger Source

The camera supports two types of trigger sources: software trigger and hardware trigger. The only difference between them is the source of the trigger signal. Configurations and functions such as trigger delay, exposure delay, trigger frame count, and trigger interval are identical for both sources.

Note: Trigger source settings are only effective in Normal Trigger Mode and Rolling Shutter Multi-Frame Trigger Mode.

Script function: trgsrc

  • Software Trigger

A software trigger is initiated by writing 1 to the corresponding register of the camera via the I²C bus.

Due to software processing and I²C transmission delays, the responsiveness of a software trigger is lower than that of a hardware trigger. For applications requiring high timing accuracy, hardware trigger is recommended.

Script function: trgone

  • Hardware Trigger

In hardware trigger mode, the camera detects trigger signals via the TrigIN IO level changes. For details, see the IO Control section.

Script function: trgedge

3.4.3.4 Trigger Statistics

The trigger statistics function tracks the total number of triggers and the number of lost triggers.

  • Definition of total triggers:
    • In hardware trigger mode: the number of triggers after trigger filtering.
    • In software trigger mode: all triggers are counted.

If the camera receives a hardware or software trigger signal while it is already within a trigger cycle, it cannot respond to the new signal, causing trigger loss.

Switching the operating mode or trigger source does not automatically clear these statistics.

Script functions: trgcount, trgclr

3.4.4 Synchronization Mode

Applicable models: GX-MIPI-IMX662, GX-MIPI-IMX664

In synchronization mode, one camera module is configured as Master, and one or more modules are configured as Slave. The Master module outputs the XVS signal, which the Slave modules receive to synchronize exposure and data output with the Master.

When using synchronization mode, ensure that videomode, workmode, and fps are identical across all cameras.

In this mode, each camera module’s exposure parameters can be configured as either Manual or Auto.

Script function: slavemode


4 Image Properties

4.1 Image Orientation

Used to set or read the output orientation of the camera image.

Values:

  • 0 — Normal
  • 1 — Mirror (horizontal flip)
  • 2 — Flip (vertical flip)
  • 3 — Flip & Mirror (horizontal + vertical flip)

Script function: imgdir

Gx Camera Mirror/Flip
Gx Camera Mirror/Flip


4.2 Day/Night Mode and ICR (IR-CUT) Control

This feature is used in surveillance scenarios. Typically, day/night mode, infrared (IR) illuminators, and ICR work together to achieve clear, color images during the day and high-contrast, discreet images at night.

Mode Image IR Illuminator ICR
Day Mode Color Off IR Filter
Night Mode B/W On Glass

Among these three, the camera only controls day/night mode and ICR status, not the IR illuminator.

Typically, the IR illuminator board supports day/night detection and outputs a level signal to the camera to trigger day/night mode switching. The GX series cameras use J2-1 pin to receive this signal.

4.2.1 Day/Night Mode Values:
  • 0: Color mode
  • 1: B/W mode
  • 2: External trigger mode

In modes 0 and 1, day/night mode is controlled via software registers, ignoring the J2-1 signal. In mode 2, the J2-1 pin level determines day/night mode.

Script function: daynightmode

4.2.2 Trigger Pin Polarity

Configures the polarity of the J2-1 pin. By default, high = day, low = night. Setting this value to 1 reverses the polarity (high = night, low = day).

Script function: pinpolarity

4.2.3 ICR Control

ICR (IR-CUT) usually has two control pins to switch between IR filter and clear glass in front of the sensor, controlling light filtering.

The camera supports the ircutdir parameter to adapt to different ICR pin configurations.

J4: IRCUT Function Table

Mode Pin Name Polarity Filter Position (ircutdir=0) Filter Position (ircutdir=1)
1 J4-1 IRCUT1 - IR Cut Full Spectrum Pass
J4-2 IRCUT2 +
2 J4-1 IRCUT1 + Full Spectrum Pass IR Cut
J4-2 IRCUT2 -

The camera supports periodic ICR control:

  • Enabled: outputs a control signal at a default cycle. Suitable for unstable or high-vibration scenarios but slightly increases overall power consumption.
  • Disabled: outputs control signal only during mode switching. Suitable for stable, low-vibration environments.

Script functions: ircutdir, ircuttimer

4.3 MIPI Signal Parameters

4.3.1 Number of MIPI Lanes

Reads the current number of MIPI lanes. This is read-only. Default: 2 lanes.

Script function: lanenum

4.3.2 MIPI Lane Data Rate

Reads the current MIPI lane data rate. This is read-only. Default: 1188 Mbps.

Script function: mipidatarate

4.4 Test Image

4.4.1 Vertical Color Stripes
Gx Vertical color stripes

Script function: testimg