Skip to content

Commit

Permalink
update MT9J001
Browse files Browse the repository at this point in the history
  • Loading branch information
ArduCAM committed Apr 12, 2022
1 parent c122ebb commit 3768c82
Show file tree
Hide file tree
Showing 2 changed files with 448 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,224 @@
;**************************************************************************************/
; ----- camera parameter -----
; [camera parameter] Camera parameter set for USB2.0 & USB3.0 mode
;
; -- Keyname description:
; CFG_MODE = set the config mode for camera: 0 -> User define(UI)
; 1 -> This config File
; TYPE = set the name of the camera module
; SIZE = set the width and height of the image generated by camera
; BIT_WIDTH = set the bit width of the image generated by camera
; FORMAT = set the format of the image generated by camera:
; | 0 -> RAW | 1 -> RGB565 | 2 -> YUV422 | 3 -> JPG | 4 -> MONO | 5 -> ST_RAW | 6 -> ST_MONO |
; | -- 0 -> RG | -- 0 -> RGB | -- 0 -> YUYV | | | -- 0 -> RG | |
; | -- 1 -> GR | -- 1 -> BGR | -- 1 -> YVYU | | | -- 1 -> GR | |
; | -- 2 -> GB | | -- 2 -> UYVY | | | -- 2 -> GB | |
; | -- 3 -> BG | | -- 3 -> VYUY | | | -- 3 -> BG | |
; I2C_MODE = set the bit width of the address and data of I2C communication:
; 0 -> 8 bit address & 8 bit value
; 1 -> 8 bit address & 16 bit value
; 2 -> 16 bit address & 8 bit value
; 3 -> 16 bit address & 16 bit value
; I2C_ADDR = set the I2C address for register config of camera
; G_GAIN = set the address for green1_gain register config of camera ( RAW & RGB565 & ST_RAW mode )
; B_GAIN = set the address for blue_gain register config of camera ( RAW & RGB565 & ST_RAW mode )
; R_GAIN = set the address for red_gain register config of camera ( RAW & RGB565 & ST_RAW mode )
; G2_GAIN = set the address for green2_gain register config of camera ( RAW & ST_RAW mode )
; Y_GAIN = set the address for Y_gain register config of camera ( YUV422 mode )
; U_GAIN = set the address for U_gain register config of camera ( YUV422 mode )
; V_GAIN = set the address for V_gain register config of camera ( YUV422 mode )
; GL_GAIN = set the address for global_gain register config of camera
;
; -- Keyname format:
; CFG_MODE = <value1> ;<comment>
; TYPE = <value1>
; SIZE = <width>, <height>
; BIT_WIDTH = <bitWidth>
; FORMAT = <value1>[, <value2>]
; I2C_MODE = <value1>
; I2C_ADDR = <i2cAddress>
; G_GAIN = [<page>,] <address>, <minValue>, <maxValue>
; B_GAIN = [<page>,] <address>, <minValue>, <maxValue>
; R_GAIN = [<page>,] <address>, <minValue>, <maxValue>
; G2_GAIN = [<page>,] <address>, <minValue>, <maxValue>
; Y_GAIN = [<page>,] <address>, <minValue>, <maxValue>
; U_GAIN = [<page>,] <address>, <minValue>, <maxValue>
; V_GAIN = [<page>,] <address>, <minValue>, <maxValue>
; GL_GAIN = [<page>,] <address>, <minValue>, <maxValue>
;
; <valueN> Index value representing certain meanings
; <width> Width of the image generated by camera
; <height> Height of the image generated by camera
; <bitWidth> Bit width of the image generated by camera
; <i2cAddress> I2C address for register config of camera
; <page> Optional address space for this register. Some sensors (mostly SOC's)
; have multiple register pages (see the sensor spec or developers guide)
; <address> The register address
; <minValue> Minimale value of certain address
; <maxValue> Maximale value of certain address
; <comment> Some form of C-style comments are supported in this .cfg file
;
;**************************************************************************************/
[camera parameter]
CFG_MODE = 0
TYPE = MT9J001
SIZE = 3664, 512
BIT_WIDTH = 8
FORMAT = 4, 0
I2C_MODE = 3
I2C_ADDR = 0x20
;TRANS_LVL = 64

;**************************************************************************************/
; ----- board parameter -----
;[board parameter] Board parameter set for USB2.0 & USB3.0 mode
;[board parameter][dev2] Board parameter set for USB2.0 mode
;[board parameter][dev3][inf2] Board parameter set for USB3.0 mode and USB2.0 interface
;[board parameter][dev3][inf3] Board parameter set for USB3.0 mode and USB3.0 interface
;
; -- Keyname description:
; VRCMD = set board parameter by vendor command
;
; -- Keyname format:
; VRCMD = <command>, <value>, <index>, <dataNumber>[, <data1>[, <data2>[, <data3>[, <data4>]]]] //<comment>
;
; <command> Value representing certain command
; <value> value representing certain meanings
; <index> Index representing certain meanings
; <dataNumber> Number of <dataN>
; <dataN> Data representing certain meanings
; <comment> Some form of C-style comments are supported in this .cfg file
;
;**************************************************************************************/
[board parameter]
VRCMD = 0xD7, 0x4600, 0x0100, 1, 0x05
VRCMD = 0xD7, 0x4600, 0x0200, 1, 0x00
VRCMD = 0xD7, 0x4600, 0x0300, 1, 0xC0
VRCMD = 0xD7, 0x4600, 0x0300, 1, 0x40
VRCMD = 0xD7, 0x4600, 0x0400, 1, 0x00
VRCMD = 0xD7, 0x4600, 0x0A00, 1, 0x00


[board parameter][dev2]
VRCMD = 0xF6, 0x0000, 0x0000, 3, 0x03, 0x04, 0x0C

[board parameter][dev3][inf2]
VRCMD = 0xF3, 0x0000, 0x0000, 0
VRCMD = 0xF9, 0x0004, 0x0000, 0

[board parameter][dev3][inf3]
VRCMD = 0xF3, 0x0000, 0x0000, 0
VRCMD = 0xF9, 0x0004, 0x0000, 0

;**************************************************************************************/
; ----- register parameter -----
;[register parameter] Register parameter set for USB2.0 & USB3.0 mode
;[register parameter][dev2] Register parameter set for USB2.0 mode
;[register parameter][dev3][inf2] Register parameter set for USB3.0 mode and USB2.0 interface
;[register parameter][dev3][inf3] Register parameter set for USB3.0 mode and USB3.0 interface
;
; -- Keyname description:
; REG = assign a new register value
; DELAY = delay a certain amount of milliseconds before continuing
;
; -- Keyname format:
; REG = [<page>,] <address>, <value> //<comment>
; DELAY = <milliseconds>
;
; <page> Optional address space for this register. Some sensors (mostly SOC's)
; have multiple register pages (see the sensor spec or developers guide)
; <address> the register address
; <value> the new value to assign to the register
; <milliseconds> wait for this ammount of milliseconds before continuing
; <comment> Some form of C-style comments are supported in this .cfg file
;
;**************************************************************************************/
[register parameter]

//-------------------------//
REG = 0x0103, 0x0001 //SOFTWARE_RESET
DELAY = 100
//-------------------------//

; Recommended Default Register Changes
REG = 0x316C, 0x0429 //
REG = 0x3174, 0x8000 //
REG = 0x3E40, 0xDC05 //
REG = 0x3E42, 0x6E22 //
REG = 0x3E44, 0xDC22 //
REG = 0x3E46, 0xFF00 // Added to improve dark frame nonuniformity.
REG = 0x3ED4, 0xF998 //
REG = 0x3ED6, 0x9789 //
REG = 0x3EDE, 0xE41A // Set to 0xE412 in low-power mode.
REG = 0x3EE0, 0xA43F //
REG = 0x3EE2, 0xA4BF // ADC Bias Voltage
REG = 0x3EEC, 0x1221 // Removes saturation noise that could be seen in Low Power Mode.
REG = 0x3EEE, 0x1224 //


; 3664x2748
REG = 0x0100, 0x0 // Mode Select = 0x0
REG = 0x0300, 0x6 // vt_pix_clk_div = 0x6
REG = 0x0302, 0x01 // vt_sys_clk_div = 0x1
REG = 0x0304, 0x07 // pre_pll_clk_div = 0x4
REG = 0x0306, 0x80 // pll_multiplier = 0x6E
REG = 0x0308, 0x0C // op_pix_clk_div = 0xC
REG = 0x030A, 0x01 // op_sys_clk_div = 0x1
DELAY = 100 // DELAY = 1 // Allow PLL to lock
REG = 0x3064, 0x805 // RESERVED_MFR_3064 = 0x805
REG = 0x0104, 0x1 // Grouped Parameter Hold = 0x1
REG = 0x3016, 0x111 // Row Speed = 0x111
REG = 0x0344, 0x070 // Column Start = 0x70
REG = 0x0348, 0xEBF // Column End = 0xEBF
REG = 0x0346, 0x008 // Row Start = 0x8
REG = 0x034A, 0xAC3 // Row End = 0xAC3
REG = 0x3040, 0x0041 // Read Mode = 0x41
REG = 0x0400, 0x0 // Scaling Mode = 0x0
REG = 0x0404, 0x10 // Scale_M = 0x10
REG = 0x034C, 0xE50 // Output Width = 0xE50
REG = 0x034E, 0xABC // Output Height = 0xABC
REG = 0x0342, 0x1D10 // Line Length = 0x1D10
REG = 0x0340, 0x0B4D // Frame Lines = 0xB4D
REG = 0x0202, 0x0010 // Coarse Integration Time (OPTIONAL) = 0x10
REG = 0x3014, 0x03F2 // Fine Integration Time = 0x3F2
REG = 0x3010, 0x009C // Fine Correction = 0x9C
REG = 0x3018, 0x0000 // Extra Delay = 0x0
REG = 0x30D4, 0x1080 // Cols Dbl Sampling = 0x1080
REG = 0x306E, 0x90B0 // Scalar Re-sampling = 0x90B0
REG = 0x3E00, 0x0010 // Low Power On_Off = 0x10
REG = 0x3178, 0x0000 // Summing Procedure 1 = 0x0
REG = 0x3ED0, 0x1B24 // Summing Procedure 2 = 0x1B24
REG = 0x3EDC, 0xC3E4 // Summing Procedure 3 = 0xC3E4
REG = 0x3EE8, 0x0000 // Summing Procedure 4 = 0x0
REG = 0x0104, 0x0 // Grouped Parameter Hold = 0x0
REG = 0x0100, 0x1 // Mode Select = 0x1


REG = 0x31AE, 0x0301 // Configure with the Parallel Sensor

REG = 0x301A, 0x0010 // Unlock data pedestal Register
REG = 0x3064, 0x0805 // Disable embedded data
REG = 0x301E, 0x00A8 // Set data pedestal to 168

REG = 0x301A, 0x10DC
REG = 0x0204, 0x65 //analogue gain code global
;REG = 0x0206, 0x24 //analogue gain code greenR
REG = 0x0208, 0x9a //analogue gain code red
;REG = 0x020a, 0x2a //analogue gain code blue
;REG = 0x020c, 0x24 //analogue gain code greenB
REG = 0x3012, 0x90 //coarse integration time


//3664x512
REG = 0x0346, 0x0466 //Row Start = 0x0008
REG = 0x034A, 0x0665 //Row End = 0x0AC3
REG = 0x034E, 0x0200 //Output Height = 0xABC
REG = 0x0340, 0x024D //Frame Lines = 0xB4D
REG = 0x3012, 0x0090 //coarse integration time = 0x10


[register parameter][dev3][inf2]
//REG = 0x0304, 0x06 // pre_pll_clk_div = 0x6

[register parameter][dev3][inf3]
//REG = 0x0304, 0x03 // pre_pll_clk_div = 0x3

0 comments on commit 3768c82

Please sign in to comment.