• VmodCAM 初始化


    ; WIP Last Changed Rev: 2172
    ;**************************************************************************************       
    ; Copyright 2011 Aptina Imaging Corporation. All rights reserved.                             
    ;                                                                                             
    ;                                                                                             
    ; No permission to use, copy, modify, or distribute this software and/or                      
    ; its documentation for any purpose has been granted by Aptina Imaging Corporation.           
    ; If any such permission has been granted ( by separate agreement ), it                       
    ; is required that the above copyright notice appear in all copies and                        
    ; that both that copyright notice and this permission notice appear in                        
    ; supporting documentation, and that the name of Aptina Imaging Corporation or any            
    ; of its trademarks may not be used in advertising or publicity pertaining                    
    ; to distribution of the software without specific, written prior permission.                 
    ;                                                                                             
    ;                                                                                             
    ;      This software and any associated documentation are provided "AS IS" and                
    ;      without warranty of any kind.   APTINA IMAGING CORPORATION EXPRESSLY DISCLAIMS         
    ;      ALL WARRANTIES EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, NONINFRINGEMENT       
    ;      OF THIRD PARTY RIGHTS, AND ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS        
    ;      FOR A PARTICULAR PURPOSE.  APTINA DOES NOT WARRANT THAT THE FUNCTIONS CONTAINED        
    ;      IN THIS SOFTWARE WILL MEET YOUR REQUIREMENTS, OR THAT THE OPERATION OF THIS SOFTWARE   
    ;      WILL BE UNINTERRUPTED OR ERROR-FREE.  FURTHERMORE, APTINA DOES NOT WARRANT OR          
    ;      MAKE ANY REPRESENTATIONS REGARDING THE USE OR THE RESULTS OF THE USE OF ANY            
    ;      ACCOMPANYING DOCUMENTATION IN TERMS OF ITS CORRECTNESS, ACCURACY, RELIABILITY,         
    ;      OR OTHERWISE.                                                                          
    ;*************************************************************************************/       
    ; Default INI file for the A-2020SOC-REV3 
    ;
    ; $Revision: 28073 $
    ; $Date: 2011-05-24 14:58:00 -0700 (Tue, 24 May 2011) $ 
    ;
    ; This file holds groups of register presets (sections) specific for this sensor. The 
    ; presets allow you to overwrite the power-on default settings with optimized register 
    ; settings. 
    ; The [Demo Initialization] section contains all optimized register settings for running
    ; the sensor in the demo environment. Other sections include settings optimized for a
    ; variety of situations like: Running at different master clock speeds, running under
    ; different lighting situations, running with different lenses, etc.
    ; Most of the demonstration software (DevWare, SensorDemo, ...) make use of this file
    ; to load and store the user presets.
    ;
    ; Keyname description:
    ; REG      = assign a new register value
    ; BITFIELD = do a READ-MODIFY-WRITE to part of a register. The part is defined as a mask.
    ; FIELD_WR = Write any register, variable or bitfield, specified by its symbol name
    ; LOAD     = load an alternate section from this section
    ; STATE    = set non-register state
    ; DELAY    = delay a certain amount of milliseconds before continuing 
    ; POLL_REG = Read a register a specified number of times, or until the register
    ;            value no longer meets a specified condition. You specify the
    ;            register by its address, and it only works with simple registers.
    ;            You also specify a delay between each iteration of the loop.
    ; POLL_FIELD = Like POLL_REG except you specify the register by its symbol name
    ;            as defined in the sensor data file. POLL_FIELD works with any kind
    ;            of register or variable.
    ;
    ; Keyname format:
    ; REG      = [<page>,] <address>, <value>             //<comment>
    ; BITFIELD = [<page>,] <address>, <mask>, <value>
    ;            Some examples: 
    ;            BITFIELD=2, 0x05, 0x0020, 1 //for register 5 on page 2, set the 6th bit to 1
    ;            BITFIELD=0x06, 0x000F, 0    //for register 6, clear the first 4 bits
    ; FIELD_WR = <registername>, [<bitfieldname>,] <value>
    ; LOAD     = <section>
    ; STATE    = <state>, <value>
    ; DELAY    = <milliseconds>
    ; POLL_REG = [<page>,]<address>,<mask>,<condition>,DELAY=<milliseconds>,TIMEOUT=<count> //<comment>
    ;            Example:  Poll every 50ms, stop when value <= 8 or after 5 times (250ms).
    ;            POLL_REG= 2, 0x3F, 0xFFFF, >8, DELAY=50, TIMEOUT=5
    ; POLL_FIELD = <registername>, [<bitfieldname>,] <condition>, DELAY=<milliseconds>, TIMEOUT=<count> //<comment>
    ;            Example:  Poll every 10 ms, stop when the value = 0, or after 500ms.
    ;            POLL_FIELD= SEQ_CMD, !=0, DELAY=10, TIMEOUT=50
    ;
    ; <page>         Optional address space for this register. Some sensors (mostly SOC's)
    ;                have multiple register pages (see the sensor spec or developer's guide)
    ; <address>      the register address
    ; <value>        the new value to assign to the register
    ; <mask>         is the part of a register value that needs to be updated with a new value
    ; <registername> Name of a register or variable as defined the sensor data (.sdat) file
    ; <bitfieldname> Optional name of a bitfield
    ; <condition>    <  <=  ==  !=  >  or  >=  followed by a numerical value
    ; <count>        Number of iterations of the polling loop
    ; <section>      the name of another section to load
    ; <state>        non-register program state names [do not modify]
    ; <milliseconds> wait for this ammount of milliseconds before continuing 
    ; <comment>      Some form of C-style comments are supported in this .ini file
    ;
    ;*************************************************************************************/
    
    [Reset]
    //-------------------------------------
    // Reset Image Sensor by Resetting MCU
    //-------------------------------------
    FIELD_WR=MCU_BOOT_MODE, RESET_MCU, 1  //RESET_MCU  stop MCU
    FIELD_WR=MCU_BOOT_MODE, RESET_MCU, 0  //RESET_MCU  start MCU
    DELAY=100
    
    [Demo Initialization]
    //-----------------------------------------------------------
    // This Section Loads all the defaults from the sub-sections
    //-----------------------------------------------------------
    LOAD=Powerup
    DELAY=500
    LOAD=PLL Setup 24Mhz/80Mhz Out
    LOAD=Lens Correction_Largan 971A
    LOAD=LUT_Moderate
    LOAD=AE
    LOAD=Mode
    LOAD=Sequencer_Optimized_HiSat_Sharp
    LOAD=Noise Reduction Test
    ;LOAD=Low Power Preview 15 FPS
    LOAD=State Setup
    LOAD=Refresh
    
    // Resync FPS reporting
    DELAY= 20
    STATE= Detect Master Clock, 1
    
    [Powerup]
    //---------------------------------------------
    // Per default the sensor comes up in standby, 
    // this enables the image output
    //---------------------------------------------
    REG=0x301A,0x0ACC                  //Reset Register
    FIELD_WR= STANDBY_CONTROL,0x0008   //Allow Standby	  
    
    [Refresh]
    //---------------------------------------
    // This Section refreshes the variables
    //---------------------------------------
    REG= 0x338C, 0xA103 	// MCU_ADDRESS [SEQ_CMD]
    REG= 0x3390, 0x0005 	// MCU_DATA_0
    DELAY=500			//Wait
    
    
    [State Setup]
    //---------------------------------------
    //These settings are used by DevWare to 
    //Desplay the correct framerate and select
    //The correct image capture mode
    //----------------------------------------
    STATE=Still Mode, 1
    //STATE=Num Capture Frames, 4
    //STATE=Still Capture Average, 1
    STATE=Save 24bpp BMP, 1
    STATE=Save RAW, 0
    STATE=Save TXT, 1
    STATE=Save HEX, 0
    STATE=Save RAW TIFF, 0
    STATE=Save 48bpp COLOR TIFF, 0
    STATE=Save RAW JPEG, 0
    STATE=Save BMP Info, 0
    STATE=Display Zoom, 4
    
    [Viewfinder ON]
    FIELD_WR = SEQ_CAP_MODE, VIDEO, 0 //VIDEO Off
    FIELD_WR = SEQ_CMD, 1          //Back to preview
    
    [Viewfinder OFF]
    FIELD_WR = SEQ_CAP_MODE, VIDEO, 1 //VIDEO On
    FIELD_WR = SEQ_CMD, 2          //Capture on
    
    [Video Capture ON]
    FIELD_WR = SEQ_CAP_MODE, VIDEO, 1 //VIDEO On
    FIELD_WR = SEQ_CMD, 2          //Capture on
    
    [Video Capture OFF]
    FIELD_WR = SEQ_CMD, 1          //Back to preview
    
    [Enable Capture with LED Flash]
    REG= 0x338C, 0xA106 	// MCU_ADDRESS [SEQ_FLASHTYPE]
    REG= 0x3390, 0x0001 	// MCU_DATA_0
    REG= 0x338C, 0xA135 	// MCU_ADDRESS [SEQ_PREVIEW_2_FLASH]
    REG= 0x3390, 0x0001 	// MCU_DATA_0
    REG= 0x338C, 0xA13C 	// MCU_ADDRESS [SEQ_PREVIEW_3_FLASH]
    REG= 0x3390, 0x0001 	// MCU_DATA_0
    
    [Disable Capture with Flash]
    REG= 0x338C, 0xA106 	// MCU_ADDRESS [SEQ_FLASHTYPE]
    REG= 0x3390, 0x0000 	// MCU_DATA_0
    REG= 0x338C, 0xA135 	// MCU_ADDRESS [SEQ_PREVIEW_2_FLASH]
    REG= 0x3390, 0x0000 	// MCU_DATA_0
    REG= 0x338C, 0xA13C 	// MCU_ADDRESS [SEQ_PREVIEW_3_FLASH]
    REG= 0x3390, 0x0000 	// MCU_DATA_0
    
     
    [Enable stepper motor AF]
    REG= 0x338C, 0xA602 	// MCU_ADDRESS [AFM_TYPE]
    REG= 0x3390, 0x0082 	// MCU_DATA_0
    REG= 0x338C, 0xA12C 	// MCU_ADDRESS [SEQ_PREVIEW_1_AF]
    REG= 0x3390, 0x0001 	// MCU_DATA_0
    REG= 0x338C, 0xA103 	// MCU_ADDRESS [SEQ_CMD]
    REG= 0x3390, 0x0005 	// MCU_DATA_0
    DELAY=1000
    REG= 0x338C, 0xA12C 	// MCU_ADDRESS [SEQ_PREVIEW_1_AF]
    REG= 0x3390, 0x0000 	// MCU_DATA_0
    REG= 0x338C, 0xA13A 	// MCU_ADDRESS [SEQ_PREVIEW_3_AF]
    REG= 0x3390, 0x0001 	// MCU_DATA_0
    
    [Enable helimorph AF]
    REG= 0x338C, 0xA602 	// MCU_ADDRESS [AFM_TYPE]
    REG= 0x3390, 0x0081 	// MCU_DATA_0
    REG= 0x338C, 0xA12C 	// MCU_ADDRESS [SEQ_PREVIEW_1_AF]
    REG= 0x3390, 0x0001 	// MCU_DATA_0
    REG= 0x338C, 0xA103 	// MCU_ADDRESS [SEQ_CMD]
    REG= 0x3390, 0x0005 	// MCU_DATA_0
    DELAY=1000
    REG= 0x338C, 0xA12C 	// MCU_ADDRESS [SEQ_PREVIEW_1_AF]
    REG= 0x3390, 0x0000 	// MCU_DATA_0
    REG= 0x338C, 0xA13A 	// MCU_ADDRESS [SEQ_PREVIEW_3_AF]
    REG= 0x3390, 0x0001 	// MCU_DATA_0
    
    [Enable AD5398 AF]
    REG= 0x338C, 0xA602 	// MCU_ADDRESS [AFM_TYPE]
    REG= 0x3390, 0x0083 	// MCU_DATA_0
    REG= 0x338C, 0xA103 	// MCU_ADDRESS [SEQ_CMD]
    REG= 0x3390, 0x0005 	// MCU_DATA_0
    DELAY=500
    REG= 0x338C, 0xA60A 	// MCU_ADDRESS [AFM_CUSTCTRL]
    REG= 0x3390, 0x0080 	// MCU_DATA_0
    REG= 0x338C, 0xA102 	// MCU_ADDRESS [SEQ_MODE]
    REG= 0x3390, 0x001F 	// MCU_DATA_0
    REG= 0x338C, 0xA622 	// MCU_ADDRESS [AFM_SI_SLAVEADDR]
    REG= 0x3390, 0x0018 	// MCU_DATA_0
    
    [Disable AF]
    REG= 0x338C, 0xA602 	// MCU_ADDRESS [AFM_TYPE]
    REG= 0x3390, 0x0080 	// MCU_DATA_0
    REG= 0x338C, 0xA12C 	// MCU_ADDRESS [SEQ_PREVIEW_1_AF]
    REG= 0x3390, 0x0000 	// MCU_DATA_0
    REG= 0x338C, 0xA103 	// MCU_ADDRESS [SEQ_CMD]
    REG= 0x3390, 0x0005 	// MCU_DATA_0
    REG= 0x338C, 0xA13A 	// MCU_ADDRESS [SEQ_PREVIEW_3_AF]
    REG= 0x3390, 0x0000 	// MCU_DATA_0
     
    [Refocus]
    REG= 0x338C, 0xA102 	// MCU_ADDRESS [SEQ_MODE]
    REG= 0x3390, 0x001F 	// MCU_DATA_0
    REG= 0x338C, 0xA504 	// MCU_ADDRESS [AF_MODE]
    REG= 0x3390, 0x0001 	// MCU_DATA_0
    
    [Mode]
    //-------------------------------------------
    // This Section sets up Preview/Capture Mode
    //
    // Preview: 640 x 480 at 15 FPS
    // Capture: 1600 x 1200 at 15 FPS
    //-------------------------------------------
    REG= 0x338C, 0x2703 	// MCU_ADDRESS [MODE_OUTPUT_WIDTH_A] = 640
    REG= 0x3390, 0x0280 	// MCU_DATA_0
    REG= 0x338C, 0x2705 	// MCU_ADDRESS [MODE_OUTPUT_HEIGHT_A] = 480
    REG= 0x3390, 0x01E0 	// MCU_DATA_0
    REG= 0x338C, 0x2707 	// MCU_ADDRESS [MODE_OUTPUT_WIDTH_B] = 1600
    REG= 0x3390, 0x0640 	// MCU_DATA_0
    REG= 0x338C, 0x2709 	// MCU_ADDRESS [MODE_OUTPUT_HEIGHT_B] = 1200
    REG= 0x3390, 0x04B0 	// MCU_DATA_0
    REG= 0x338C, 0x270D 	// MCU_ADDRESS [MODE_SENSOR_ROW_START_A] = 0
    REG= 0x3390, 0x0000 	// MCU_DATA_0
    REG= 0x338C, 0x270F 	// MCU_ADDRESS [MODE_SENSOR_COL_START_A] = 0
    REG= 0x3390, 0x0000 	// MCU_DATA_0
    REG= 0x338C, 0x2711 	// MCU_ADDRESS [MODE_SENSOR_ROW_END_A] = 1213
    REG= 0x3390, 0x04BD 	// MCU_DATA_0
    REG= 0x338C, 0x2713 	// MCU_ADDRESS [MODE_SENSOR_COL_END_A] = 1613
    REG= 0x3390, 0x064D 	// MCU_DATA_0
    REG= 0x338C, 0x2715 	// MCU_ADDRESS [MODE_SENSOR_X_DELAY_A] = 1230
    REG= 0x3390, 0x04CE 	// MCU_DATA_0
    REG= 0x338C, 0x2717 	// MCU_ADDRESS [MODE_SENSOR_ROW_SPEED_A] = 8465
    REG= 0x3390, 0x2111 	// MCU_DATA_0
    REG= 0x338C, 0x2719 	// MCU_ADDRESS [MODE_SENSOR_READ_MODE_A] = 1132
    REG= 0x3390, 0x046C 	// MCU_DATA_0
    REG= 0x338C, 0x271B 	// MCU_ADDRESS [MODE_SENSOR_SAMPLE_TIME_PCK_A] = 591
    REG= 0x3390, 0x024F 	// MCU_DATA_0
    REG= 0x338C, 0x271D 	// MCU_ADDRESS [MODE_SENSOR_FINE_CORRECTION_A] = 258
    REG= 0x3390, 0x0102 	// MCU_DATA_0
    REG= 0x338C, 0x271F 	// MCU_ADDRESS [MODE_SENSOR_FINE_IT_MIN_A] = 633
    REG= 0x3390, 0x0279 	// MCU_DATA_0
    REG= 0x338C, 0x2721 	// MCU_ADDRESS [MODE_SENSOR_FINE_IT_MAX_MARGIN_A] = 341
    REG= 0x3390, 0x0155 	// MCU_DATA_0
    REG= 0x338C, 0x2723 	// MCU_ADDRESS [MODE_SENSOR_FRAME_LENGTH_A] = 1279
    REG= 0x3390, 0x04FF 	// MCU_DATA_0
    REG= 0x338C, 0x2725 	// MCU_ADDRESS [MODE_SENSOR_LINE_LENGTH_PCK_A] = 2084
    REG= 0x3390, 0x0824 	// MCU_DATA_0
    REG= 0x338C, 0x2727 	// MCU_ADDRESS [MODE_SENSOR_DAC_ID_4_5_A] = 8224
    REG= 0x3390, 0x2020 	// MCU_DATA_0
    REG= 0x338C, 0x2729 	// MCU_ADDRESS [MODE_SENSOR_DAC_ID_6_7_A] = 8224
    REG= 0x3390, 0x2020 	// MCU_DATA_0
    REG= 0x338C, 0x272B 	// MCU_ADDRESS [MODE_SENSOR_DAC_ID_8_9_A] = 4128
    REG= 0x3390, 0x1020 	// MCU_DATA_0
    REG= 0x338C, 0x272D 	// MCU_ADDRESS [MODE_SENSOR_DAC_ID_10_11_A] = 8199
    REG= 0x3390, 0x2007 	// MCU_DATA_0
    REG= 0x338C, 0x272F 	// MCU_ADDRESS [MODE_SENSOR_ROW_START_B] = 4
    REG= 0x3390, 0x0004 	// MCU_DATA_0
    REG= 0x338C, 0x2731 	// MCU_ADDRESS [MODE_SENSOR_COL_START_B] = 4
    REG= 0x3390, 0x0004 	// MCU_DATA_0
    REG= 0x338C, 0x2733 	// MCU_ADDRESS [MODE_SENSOR_ROW_END_B] = 1211
    REG= 0x3390, 0x04BB 	// MCU_DATA_0
    REG= 0x338C, 0x2735 	// MCU_ADDRESS [MODE_SENSOR_COL_END_B] = 1611
    REG= 0x3390, 0x064B 	// MCU_DATA_0
    REG= 0x338C, 0x2737 	// MCU_ADDRESS [MODE_SENSOR_X_DELAY_B] = 1230
    REG= 0x3390, 0x04CE 	// MCU_DATA_0
    REG= 0x338C, 0x2739 	// MCU_ADDRESS [MODE_SENSOR_ROW_SPEED_B] = 8465
    REG= 0x3390, 0x2111 	// MCU_DATA_0
    REG= 0x338C, 0x273B 	// MCU_ADDRESS [MODE_SENSOR_READ_MODE_B] = 36
    REG= 0x3390, 0x0024 	// MCU_DATA_0
    REG= 0x338C, 0x273D 	// MCU_ADDRESS [MODE_SENSOR_SAMPLE_TIME_PCK_B] = 288
    REG= 0x3390, 0x0120 	// MCU_DATA_0
    REG= 0x338C, 0x2745 	// MCU_ADDRESS [MODE_SENSOR_FRAME_LENGTH_B] = 1279
    REG= 0x3390, 0x04FF 	// MCU_DATA_0
    REG= 0x338C, 0x2747 	// MCU_ADDRESS [MODE_SENSOR_LINE_LENGTH_PCK_B] = 2048
    REG= 0x3390, 0x0824 	// MCU_DATA_0
    REG= 0x338C, 0x2751 	// MCU_ADDRESS [MODE_CROP_X0_A] = 0
    REG= 0x3390, 0x0000 	// MCU_DATA_0
    REG= 0x338C, 0x2753 	// MCU_ADDRESS [MODE_CROP_X1_A] = 800
    REG= 0x3390, 0x0320 	// MCU_DATA_0
    REG= 0x338C, 0x2755 	// MCU_ADDRESS [MODE_CROP_Y0_A] = 0
    REG= 0x3390, 0x0000 	// MCU_DATA_0
    REG= 0x338C, 0x2757 	// MCU_ADDRESS [MODE_CROP_Y1_A] = 600
    REG= 0x3390, 0x0258 	// MCU_DATA_0
    REG= 0x338C, 0x275F 	// MCU_ADDRESS [MODE_CROP_X0_B] = 0
    REG= 0x3390, 0x0000 	// MCU_DATA_0
    REG= 0x338C, 0x2761 	// MCU_ADDRESS [MODE_CROP_X1_B] = 1600
    REG= 0x3390, 0x0640 	// MCU_DATA_0
    REG= 0x338C, 0x2763 	// MCU_ADDRESS [MODE_CROP_Y0_B] = 0
    REG= 0x3390, 0x0000 	// MCU_DATA_0
    REG= 0x338C, 0x2765 	// MCU_ADDRESS [MODE_CROP_Y1_B] = 1200
    REG= 0x3390, 0x04B0 	// MCU_DATA_0
    REG= 0x338C, 0x222E 	// MCU_ADDRESS [AE_R9_STEP] = 160
    REG= 0x3390, 0x00A0 	// MCU_DATA_0
    REG= 0x338C, 0xA408 	// MCU_ADDRESS [FD_SEARCH_F1_50] = 31
    REG= 0x3390, 0x001F 	// MCU_DATA_0
    REG= 0x338C, 0xA409 	// MCU_ADDRESS [FD_SEARCH_F2_50] = 33
    REG= 0x3390, 0x0021 	// MCU_DATA_0
    REG= 0x338C, 0xA40A 	// MCU_ADDRESS [FD_SEARCH_F1_60] = 37
    REG= 0x3390, 0x0025 	// MCU_DATA_0
    REG= 0x338C, 0xA40B 	// MCU_ADDRESS [FD_SEARCH_F2_60] = 39
    REG= 0x3390, 0x0027 	// MCU_DATA_0
    REG= 0x338C, 0x2411 	// MCU_ADDRESS [FD_R9_STEP_F60_A] = 160
    REG= 0x3390, 0x00A0 	// MCU_DATA_0
    REG= 0x338C, 0x2413 	// MCU_ADDRESS [FD_R9_STEP_F50_A] = 192
    REG= 0x3390, 0x00C0 	// MCU_DATA_0
    REG= 0x338C, 0x2415 	// MCU_ADDRESS [FD_R9_STEP_F60_B] = 160
    REG= 0x3390, 0x00A0 	// MCU_DATA_0
    REG= 0x338C, 0x2417 	// MCU_ADDRESS [FD_R9_STEP_F50_B] = 192
    REG= 0x3390, 0x00C0 	// MCU_DATA_0
    REG= 0x338C, 0x2799 	// MCU_ADDRESS [MODE_SPEC_EFFECTS_A] Dither for Noise Reduction
    REG= 0x3390, 0x6408 	// MCU_DATA_0
    REG= 0x338C, 0x279B 	// MCU_ADDRESS [MODE_SPEC_EFFECTS_B] Dither for Noise Reduction
    REG= 0x3390, 0x6408 	// MCU_DATA_0
    REG= 0x338C, 0xA103 	// MCU_ADDRESS [SEQ_CMD]  Refresh
    REG= 0x3390, 0x0005 	// MCU_DATA_0
    REG= 0x338C, 0xA103 	// MCU_ADDRESS [SEQ_CMD]  Refresh Mode
    REG= 0x3390, 0x0006 	// MCU_DATA_0
    
    [PLL Setup 24Mhz/80Mhz Out]
    //----------------------------------------------
    // This Section sets up the PLL for en external
    // Masterclock of 24 MHZ and an internal clock
    // of 80 MHz.
    //----------------------------------------------
    REG = 0, 0x341E, 0x8F09        //PLL/ Clk_in control: BYPASS PLL = 36617
    REG = 0, 0x341C, 0x0250        //PLL Control 1 = 592
    REG = 0, 0x341E, 0x8F09        //PLL/ Clk_in control: PLL ON, bypassed = 36617
    DELAY = 5	      	      // More than ample time to allow PLL to lock
    REG = 0, 0x341E, 0x8F08        //PLL/ Clk_in control: USE PLL = 36616
    //STATE=Master Clock, 80000000
    REG=1, 0x3214, 0x06E6 	      //default 0x0480  -> make Slope work for 80 MHz Mclk
    
    [PLL Setup 48Mhz In/80Mhz Out]
    //----------------------------------------------
    // This Section sets up the PLL for en external
    // Masterclock of 48 MHZ and an internal clock
    // of 80 MHz.
    //----------------------------------------------
    REG = 0, 0x341E, 0x8F09        //PLL/ Clk_in control: BYPASS PLL = 36617
    REG = 0, 0x341C, 0x0550        //PLL Set M=80, N=5
    REG = 0, 0x341E, 0x8F09        //PLL/ Clk_in control: PLL ON, bypassed = 36617
    DELAY = 5	      	      // More than ample time to allow PLL to lock
    REG = 0, 0x341E, 0x8F08        //PLL/ Clk_in control: USE PLL = 36616
    STATE=Master Clock, 80000000
    REG=1, 0x3214, 0x06E6 	      //default 0x0480  -> make Slope work for 80 MHz Mclk
    
    
    [PLL Setup 24Mhz In/48Mhz Out]
    REG = 0, 0x341E, 0x8F09        //PLL/ Clk_in control: BYPASS PLL = 36617
    REG = 0, 0x341C, 0x0120        //PLL Control 1 = 288
    REG = 0, 0x341E, 0x8F09        //PLL/ Clk_in control: PLL ON, bypassed = 36617
    DELAY = 5	      	      // More than ample time to allow PLL to lock
    REG = 0, 0x341E, 0x8F08        //PLL/ Clk_in control: USE PLL = 36616
    REG=1, 0x3214, 0x06E6 	      //default 0x0480  -> make Slope work for 80 MHz Mclk
    
    
    [Lens Correction_Largan 971A]
    REG=0x34CE, 0x01A0 //LENS_CORRECTION_CONTROL
    REG=0x34D0, 0x6633 //ZONE_BOUNDS_X1_X2
    REG=0x34D2, 0x319A //ZONE_BOUNDS_X0_X3
    REG=0x34D4, 0x9463 //ZONE_BOUNDS_X4_X5
    REG=0x34D6, 0x4B25 //ZONE_BOUNDS_Y1_Y2
    REG=0x34D8, 0x2670 //ZONE_BOUNDS_Y0_Y3
    REG=0x34DA, 0x724C //ZONE_BOUNDS_Y4_Y5
    REG=0x34DC, 0xFF04 //CENTER_OFFSET
    REG=0x34DE, 0x00FD //FX_RED
    REG=0x34E6, 0x00E8 //FY_RED
    REG=0x34EE, 0x0EE5 //DF_DX_RED
    REG=0x34F6, 0x0CC8 //DF_DY_RED
    REG=0x3500, 0xE3F3 //SECOND_DERIV_ZONE_0_RED
    REG=0x3508, 0x11E5 //SECOND_DERIV_ZONE_1_RED
    REG=0x3510, 0x262E //SECOND_DERIV_ZONE_2_RED
    REG=0x3518, 0x2633 //SECOND_DERIV_ZONE_3_RED
    REG=0x3520, 0x373D //SECOND_DERIV_ZONE_4_RED
    REG=0x3528, 0x393F //SECOND_DERIV_ZONE_5_RED
    REG=0x3530, 0x12B0 //SECOND_DERIV_ZONE_6_RED
    REG=0x3538, 0xDC9F //SECOND_DERIV_ZONE_7_RED
    REG=0x354C, 0x07FF //K_FACTOR_IN_K_FX_FY_R_TL
    REG=0x3544, 0x07FF //K_FACTOR_IN_K_FX_FY_R_TR
    REG=0x355C, 0x0472 //K_FACTOR_IN_K_FX_FY_R_BL
    REG=0x3554, 0x07FF //K_FACTOR_IN_K_FX_FY_R_BR
    REG=0x34E0, 0x00DB //FX_GREEN
    REG=0x34E8, 0x008A //FY_GREEN
    REG=0x34F0, 0x0FF2 //DF_DX_GREEN
    REG=0x34F8, 0x0E41 //DF_DY_GREEN
    REG=0x3502, 0xF1E6 //SECOND_DERIV_ZONE_0_GREEN
    REG=0x350A, 0x02C3 //SECOND_DERIV_ZONE_1_GREEN
    REG=0x3512, 0x112B //SECOND_DERIV_ZONE_2_GREEN
    REG=0x351A, 0x1C26 //SECOND_DERIV_ZONE_3_GREEN
    REG=0x3522, 0x2428 //SECOND_DERIV_ZONE_4_GREEN
    REG=0x352A, 0x271E //SECOND_DERIV_ZONE_5_GREEN
    REG=0x3532, 0x02E0 //SECOND_DERIV_ZONE_6_GREEN
    REG=0x353A, 0xFC17 //SECOND_DERIV_ZONE_7_GREEN
    REG=0x354E, 0x07FF //K_FACTOR_IN_K_FX_FY_G1_TL
    REG=0x3546, 0x07FF //K_FACTOR_IN_K_FX_FY_G1_TR
    REG=0x355E, 0x0600 //K_FACTOR_IN_K_FX_FY_G1_BL
    REG=0x3556, 0x018E //K_FACTOR_IN_K_FX_FY_G1_BR
    REG=0x34E4, 0x00B2 //FX_BLUE
    REG=0x34EC, 0x0059 //FY_BLUE
    REG=0x34F4, 0x0FDF //DF_DX_BLUE
    REG=0x34FC, 0x0D95 //DF_DY_BLUE
    REG=0x3506, 0x14F5 //SECOND_DERIV_ZONE_0_BLUE
    REG=0x350E, 0x06C6 //SECOND_DERIV_ZONE_1_BLUE
    REG=0x3516, 0x1A26 //SECOND_DERIV_ZONE_2_BLUE
    REG=0x351E, 0x2219 //SECOND_DERIV_ZONE_3_BLUE
    REG=0x3526, 0x1423 //SECOND_DERIV_ZONE_4_BLUE
    REG=0x352E, 0x0E14 //SECOND_DERIV_ZONE_5_BLUE
    REG=0x3536, 0xF4EC //SECOND_DERIV_ZONE_6_BLUE
    REG=0x353E, 0xDD1D //SECOND_DERIV_ZONE_7_BLUE
    REG=0x3552, 0x05A1 //K_FACTOR_IN_K_FX_FY_B_TL
    REG=0x354A, 0x03FF //K_FACTOR_IN_K_FX_FY_B_TR
    REG=0x3562, 0x018E //K_FACTOR_IN_K_FX_FY_B_BL
    REG=0x355A, 0x018E //K_FACTOR_IN_K_FX_FY_B_BR
    REG=0x34E2, 0x00AA //FX_GREEN2
    REG=0x34EA, 0x0066 //FY_GREEN2
    REG=0x34F2, 0x0E92 //DF_DX_GREEN2
    REG=0x34FA, 0x0D63 //DF_DY_GREEN2
    REG=0x3504, 0x0E1B //SECOND_DERIV_ZONE_0_GREEN2
    REG=0x350C, 0x0DE7 //SECOND_DERIV_ZONE_1_GREEN2
    REG=0x3514, 0x1D22 //SECOND_DERIV_ZONE_2_GREEN2
    REG=0x351C, 0x2A2A //SECOND_DERIV_ZONE_3_GREEN2
    REG=0x3524, 0x1A26 //SECOND_DERIV_ZONE_4_GREEN2
    REG=0x352C, 0x1420 //SECOND_DERIV_ZONE_5_GREEN2
    REG=0x3534, 0xF2AB //SECOND_DERIV_ZONE_6_GREEN2
    REG=0x353C, 0xD2E0 //SECOND_DERIV_ZONE_7_GREEN2
    REG=0x3550, 0x03FF //K_FACTOR_IN_K_FX_FY_G2_TL
    REG=0x3548, 0x07FF //K_FACTOR_IN_K_FX_FY_G2_TR
    REG=0x3560, 0x03FF //K_FACTOR_IN_K_FX_FY_G2_BL
    REG=0x3558, 0x07FF //K_FACTOR_IN_K_FX_FY_G2_BR
    REG=0x3540, 0x0000 //X2_FACTORS
    REG=0x3542, 0x0004 //GLOBAL_OFFSET_FXY_FUNCTION
    STATE=Lens Correction Falloff, 90
    STATE=Lens Correction Center X, 820
    STATE=Lens Correction Center Y, 600
    BITFIELD=0x3210, 0x0004, 1 //LENS_CORRECTION
    
    
    [CCM]
    //-------------------------------------------
    // Demo Boards. (Derived with Largan Lens)
    //-------------------------------------------
    REG= 0x338C, 0xA34A 	// MCU_ADDRESS [AWB_GAIN_MIN]
    REG= 0x3390, 0x005A 	// MCU_DATA_0
      (Needed so we get enough Red Gain....)
    
    
    [AE]
    //--------------------------------------------------
    // This Section sets up the AE. 
    // - Target is lower than default (50 compared to 60)
    // - MDR uses MaxRGB for upper Clipping Detection
    // - Reduce the Maximum EV shift for MDR
    //--------------------------------------------------
    REG= 0x338C, 0xA206 	// MCU_ADDRESS [AE_TARGET]
    REG= 0x3390, 0x0030 	// MCU_DATA_0
    
    
    [one step MDR]
    REG= 0x338C, 0xA218 	// MCU_ADDRESS [AE_STATUS]   set bit 5 to 1
    REG= 0x3390, 0x00A4 	// MCU_DATA_0
    REG= 0x338C, 0xA130 	// MCU_ADDRESS [SEQ_PREVIEW_2_AE]
    REG= 0x3390, 0x0000 	// MCU_DATA_0
    
    
    [LUT_sRGB]
    //---------------------------------------------------
    // This Settings produce sRGB output from the Sensor
    // (No contrast and low saturation)
    //---------------------------------------------------
    REG= 0x338C, 0xA352 	// MCU_ADDRESS [AWB_SATURATION]
    REG= 0x3390, 0x0064 	// MCU_DATA_0
    REG= 0x338C, 0xA118 	// MCU_ADDRESS [SEQ_LLSAT1]
    REG= 0x3390, 0x0064 	// MCU_DATA_0
    REG= 0x338C, 0xA119 	// MCU_ADDRESS [SEQ_LLSAT2]
    REG= 0x3390, 0x0019 	// MCU_DATA_0
    REG= 0x338C, 0xA76D 	// MCU_ADDRESS [MODE_GAM_CONT_A]
    REG= 0x3390, 0x0003 	// MCU_DATA_0
    REG= 0x338C, 0xA76E 	// MCU_ADDRESS [MODE_GAM_CONT_B]
    REG= 0x3390, 0x0003 	// MCU_DATA_0
    REG= 0x338C, 0xA76F 	// MCU_ADDRESS [MODE_GAM_TABLE_A_0]
    REG= 0x3390, 0x0000 	// MCU_DATA_0
    REG= 0x338C, 0xA770 	// MCU_ADDRESS [MODE_GAM_TABLE_A_1]
    REG= 0x3390, 0x0027 	// MCU_DATA_0
    REG= 0x338C, 0xA771 	// MCU_ADDRESS [MODE_GAM_TABLE_A_2]
    REG= 0x3390, 0x0035 	// MCU_DATA_0
    REG= 0x338C, 0xA772 	// MCU_ADDRESS [MODE_GAM_TABLE_A_3]
    REG= 0x3390, 0x0049 	// MCU_DATA_0
    REG= 0x338C, 0xA773 	// MCU_ADDRESS [MODE_GAM_TABLE_A_4]
    REG= 0x3390, 0x0064 	// MCU_DATA_0
    REG= 0x338C, 0xA774 	// MCU_ADDRESS [MODE_GAM_TABLE_A_5]
    REG= 0x3390, 0x0077 	// MCU_DATA_0
    REG= 0x338C, 0xA775 	// MCU_ADDRESS [MODE_GAM_TABLE_A_6]
    REG= 0x3390, 0x0088 	// MCU_DATA_0
    REG= 0x338C, 0xA776 	// MCU_ADDRESS [MODE_GAM_TABLE_A_7]
    REG= 0x3390, 0x0097 	// MCU_DATA_0
    REG= 0x338C, 0xA777 	// MCU_ADDRESS [MODE_GAM_TABLE_A_8]
    REG= 0x3390, 0x00A4 	// MCU_DATA_0
    REG= 0x338C, 0xA778 	// MCU_ADDRESS [MODE_GAM_TABLE_A_9]
    REG= 0x3390, 0x00AF 	// MCU_DATA_0
    REG= 0x338C, 0xA779 	// MCU_ADDRESS [MODE_GAM_TABLE_A_10]
    REG= 0x3390, 0x00BA 	// MCU_DATA_0
    REG= 0x338C, 0xA77A 	// MCU_ADDRESS [MODE_GAM_TABLE_A_11]
    REG= 0x3390, 0x00C5 	// MCU_DATA_0
    REG= 0x338C, 0xA77B 	// MCU_ADDRESS [MODE_GAM_TABLE_A_12]
    REG= 0x3390, 0x00CE 	// MCU_DATA_0
    REG= 0x338C, 0xA77C 	// MCU_ADDRESS [MODE_GAM_TABLE_A_13]
    REG= 0x3390, 0x00D8 	// MCU_DATA_0
    REG= 0x338C, 0xA77D 	// MCU_ADDRESS [MODE_GAM_TABLE_A_14]
    REG= 0x3390, 0x00E0 	// MCU_DATA_0
    REG= 0x338C, 0xA77E 	// MCU_ADDRESS [MODE_GAM_TABLE_A_15]
    REG= 0x3390, 0x00E8 	// MCU_DATA_0
    REG= 0x338C, 0xA77F 	// MCU_ADDRESS [MODE_GAM_TABLE_A_16]
    REG= 0x3390, 0x00F1 	// MCU_DATA_0
    REG= 0x338C, 0xA780 	// MCU_ADDRESS [MODE_GAM_TABLE_A_17]
    REG= 0x3390, 0x00F8 	// MCU_DATA_0
    REG= 0x338C, 0xA781 	// MCU_ADDRESS [MODE_GAM_TABLE_A_18]
    REG= 0x3390, 0x00FF 	// MCU_DATA_0
    REG= 0x338C, 0xA782 	// MCU_ADDRESS [MODE_GAM_TABLE_B_0]
    REG= 0x3390, 0x0000 	// MCU_DATA_0
    REG= 0x338C, 0xA783 	// MCU_ADDRESS [MODE_GAM_TABLE_B_1]
    REG= 0x3390, 0x0027 	// MCU_DATA_0
    REG= 0x338C, 0xA784 	// MCU_ADDRESS [MODE_GAM_TABLE_B_2]
    REG= 0x3390, 0x0035 	// MCU_DATA_0
    REG= 0x338C, 0xA785 	// MCU_ADDRESS [MODE_GAM_TABLE_B_3]
    REG= 0x3390, 0x0049 	// MCU_DATA_0
    REG= 0x338C, 0xA786 	// MCU_ADDRESS [MODE_GAM_TABLE_B_4]
    REG= 0x3390, 0x0064 	// MCU_DATA_0
    REG= 0x338C, 0xA787 	// MCU_ADDRESS [MODE_GAM_TABLE_B_5]
    REG= 0x3390, 0x0077 	// MCU_DATA_0
    REG= 0x338C, 0xA788 	// MCU_ADDRESS [MODE_GAM_TABLE_B_6]
    REG= 0x3390, 0x0088 	// MCU_DATA_0
    REG= 0x338C, 0xA789 	// MCU_ADDRESS [MODE_GAM_TABLE_B_7]
    REG= 0x3390, 0x0097 	// MCU_DATA_0
    REG= 0x338C, 0xA78A 	// MCU_ADDRESS [MODE_GAM_TABLE_B_8]
    REG= 0x3390, 0x00A4 	// MCU_DATA_0
    REG= 0x338C, 0xA78B 	// MCU_ADDRESS [MODE_GAM_TABLE_B_9]
    REG= 0x3390, 0x00AF 	// MCU_DATA_0
    REG= 0x338C, 0xA78C 	// MCU_ADDRESS [MODE_GAM_TABLE_B_10]
    REG= 0x3390, 0x00BA 	// MCU_DATA_0
    REG= 0x338C, 0xA78D 	// MCU_ADDRESS [MODE_GAM_TABLE_B_11]
    REG= 0x3390, 0x00C5 	// MCU_DATA_0
    REG= 0x338C, 0xA78E 	// MCU_ADDRESS [MODE_GAM_TABLE_B_12]
    REG= 0x3390, 0x00CE 	// MCU_DATA_0
    REG= 0x338C, 0xA78F 	// MCU_ADDRESS [MODE_GAM_TABLE_B_13]
    REG= 0x3390, 0x00D8 	// MCU_DATA_0
    REG= 0x338C, 0xA790 	// MCU_ADDRESS [MODE_GAM_TABLE_B_14]
    REG= 0x3390, 0x00E0 	// MCU_DATA_0
    REG= 0x338C, 0xA791 	// MCU_ADDRESS [MODE_GAM_TABLE_B_15]
    REG= 0x3390, 0x00E8 	// MCU_DATA_0
    REG= 0x338C, 0xA792 	// MCU_ADDRESS [MODE_GAM_TABLE_B_16]
    REG= 0x3390, 0x00F1 	// MCU_DATA_0
    REG= 0x338C, 0xA793 	// MCU_ADDRESS [MODE_GAM_TABLE_B_17]
    REG= 0x3390, 0x00F8 	// MCU_DATA_0
    REG= 0x338C, 0xA794 	// MCU_ADDRESS [MODE_GAM_TABLE_B_18]
    REG= 0x3390, 0x00FF 	// MCU_DATA_0
    REG= 0x338C, 0xA103 	// MCU_ADDRESS [SEQ_CMD]
    REG= 0x3390, 0x0006 	// MCU_DATA_0
    
    [LUT_Vivid]
    //------------------------------------------------------
    // This Settings produce a Vivid output from the Sensor
    // (Lots of contrast and Saturation
    //------------------------------------------------------
    REG= 0x338C, 0xA352 	// MCU_ADDRESS [AWB_SATURATION]
    REG= 0x3390, 0x004B 	// MCU_DATA_0
    REG= 0x338C, 0xA118 	// MCU_ADDRESS [SEQ_LLSAT1]
    REG= 0x3390, 0x004B 	// MCU_DATA_0
    REG= 0x338C, 0xA119 	// MCU_ADDRESS [SEQ_LLSAT2]
    REG= 0x3390, 0x000A 	// MCU_DATA_0
    REG= 0x338C, 0xA76D 	// MCU_ADDRESS [MODE_GAM_CONT_A]
    REG= 0x3390, 0x0003 	// MCU_DATA_0
    REG= 0x338C, 0xA76E 	// MCU_ADDRESS [MODE_GAM_CONT_B]
    REG= 0x3390, 0x0003 	// MCU_DATA_0
    REG= 0x338C, 0xA76F 	// MCU_ADDRESS [MODE_GAM_TABLE_A_0]
    REG= 0x3390, 0x0000 	// MCU_DATA_0
    REG= 0x338C, 0xA770 	// MCU_ADDRESS [MODE_GAM_TABLE_A_1]
    REG= 0x3390, 0x001B 	// MCU_DATA_0
    REG= 0x338C, 0xA771 	// MCU_ADDRESS [MODE_GAM_TABLE_A_2]
    REG= 0x3390, 0x002E 	// MCU_DATA_0
    REG= 0x338C, 0xA772 	// MCU_ADDRESS [MODE_GAM_TABLE_A_3]
    REG= 0x3390, 0x004C 	// MCU_DATA_0
    REG= 0x338C, 0xA773 	// MCU_ADDRESS [MODE_GAM_TABLE_A_4]
    REG= 0x3390, 0x0078 	// MCU_DATA_0
    REG= 0x338C, 0xA774 	// MCU_ADDRESS [MODE_GAM_TABLE_A_5]
    REG= 0x3390, 0x0098 	// MCU_DATA_0
    REG= 0x338C, 0xA775 	// MCU_ADDRESS [MODE_GAM_TABLE_A_6]
    REG= 0x3390, 0x00B0 	// MCU_DATA_0
    REG= 0x338C, 0xA776 	// MCU_ADDRESS [MODE_GAM_TABLE_A_7]
    REG= 0x3390, 0x00C1 	// MCU_DATA_0
    REG= 0x338C, 0xA777 	// MCU_ADDRESS [MODE_GAM_TABLE_A_8]
    REG= 0x3390, 0x00CF 	// MCU_DATA_0
    REG= 0x338C, 0xA778 	// MCU_ADDRESS [MODE_GAM_TABLE_A_9]
    REG= 0x3390, 0x00D9 	// MCU_DATA_0
    REG= 0x338C, 0xA779 	// MCU_ADDRESS [MODE_GAM_TABLE_A_10]
    REG= 0x3390, 0x00E1 	// MCU_DATA_0
    REG= 0x338C, 0xA77A 	// MCU_ADDRESS [MODE_GAM_TABLE_A_11]
    REG= 0x3390, 0x00E8 	// MCU_DATA_0
    REG= 0x338C, 0xA77B 	// MCU_ADDRESS [MODE_GAM_TABLE_A_12]
    REG= 0x3390, 0x00EE 	// MCU_DATA_0
    REG= 0x338C, 0xA77C 	// MCU_ADDRESS [MODE_GAM_TABLE_A_13]
    REG= 0x3390, 0x00F2 	// MCU_DATA_0
    REG= 0x338C, 0xA77D 	// MCU_ADDRESS [MODE_GAM_TABLE_A_14]
    REG= 0x3390, 0x00F6 	// MCU_DATA_0
    REG= 0x338C, 0xA77E 	// MCU_ADDRESS [MODE_GAM_TABLE_A_15]
    REG= 0x3390, 0x00F9 	// MCU_DATA_0
    REG= 0x338C, 0xA77F 	// MCU_ADDRESS [MODE_GAM_TABLE_A_16]
    REG= 0x3390, 0x00FB 	// MCU_DATA_0
    REG= 0x338C, 0xA780 	// MCU_ADDRESS [MODE_GAM_TABLE_A_17]
    REG= 0x3390, 0x00FD 	// MCU_DATA_0
    REG= 0x338C, 0xA781 	// MCU_ADDRESS [MODE_GAM_TABLE_A_18]
    REG= 0x3390, 0x00FF 	// MCU_DATA_0
    REG= 0x338C, 0xA782 	// MCU_ADDRESS [MODE_GAM_TABLE_B_0]
    REG= 0x3390, 0x0000 	// MCU_DATA_0
    REG= 0x338C, 0xA783 	// MCU_ADDRESS [MODE_GAM_TABLE_B_1]
    REG= 0x3390, 0x001B 	// MCU_DATA_0
    REG= 0x338C, 0xA784 	// MCU_ADDRESS [MODE_GAM_TABLE_B_2]
    REG= 0x3390, 0x002E 	// MCU_DATA_0
    REG= 0x338C, 0xA785 	// MCU_ADDRESS [MODE_GAM_TABLE_B_3]
    REG= 0x3390, 0x004C 	// MCU_DATA_0
    REG= 0x338C, 0xA786 	// MCU_ADDRESS [MODE_GAM_TABLE_B_4]
    REG= 0x3390, 0x0078 	// MCU_DATA_0
    REG= 0x338C, 0xA787 	// MCU_ADDRESS [MODE_GAM_TABLE_B_5]
    REG= 0x3390, 0x0098 	// MCU_DATA_0
    REG= 0x338C, 0xA788 	// MCU_ADDRESS [MODE_GAM_TABLE_B_6]
    REG= 0x3390, 0x00B0 	// MCU_DATA_0
    REG= 0x338C, 0xA789 	// MCU_ADDRESS [MODE_GAM_TABLE_B_7]
    REG= 0x3390, 0x00C1 	// MCU_DATA_0
    REG= 0x338C, 0xA78A 	// MCU_ADDRESS [MODE_GAM_TABLE_B_8]
    REG= 0x3390, 0x00CF 	// MCU_DATA_0
    REG= 0x338C, 0xA78B 	// MCU_ADDRESS [MODE_GAM_TABLE_B_9]
    REG= 0x3390, 0x00D9 	// MCU_DATA_0
    REG= 0x338C, 0xA78C 	// MCU_ADDRESS [MODE_GAM_TABLE_B_10]
    REG= 0x3390, 0x00E1 	// MCU_DATA_0
    REG= 0x338C, 0xA78D 	// MCU_ADDRESS [MODE_GAM_TABLE_B_11]
    REG= 0x3390, 0x00E8 	// MCU_DATA_0
    REG= 0x338C, 0xA78E 	// MCU_ADDRESS [MODE_GAM_TABLE_B_12]
    REG= 0x3390, 0x00EE 	// MCU_DATA_0
    REG= 0x338C, 0xA78F 	// MCU_ADDRESS [MODE_GAM_TABLE_B_13]
    REG= 0x3390, 0x00F2 	// MCU_DATA_0
    REG= 0x338C, 0xA790 	// MCU_ADDRESS [MODE_GAM_TABLE_B_14]
    REG= 0x3390, 0x00F6 	// MCU_DATA_0
    REG= 0x338C, 0xA791 	// MCU_ADDRESS [MODE_GAM_TABLE_B_15]
    REG= 0x3390, 0x00F9 	// MCU_DATA_0
    REG= 0x338C, 0xA792 	// MCU_ADDRESS [MODE_GAM_TABLE_B_16]
    REG= 0x3390, 0x00FB 	// MCU_DATA_0
    REG= 0x338C, 0xA793 	// MCU_ADDRESS [MODE_GAM_TABLE_B_17]
    REG= 0x3390, 0x00FD 	// MCU_DATA_0
    REG= 0x338C, 0xA794 	// MCU_ADDRESS [MODE_GAM_TABLE_B_18]
    REG= 0x3390, 0x00FF 	// MCU_DATA_0
    REG= 0x338C, 0xA103 	// MCU_ADDRESS [SEQ_CMD]
    REG= 0x3390, 0x0006 	// MCU_DATA_0
    
    
    [LUT_Moderate]
    //-----------------------------------------------------
    // This Settings produce a moderatly contrast enhanced 
    // and saturated image output from the Sensor
    //-----------------------------------------------------
    REG= 0x338C, 0xA352 	// MCU_ADDRESS [AWB_SATURATION]
    REG= 0x3390, 0x003C 	// MCU_DATA_0
    REG= 0x338C, 0xA118 	// MCU_ADDRESS [SEQ_LLSAT1]
    REG= 0x3390, 0x003C 	// MCU_DATA_0
    REG= 0x338C, 0xA119 	// MCU_ADDRESS [SEQ_LLSAT2]
    REG= 0x3390, 0x000A 	// MCU_DATA_0
    REG= 0x338C, 0xA76D 	// MCU_ADDRESS [MODE_GAM_CONT_A]
    REG= 0x3390, 0x0003 	// MCU_DATA_0
    REG= 0x338C, 0xA76E 	// MCU_ADDRESS [MODE_GAM_CONT_B]
    REG= 0x3390, 0x0003 	// MCU_DATA_0
    REG= 0x338C, 0xA76F 	// MCU_ADDRESS [MODE_GAM_TABLE_A_0]
    REG= 0x3390, 0x0000 	// MCU_DATA_0
    REG= 0x338C, 0xA770 	// MCU_ADDRESS [MODE_GAM_TABLE_A_1]
    REG= 0x3390, 0x0029 	// MCU_DATA_0
    REG= 0x338C, 0xA771 	// MCU_ADDRESS [MODE_GAM_TABLE_A_2]
    REG= 0x3390, 0x003B 	// MCU_DATA_0
    REG= 0x338C, 0xA772 	// MCU_ADDRESS [MODE_GAM_TABLE_A_3]
    REG= 0x3390, 0x0053 	// MCU_DATA_0
    REG= 0x338C, 0xA773 	// MCU_ADDRESS [MODE_GAM_TABLE_A_4]
    REG= 0x3390, 0x0076 	// MCU_DATA_0
    REG= 0x338C, 0xA774 	// MCU_ADDRESS [MODE_GAM_TABLE_A_5]
    REG= 0x3390, 0x0091 	// MCU_DATA_0
    REG= 0x338C, 0xA775 	// MCU_ADDRESS [MODE_GAM_TABLE_A_6]
    REG= 0x3390, 0x00A7 	// MCU_DATA_0
    REG= 0x338C, 0xA776 	// MCU_ADDRESS [MODE_GAM_TABLE_A_7]
    REG= 0x3390, 0x00B8 	// MCU_DATA_0
    REG= 0x338C, 0xA777 	// MCU_ADDRESS [MODE_GAM_TABLE_A_8]
    REG= 0x3390, 0x00C5 	// MCU_DATA_0
    REG= 0x338C, 0xA778 	// MCU_ADDRESS [MODE_GAM_TABLE_A_9]
    REG= 0x3390, 0x00CF 	// MCU_DATA_0
    REG= 0x338C, 0xA779 	// MCU_ADDRESS [MODE_GAM_TABLE_A_10]
    REG= 0x3390, 0x00D8 	// MCU_DATA_0
    REG= 0x338C, 0xA77A 	// MCU_ADDRESS [MODE_GAM_TABLE_A_11]
    REG= 0x3390, 0x00E0 	// MCU_DATA_0
    REG= 0x338C, 0xA77B 	// MCU_ADDRESS [MODE_GAM_TABLE_A_12]
    REG= 0x3390, 0x00E6 	// MCU_DATA_0
    REG= 0x338C, 0xA77C 	// MCU_ADDRESS [MODE_GAM_TABLE_A_13]
    REG= 0x3390, 0x00EC 	// MCU_DATA_0
    REG= 0x338C, 0xA77D 	// MCU_ADDRESS [MODE_GAM_TABLE_A_14]
    REG= 0x3390, 0x00F1 	// MCU_DATA_0
    REG= 0x338C, 0xA77E 	// MCU_ADDRESS [MODE_GAM_TABLE_A_15]
    REG= 0x3390, 0x00F5 	// MCU_DATA_0
    REG= 0x338C, 0xA77F 	// MCU_ADDRESS [MODE_GAM_TABLE_A_16]
    REG= 0x3390, 0x00F9 	// MCU_DATA_0
    REG= 0x338C, 0xA780 	// MCU_ADDRESS [MODE_GAM_TABLE_A_17]
    REG= 0x3390, 0x00FC 	// MCU_DATA_0
    REG= 0x338C, 0xA781 	// MCU_ADDRESS [MODE_GAM_TABLE_A_18]
    REG= 0x3390, 0x00FF 	// MCU_DATA_0
    REG= 0x338C, 0xA782 	// MCU_ADDRESS [MODE_GAM_TABLE_B_0]
    REG= 0x3390, 0x0000 	// MCU_DATA_0
    REG= 0x338C, 0xA783 	// MCU_ADDRESS [MODE_GAM_TABLE_B_1]
    REG= 0x3390, 0x0029 	// MCU_DATA_0
    REG= 0x338C, 0xA784 	// MCU_ADDRESS [MODE_GAM_TABLE_B_2]
    REG= 0x3390, 0x003B 	// MCU_DATA_0
    REG= 0x338C, 0xA785 	// MCU_ADDRESS [MODE_GAM_TABLE_B_3]
    REG= 0x3390, 0x0053 	// MCU_DATA_0
    REG= 0x338C, 0xA786 	// MCU_ADDRESS [MODE_GAM_TABLE_B_4]
    REG= 0x3390, 0x0076 	// MCU_DATA_0
    REG= 0x338C, 0xA787 	// MCU_ADDRESS [MODE_GAM_TABLE_B_5]
    REG= 0x3390, 0x0091 	// MCU_DATA_0
    REG= 0x338C, 0xA788 	// MCU_ADDRESS [MODE_GAM_TABLE_B_6]
    REG= 0x3390, 0x00A7 	// MCU_DATA_0
    REG= 0x338C, 0xA789 	// MCU_ADDRESS [MODE_GAM_TABLE_B_7]
    REG= 0x3390, 0x00B8 	// MCU_DATA_0
    REG= 0x338C, 0xA78A 	// MCU_ADDRESS [MODE_GAM_TABLE_B_8]
    REG= 0x3390, 0x00C5 	// MCU_DATA_0
    REG= 0x338C, 0xA78B 	// MCU_ADDRESS [MODE_GAM_TABLE_B_9]
    REG= 0x3390, 0x00CF 	// MCU_DATA_0
    REG= 0x338C, 0xA78C 	// MCU_ADDRESS [MODE_GAM_TABLE_B_10]
    REG= 0x3390, 0x00D8 	// MCU_DATA_0
    REG= 0x338C, 0xA78D 	// MCU_ADDRESS [MODE_GAM_TABLE_B_11]
    REG= 0x3390, 0x00E0 	// MCU_DATA_0
    REG= 0x338C, 0xA78E 	// MCU_ADDRESS [MODE_GAM_TABLE_B_12]
    REG= 0x3390, 0x00E6 	// MCU_DATA_0
    REG= 0x338C, 0xA78F 	// MCU_ADDRESS [MODE_GAM_TABLE_B_13]
    REG= 0x3390, 0x00EC 	// MCU_DATA_0
    REG= 0x338C, 0xA790 	// MCU_ADDRESS [MODE_GAM_TABLE_B_14]
    REG= 0x3390, 0x00F1 	// MCU_DATA_0
    REG= 0x338C, 0xA791 	// MCU_ADDRESS [MODE_GAM_TABLE_B_15]
    REG= 0x3390, 0x00F5 	// MCU_DATA_0
    REG= 0x338C, 0xA792 	// MCU_ADDRESS [MODE_GAM_TABLE_B_16]
    REG= 0x3390, 0x00F9 	// MCU_DATA_0
    REG= 0x338C, 0xA793 	// MCU_ADDRESS [MODE_GAM_TABLE_B_17]
    REG= 0x3390, 0x00FC 	// MCU_DATA_0
    REG= 0x338C, 0xA794 	// MCU_ADDRESS [MODE_GAM_TABLE_B_18]
    REG= 0x3390, 0x00FF 	// MCU_DATA_0
    REG= 0x338C, 0xA103 	// MCU_ADDRESS [SEQ_CMD]
    REG= 0x3390, 0x0006 	// MCU_DATA_0
    
    
    [Low Power Preview 15 FPS]
    //---------------------------------------------------
    // Minimum 15 FPS (66 ms Int-Time)
    //---------------------------------------------------
    REG= 0x338C, 0xA20C 	// MCU_ADDRESS [AE_MAX_INDEX]
    REG= 0x3390, 0x0008 	// MCU_DATA_0
    REG= 0x338C, 0xA214 	// MCU_ADDRESS [AE_MAX_DGAIN_AE2]
    REG= 0x3390, 0x0024 	// MCU_DATA_0
    REG= 0x338C, 0xA103 	// MCU_ADDRESS [SEQ_CMD]
    REG= 0x3390, 0x0005 	// MCU_DATA_0
    DELAY=500		//Wait
    
    
    [Low Power Preview 10 FPS]
    //---------------------------------------------------
    // Minimum 10 FPS (100 ms Int-Time)
    //---------------------------------------------------
    REG= 0x338C, 0xA20C 	// MCU_ADDRESS [AE_MAX_INDEX]
    REG= 0x3390, 0x000C 	// MCU_DATA_0
    REG= 0x338C, 0xA214 	// MCU_ADDRESS [AE_MAX_DGAIN_AE2]
    REG= 0x3390, 0x0022 	// MCU_DATA_0
    REG= 0x338C, 0xA103 	// MCU_ADDRESS [SEQ_CMD]
    REG= 0x3390, 0x0005 	// MCU_DATA_0
    DELAY=500		//Wait
    
    
    [Low Power Preview 7_5 FPS]
    //---------------------------------------------------
    // Minimum 7.5 FPS (133 ms Int-Time)
    //---------------------------------------------------
    REG= 0x338C, 0xA20C 	// MCU_ADDRESS [AE_MAX_INDEX]
    REG= 0x3390, 0x0010 	// MCU_DATA_0
    REG= 0x338C, 0xA214 	// MCU_ADDRESS [AE_MAX_DGAIN_AE2]
    REG= 0x3390, 0x0022 	// MCU_DATA_0
    REG= 0x338C, 0xA103 	// MCU_ADDRESS [SEQ_CMD]
    REG= 0x3390, 0x0005 	// MCU_DATA_0
    
    DELAY=500		//Wait
    
    
    [Low Power Preview 5 FPS]
    //---------------------------------------------------
    // Minimum 5 FPS (200 ms Int-Time)
    //---------------------------------------------------
    REG= 0x338C, 0xA20C 	// MCU_ADDRESS [AE_MAX_INDEX]
    REG= 0x3390, 0x0018 	// MCU_DATA_0
    REG= 0x338C, 0xA214 	// MCU_ADDRESS [AE_MAX_DGAIN_AE2]
    REG= 0x3390, 0x001E 	// MCU_DATA_0
    REG= 0x338C, 0xA103 	// MCU_ADDRESS [SEQ_CMD]
    REG= 0x3390, 0x0005 	// MCU_DATA_0
    
    DELAY=500		//Wait
    
    
    [Sequencer_Optimized_HiSat_Sharp]
    //---------------------------------------------------
    //  These Sequencer Settings include optimized
    //  Transition values between bright and low light
    //  for the following:
    //  - Noise Reduction
    //  - Saturation
    //  - Aperture Correction
    //  and also enable the MDR AE algorithm
    //---------------------------------------------------
    REG= 0x338C, 0xA130 	// MCU_ADDRESS [SEQ_PREVIEW_2_AE]
    REG= 0x3390, 0x0004 	// MCU_DATA_0
    REG= 0x338C, 0xA115 	// MCU_ADDRESS [SEQ_LLMODE]
    REG= 0x3390, 0x00EF 	// MCU_DATA_0
    REG= 0x338C, 0xA116 	// MCU_ADDRESS [SEQ_LLVIRTGAIN1]
    REG= 0x3390, 0x0030 	// MCU_DATA_0
    REG= 0x338C, 0xA117 	// MCU_ADDRESS [SEQ_LLVIRTGAIN2]
    REG= 0x3390, 0x0055 	// MCU_DATA_0
    REG= 0x338C, 0xA118 	// MCU_ADDRESS [SEQ_LLSAT1]
    REG= 0x3390, 0x005A 	// MCU_DATA_0
    REG= 0x338C, 0xA119 	// MCU_ADDRESS [SEQ_LLSAT2]
    REG= 0x3390, 0x0028 	// MCU_DATA_0
    REG= 0x338C, 0xA11A 	// MCU_ADDRESS [SEQ_LLINTERPTHRESH1]
    REG= 0x3390, 0x0008 	// MCU_DATA_0
    REG= 0x338C, 0xA11B 	// MCU_ADDRESS [SEQ_LLINTERPTHRESH2]
    REG= 0x3390, 0x001E 	// MCU_DATA_0
    REG= 0x338C, 0xA11C 	// MCU_ADDRESS [SEQ_LLAPCORR1]
    REG= 0x3390, 0x0002 	// MCU_DATA_0
    REG= 0x338C, 0xA11D 	// MCU_ADDRESS [SEQ_LLAPCORR2]
    REG= 0x3390, 0x0000 	// MCU_DATA_0
    REG= 0x338C, 0xA11E 	// MCU_ADDRESS [SEQ_LLAPTHRESH1]
    REG= 0x3390, 0x0000 	// MCU_DATA_0
    REG= 0x338C, 0xA11F 	// MCU_ADDRESS [SEQ_LLAPTHRESH2]
    REG= 0x3390, 0x0004 	// MCU_DATA_0
    
    
    
    [Flip and Mirror]
    REG= 0x338C, 0x2719 	// MCU_ADDRESS [MODE_SENSOR_READ_MODE_A]
    REG= 0x3390, 0x046F 	// MCU_DATA_0
    REG= 0x338C, 0x273B 	// MCU_ADDRESS [MODE_SENSOR_READ_MODE_B]
    REG= 0x3390, 0x0027 	// MCU_DATA_0
    REG= 0x338C, 0xA103 	// MCU_ADDRESS [SEQ_CMD]
    REG= 0x3390, 0x0006 	// MCU_DATA_0
    
    [Noise Reduction Test]
    //Reduce Histogram to 0% Clipping
    REG= 0x338C, 0xAB05 	// MCU_ADDRESS [HG_PERCENT]
    REG= 0x3390, 0x0000 	// MCU_DATA_0
    //Use New Gamma Table with Noise Kill
    REG= 0x338C, 0xA76D 	// MCU_ADDRESS [MODE_GAM_CONT_A]
    REG= 0x3390, 0x0003 	// MCU_DATA_0
    REG= 0x338C, 0xA76E 	// MCU_ADDRESS [MODE_GAM_CONT_B]
    REG= 0x3390, 0x0003 	// MCU_DATA_0
    REG= 0x338C, 0xA76F 	// MCU_ADDRESS [MODE_GAM_TABLE_A_0]
    REG= 0x3390, 0x0000 	// MCU_DATA_0
    REG= 0x338C, 0xA770 	// MCU_ADDRESS [MODE_GAM_TABLE_A_1]
    REG= 0x3390, 0x0015 	// MCU_DATA_0
    REG= 0x338C, 0xA771 	// MCU_ADDRESS [MODE_GAM_TABLE_A_2]
    REG= 0x3390, 0x0025 	// MCU_DATA_0
    REG= 0x338C, 0xA772 	// MCU_ADDRESS [MODE_GAM_TABLE_A_3]
    REG= 0x3390, 0x003F 	// MCU_DATA_0
    REG= 0x338C, 0xA773 	// MCU_ADDRESS [MODE_GAM_TABLE_A_4]
    REG= 0x3390, 0x0064 	// MCU_DATA_0
    REG= 0x338C, 0xA774 	// MCU_ADDRESS [MODE_GAM_TABLE_A_5]
    REG= 0x3390, 0x0080 	// MCU_DATA_0
    REG= 0x338C, 0xA775 	// MCU_ADDRESS [MODE_GAM_TABLE_A_6]
    REG= 0x3390, 0x0097 	// MCU_DATA_0
    REG= 0x338C, 0xA776 	// MCU_ADDRESS [MODE_GAM_TABLE_A_7]
    REG= 0x3390, 0x00A9 	// MCU_DATA_0
    REG= 0x338C, 0xA777 	// MCU_ADDRESS [MODE_GAM_TABLE_A_8]
    REG= 0x3390, 0x00BA 	// MCU_DATA_0
    REG= 0x338C, 0xA778 	// MCU_ADDRESS [MODE_GAM_TABLE_A_9]
    REG= 0x3390, 0x00C7 	// MCU_DATA_0
    REG= 0x338C, 0xA779 	// MCU_ADDRESS [MODE_GAM_TABLE_A_10]
    REG= 0x3390, 0x00D2 	// MCU_DATA_0
    REG= 0x338C, 0xA77A 	// MCU_ADDRESS [MODE_GAM_TABLE_A_11]
    REG= 0x3390, 0x00DC 	// MCU_DATA_0
    REG= 0x338C, 0xA77B 	// MCU_ADDRESS [MODE_GAM_TABLE_A_12]
    REG= 0x3390, 0x00E4 	// MCU_DATA_0
    REG= 0x338C, 0xA77C 	// MCU_ADDRESS [MODE_GAM_TABLE_A_13]
    REG= 0x3390, 0x00EA 	// MCU_DATA_0
    REG= 0x338C, 0xA77D 	// MCU_ADDRESS [MODE_GAM_TABLE_A_14]
    REG= 0x3390, 0x00F0 	// MCU_DATA_0
    REG= 0x338C, 0xA77E 	// MCU_ADDRESS [MODE_GAM_TABLE_A_15]
    REG= 0x3390, 0x00F4 	// MCU_DATA_0
    REG= 0x338C, 0xA77F 	// MCU_ADDRESS [MODE_GAM_TABLE_A_16]
    REG= 0x3390, 0x00F8 	// MCU_DATA_0
    REG= 0x338C, 0xA780 	// MCU_ADDRESS [MODE_GAM_TABLE_A_17]
    REG= 0x3390, 0x00FC 	// MCU_DATA_0
    REG= 0x338C, 0xA781 	// MCU_ADDRESS [MODE_GAM_TABLE_A_18]
    REG= 0x3390, 0x00FF 	// MCU_DATA_0
    REG= 0x338C, 0xA782 	// MCU_ADDRESS [MODE_GAM_TABLE_B_0]
    REG= 0x3390, 0x0000 	// MCU_DATA_0
    REG= 0x338C, 0xA783 	// MCU_ADDRESS [MODE_GAM_TABLE_B_1]
    REG= 0x3390, 0x0015 	// MCU_DATA_0
    REG= 0x338C, 0xA784 	// MCU_ADDRESS [MODE_GAM_TABLE_B_2]
    REG= 0x3390, 0x0025 	// MCU_DATA_0
    REG= 0x338C, 0xA785 	// MCU_ADDRESS [MODE_GAM_TABLE_B_3]
    REG= 0x3390, 0x003F 	// MCU_DATA_0
    REG= 0x338C, 0xA786 	// MCU_ADDRESS [MODE_GAM_TABLE_B_4]
    REG= 0x3390, 0x0064 	// MCU_DATA_0
    REG= 0x338C, 0xA787 	// MCU_ADDRESS [MODE_GAM_TABLE_B_5]
    REG= 0x3390, 0x0080 	// MCU_DATA_0
    REG= 0x338C, 0xA788 	// MCU_ADDRESS [MODE_GAM_TABLE_B_6]
    REG= 0x3390, 0x0097 	// MCU_DATA_0
    REG= 0x338C, 0xA789 	// MCU_ADDRESS [MODE_GAM_TABLE_B_7]
    REG= 0x3390, 0x00A9 	// MCU_DATA_0
    REG= 0x338C, 0xA78A 	// MCU_ADDRESS [MODE_GAM_TABLE_B_8]
    REG= 0x3390, 0x00BA 	// MCU_DATA_0
    REG= 0x338C, 0xA78B 	// MCU_ADDRESS [MODE_GAM_TABLE_B_9]
    REG= 0x3390, 0x00C7 	// MCU_DATA_0
    REG= 0x338C, 0xA78C 	// MCU_ADDRESS [MODE_GAM_TABLE_B_10]
    REG= 0x3390, 0x00D2 	// MCU_DATA_0
    REG= 0x338C, 0xA78D 	// MCU_ADDRESS [MODE_GAM_TABLE_B_11]
    REG= 0x3390, 0x00DC 	// MCU_DATA_0
    REG= 0x338C, 0xA78E 	// MCU_ADDRESS [MODE_GAM_TABLE_B_12]
    REG= 0x3390, 0x00E4 	// MCU_DATA_0
    REG= 0x338C, 0xA78F 	// MCU_ADDRESS [MODE_GAM_TABLE_B_13]
    REG= 0x3390, 0x00EA 	// MCU_DATA_0
    REG= 0x338C, 0xA790 	// MCU_ADDRESS [MODE_GAM_TABLE_B_14]
    REG= 0x3390, 0x00F0 	// MCU_DATA_0
    REG= 0x338C, 0xA791 	// MCU_ADDRESS [MODE_GAM_TABLE_B_15]
    REG= 0x3390, 0x00F4 	// MCU_DATA_0
    REG= 0x338C, 0xA792 	// MCU_ADDRESS [MODE_GAM_TABLE_B_16]
    REG= 0x3390, 0x00F8 	// MCU_DATA_0
    REG= 0x338C, 0xA793 	// MCU_ADDRESS [MODE_GAM_TABLE_B_17]
    REG= 0x3390, 0x00FC 	// MCU_DATA_0
    REG= 0x338C, 0xA794 	// MCU_ADDRESS [MODE_GAM_TABLE_B_18]
    REG= 0x3390, 0x00FF 	// MCU_DATA_0
    REG= 0x338C, 0xA103 	// MCU_ADDRESS [SEQ_CMD]
    REG= 0x3390, 0x0006 	// MCU_DATA_0
    //Boost Color In YUV Space
    BITFIELD=0x35A4, 0x0007, 0x0006 //Color kill saturation point
    
    //New Sequencer Settings
    REG= 0x338C, 0xA118 	// MCU_ADDRESS [SEQ_LLSAT1]
    REG= 0x3390, 0x001E 	// MCU_DATA_0
    REG= 0x338C, 0xA119 	// MCU_ADDRESS [SEQ_LLSAT2]
    REG= 0x3390, 0x0004 	// MCU_DATA_0
    REG= 0x338C, 0xA11A 	// MCU_ADDRESS [SEQ_LLINTERPTHRESH1]
    REG= 0x3390, 0x000A 	// MCU_DATA_0
    REG= 0x338C, 0xA11B 	// MCU_ADDRESS [SEQ_LLINTERPTHRESH2]
    REG= 0x3390, 0x0020 	// MCU_DATA_0
    
    //Noise Setup
    REG= 0x338C, 0xA13E 	// MCU_ADDRESS [SEQ_NR_TH1_R]
    REG= 0x3390, 0x0004 	// MCU_DATA_0
    REG= 0x338C, 0xA13F 	// MCU_ADDRESS [SEQ_NR_TH1_G]
    REG= 0x3390, 0x000E 	// MCU_DATA_0
    REG= 0x338C, 0xA140 	// MCU_ADDRESS [SEQ_NR_TH1_B]
    REG= 0x3390, 0x0004 	// MCU_DATA_0
    REG= 0x338C, 0xA141 	// MCU_ADDRESS [SEQ_NR_TH1_OL]
    REG= 0x3390, 0x0004 	// MCU_DATA_0
    REG= 0x338C, 0xA142 	// MCU_ADDRESS [SEQ_NR_TH2_R]
    REG= 0x3390, 0x0032 	// MCU_DATA_0
    REG= 0x338C, 0xA143 	// MCU_ADDRESS [SEQ_NR_TH2_G]
    REG= 0x3390, 0x000F 	// MCU_DATA_0
    REG= 0x338C, 0xA144 	// MCU_ADDRESS [SEQ_NR_TH2_B]
    REG= 0x3390, 0x0032 	// MCU_DATA_0
    REG= 0x338C, 0xA145 	// MCU_ADDRESS [SEQ_NR_TH2_OL]
    REG= 0x3390, 0x0032 	// MCU_DATA_0
    REG= 0x338C, 0xA146 	// MCU_ADDRESS [SEQ_NR_GAINTH1]
    REG= 0x3390, 0x0005 	// MCU_DATA_0
    REG= 0x338C, 0xA147 	// MCU_ADDRESS [SEQ_NR_GAINTH2]
    REG= 0x3390, 0x003A 	// MCU_DATA_0
    
    
    [Lens Calibration Setup]
    //---------------------------------------------------
    // This Setup can be used to calibrate the lens
    //---------------------------------------------------
    REG= 0x338C, 0xA102 	// MCU_ADDRESS [SEQ_MODE]
    REG= 0x3390, 0x0000 	// MCU_DATA_0
    BITFIELD=0x3210, 0x0004, 0 //turn off Enable lens shading
    REG=0x3212, 0x0001 	// FACTORY_BYPASS
    DELAY=1000
    REG=0x3330, 0x0140 	// OUTPUT_FORMAT_TEST (LC bypass)
    DELAY=1000
    STATE=Lens Correction Overlay, 1
    
    
    [Color Setup]
    //---------------------------------------------------
    // This Setup can be used to calibrate the color
    //---------------------------------------------------
    REG= 0x338C, 0xAB04 	// MCU_ADDRESS [HG_MAX_DLEVEL]
    REG= 0x3390, 0x0000 	// MCU_DATA_0
    REG= 0x338C, 0xA353 	// MCU_ADDRESS [AWB_MODE]
    REG= 0x3390, 0x0021 	// MCU_DATA_0
    DELAY=1000
    REG= 0x338C, 0xA102 	// MCU_ADDRESS [SEQ_MODE]
    REG= 0x3390, 0x0000 	// MCU_DATA_0
    DELAY=1000
    BITFIELD=0x3210, 0x00A0, 0 //turn off gamma correction and color correction
    REG=0x3028, 0x0008 	//(1) ANALOGUE_GAIN_CODE_GLOBAL
    
    
    [True Gray Setup]
    //---------------------------------------------------
    // This Setup can be used to calibrate true grey TH
    // When calibrating True Gray, we recommend that the
    //user first load the [Power up] section and then this 
    // [True Gray Setup] preset and not load any other 
    // preset because if noise reduction related preset
    // is included, the color saturation is altered.  
    //---------------------------------------------------
    REG= 0x338C, 0xAB04 	// MCU_ADDRESS [HG_MAX_DLEVEL]
    REG= 0x3390, 0x0000 	// MCU_DATA_0
    REG= 0x338C, 0x2318 	// MCU_ADDRESS [AWB_CCM_L_9]
    REG= 0x3390, 0x0020 	// MCU_DATA_0
    REG= 0x338C, 0x231A 	// MCU_ADDRESS [AWB_CCM_L_10]
    REG= 0x3390, 0x0020 	// MCU_DATA_0
    REG= 0x338C, 0x232E 	// MCU_ADDRESS [AWB_CCM_RL_9]
    REG= 0x3390, 0x0000 	// MCU_DATA_0
    REG= 0x338C, 0x2330 	// MCU_ADDRESS [AWB_CCM_RL_10]
    REG= 0x3390, 0x0000 	// MCU_DATA_0
    REG= 0x338C, 0xA353 	// MCU_ADDRESS [AWB_MODE]
    REG= 0x3390, 0x0021 	// MCU_DATA_0
    
    BITFIELD=0x3210, 0x00A0, 0 //turn off gamma correction and color correction
    
    
    [8 bit walking 1 test pattern] 
    REG=0x3212, 0x0000      //(1) FACTORY_BYPASS 
    REG=0x3290, 0x0020      //(1) TEST_PATTERN 
    REG=0x3386, 0x0501      //(1) MCU_BOOT_MODE 
    
    [10 bit walking 1 test pattern] 
    REG=0x3212, 0x0000      //(1) FACTORY_BYPASS 
    REG=0x3290, 0x0060      //(1) TEST_PATTERN 
    REG=0x3386, 0x0501      //(1) MCU_BOOT_MODE 
    
    [high power preview mode -  nongated pixclk] 
    //-----------------------------------------------------
    // This setup enables the user to get non-gated pixclk 
    // running in context A and half of the speed compared
    // to context B.  The example uses a 24MHz input clk 
    // and an output of 80MHz.  Therefore context A clk 
    // speed is 40MHz and context B is 80MHz.  Please note 
    // user needs to first use Register Wizard v1.2 to 
    // generate timing settings for high power preview mode
    //-----------------------------------------------------
    REG = 0, 0x341E, 0x8F09        //PLL/ Clk_in control: BYPASS PLL = 36617 
    REG = 0, 0x341C, 0x0250        //PLL Control 1 = 288 
    REG = 0, 0x341E, 0x8F09        //PLL/ Clk_in control: PLL ON, bypassed = 36617 
    DELAY = 200                   // More than ample time to allow PLL to lock 
    REG = 0, 0x341E, 0x8F08        //PLL/ Clk_in control: USE PLL = 36616 
    
    //Set Watermark and enable Half rate mode 
    REG=0x321E, 0x0014      //(1) OF_WATERMARK 
    REG=0x321C, 0x0006      //(1) OF_CONTROL_STATUS 
    REG=0x3216, 0x82DF      //(1) INTERNAL_CLOCK_CONTROL 
    REG=0x3212, 0x0002      //(1) FACTORY_BYPASS 
    
    
    [SOC2020 MIPI 640Mbps SVGA EXTCLK=24MHz OP_PIX_CLK=80MHz]
    // Disable Parallel and Standby
    REG=0x301A, 0x0208 // RESET_REGISTER
    REG=0x3202, 0x0008 // STANDBY_CONTROL
    // Setup PLL
    REG=0x341C, 0x0250 // PLL_DIVIDERS1
    REG=0x341E, 0x8F09 // PLL_CLK_IN_CONTROL
    DELAY=250
    REG=0x341E, 0x8F08 // PLL_CLK_IN_CONTROL
    DELAY=100
    // Prepare internal clocks
    REG=0x3216, 0x825F // INTERNAL_CLOCK_CONTROL
    REG=0x3212, 0x0002 // FACTORY_BYPASS
    DELAY=100
    // Misc MIPI settings
    REG=0x3410, 0x0F06 // MIPI_PRE_HS_TX
    REG=0x3414, 0x0A3A // MIPI_CLOCK_OVERLAP
    //REG=0x3404, 0x002B // MIPI_DATA_TYPE
    DELAY=250
    // Enable MIPI
    REG=0x3400, 0x000D // MIPI_CONTROL
    DELAY=250
    REG=0x3400, 0x0009 // MIPI_CONTROL
    // Enable streaming
    REG=0x301A, 0x020C // RESET_REGISTER
    
    
    
    [HIDDEN: 30fps HD]
    //
    // Date: 10/18/2010 Probelms with this configuration have been reported - DO NOT USE
    //
    // This file was generated by: MT9D112 (SOC2020) Register Wizard
    //   Version: 2.11.0.16    Build Date: 07/31/2008
    // 
    // [PLL PARAMETERS]
    // 
    // Bypass PLL: Unchecked
    // Input Frequency: 24.000
    // Use Min Freq.: Unchecked
    // Target PLL Frequency: 80.000
    // Target VCO Frequency: Unspecified
    // "M" Value: Unspecified
    // "N" Value: Unspecified
    // 
    // Target PLL Frequency: 80 MHz
    // Input Clock Frequency: 24 MHz
    // 
    // Actual PLL Frequency: 80 MHz
    // 
    // M = 80
    // N = 2
    // Fpdf = 8 MHz
    // Fvco = 640 MHz
    // 
    
    // 
    // 
    
    REG = 0x338C, 0x2703        //Output Width (A)
    REG = 0x3390, 0x0500        //      = 1280
    
    REG = 0x338C, 0x2705        //Output Height (A)
    REG = 0x3390, 0x02d0        //      = 720
    
    
    REG = 0x338C, 0x270D        //Row Start (A)
    REG = 0x3390, 0x004        //      = 4
    REG = 0x338C, 0x270F        //Column Start (A)
    REG = 0x3390, 0x004        //      = 4
    
    REG = 0x338C, 0x2711        //Row End (A)
    REG = 0x3390, 0x2dB        //      = 731
    REG = 0x338C, 0x2713        //Column End (A)
    REG = 0x3390, 0x50b        //      = 1291
    
    
    REG = 0x338C, 0x2715        //Extra Delay (A)
    REG = 0x3390, 0x65a        //      = 1626
    
    REG = 0x338C, 0x2717        //Row Speed (A)
    REG = 0x3390, 0x2111        //      = 8465
    REG = 0x338C, 0x2719        //Read Mode (A)
    REG = 0x3390, 0x0024        //      = 36
    REG = 0x338C, 0x271B        //sensor_sample_time_pck (A)
    REG = 0x3390, 0x0120        //      = 288
    
    REG = 0x338C, 0x271D        //sensor_fine_correction (A)
    REG = 0x3390, 0x00A4        //      = 164
    REG = 0x338C, 0x271F        //sensor_fine_IT_min (A)
    REG = 0x3390, 0x0169        //      = 361
    
    REG = 0x338C, 0x2721        //sensor_fine_IT_max_margin (A)
    REG = 0x3390, 0x00A4        //      = 164
    
    REG = 0x338C, 0x2723        //Frame Lines (A)
    REG = 0x3390, 737           //      = 781
    
    
    REG = 0x338C, 0x2725        //Line Length (A)
    REG = 0x3390, 0x06e4        //      = 1764
    
    REG = 0x338C, 0x2727        //sensor_dac_id_4_5 (A)
    REG = 0x3390, 0x2020        //      = 8224
    REG = 0x338C, 0x2729        //sensor_dac_id_6_7 (A)
    REG = 0x3390, 0x2020        //      = 8224
    REG = 0x338C, 0x272B        //sensor_dac_id_8_9 (A)
    REG = 0x3390, 0x1020        //      = 4128
    REG = 0x338C, 0x272D        //sensor_dac_id_10_11 (A)
    REG = 0x3390, 0x2007        //      = 8199
    
    
    REG = 0x338C, 0x2751        //Crop_X0 (A)
    REG = 0x3390, 0x0000        //      = 0
    REG = 0x338C, 0x2753        //Crop_X1 (A)
    REG = 0x3390, 0x0500        //      = 1280
    
    REG = 0x338C, 0x2755        //Crop_Y0 (A)
    REG = 0x3390, 0x0000        //      = 0
    REG = 0x338C, 0x2757        //Crop_Y1 (A)
    REG = 0x3390, 0x02d0        //      = 720
    
    
    REG = 0x338C, 0x222E        //R9 Step
    REG = 0x3390, 0x00bd        //      = 189
    REG = 0x338C, 0xA408        //search_f1_50
    REG = 0x3390, 0x2d        //      = 45
    REG = 0x338C, 0xA409        //search_f2_50
    REG = 0x3390, 0x30        //      = 48
    
    
    REG = 0x338C, 0xA40A        //search_f1_60
    REG = 0x3390, 0x36        //      = 54
    REG = 0x338C, 0xA40B        //search_f2_60
    REG = 0x3390, 0x39        //      = 57
    
    REG = 0x338C, 0x2411        //R9_Step_60 (A)
    REG = 0x3390, 0x00bd        //      = 189
    
    REG = 0x338C, 0x2413        //R9_Step_50 (A)
    REG = 0x3390, 0x00e3        //      = 227
    
    REG = 0x338C, 0xA40D        //Stat_min
    REG = 0x3390, 0x02        //      = 2
    REG = 0x338C, 0xA410        //Min_amplitude
    REG = 0x3390, 0x01        //      = 1
    REG = 0x338C, 0xA103        //Refresh Sequencer Mode
    REG = 0x3390, 0x06        //      = 6
    POLL_FIELD=SEQ_CMD, !=0, DELAY=10, TIMEOUT=100  // wait for command to be processed
    REG = 0x338C, 0xA103        //Refresh Sequencer
    REG = 0x3390, 0x05        //      = 5
    POLL_FIELD=SEQ_CMD, !=0, DELAY=10, TIMEOUT=100  // wait for command to be processed
    VAR8= 2, 0x000C, 0x04 	// AE_MAX_INDEX
    VAR8= 1, 0x0003, 0x05 	// SEQ_CMD


  • 相关阅读:
    在VS2010中如何添加MSCOMM控件,实现串口通讯
    GroupBox与Panel控件
    如何在VS2010中添加ActiveX控件及使用方法
    如何在vs2010中添加Picture控件
    四线开发经验谈
    socket 、 udp 和 tcp
    文本文件与二进制文件
    文件读写 (流)
    [CTSC1999]家园
    洛谷 P1251 餐巾计划问题
  • 原文地址:https://www.cnblogs.com/xiabodan/p/4038615.html
Copyright © 2020-2023  润新知