![]() |
|
If you can't view the Datasheet, Please click here to try to view without PDF Reader . |
|
Datasheet File OCR Text: |
OV5642 Embedded Firmware User Guide - VCM AF Module Version 0.21 Aug.2009 OmniVision reserves the right to make changes without further notice to any product herein to improve reliability, function or design. OmniVision does not assume any liability arising out of the application or use of any project, circuit described herein; neither does it convey any license under its patent nor the right of others. This document contains information of a proprietary nature. None of this information shall be divulged to persons other than OmniVision Technologies, Inc. employee authorized by the nature of their duties to receive such information, or individuals or organizations authorized by OmniVision Technologies, Inc www.DataSheet.in OV5642 Embedded Firmware user guide proprietary to Omnivision Technologies Version 0.21 www.DataSheet.in 1-3 Contents OV5642 Embedded Firmware User Guide ...............................................................1-1 1 Embedded Resources .............................................................................................................1-4 2 Auto Focus Solution...............................................................................................................2-5 2.1 Embedded Auto Focus Solution.................................................................................2-5 2.2 External Auto Focus Solution ....................................................................................2-6 3 User Interface.........................................................................................................................3-7 3.1 Command and Status Registers..................................................................................3-7 3.2 Main Command Table................................................................................................3-7 3.3 Auto Focus Status ......................................................................................................3-8 4 Firmware User Guide.............................................................................................................4-9 4.1 Initialization ...............................................................................................................4-9 4.2 State Transition Diagram............................................................................................4-9 4.3 Auto Focus Control..................................................................................................4-10 4.4 Step Focus Mode Commands...................................................................................4-10 4.4.1 Step to Near Object ......................................................................................4-10 4.4.2 Step to Far Object.........................................................................................4-10 4.4.3 Step to Furthest Object.................................................................................4-10 4.4.4 Step to Nearest Object..................................................................................4-10 4.4.5 Step to Specified Position.............................................................................4-10 4.4.6 Samples ........................................................................................................4-10 4.5 Auto Focus Sample Flow .........................................................................................4-11 5 Motor Driver Mode..............................................................................................................5-12 5.1 Normal Driver Mode................................................................................................5-12 5.2 Special Driver Mode ................................................................................................5-12 5.3 Motor Driver Mode Setting......................................................................................5-12 6 Auto Focus Zone..................................................................................................................6-13 6.1 Zone(X0, Y0, X1, Y1)..............................................................................................6-13 6.2 Zone Array Mode .....................................................................................................6-13 6.2.1 Zone Array Mode 1 - center mode...............................................................6-13 6.2.2 Zone Array Mode 2 - 5x mode ....................................................................6-14 6.2.3 Zone Array Mode 3 - 5+ mode ....................................................................6-14 6.2.4 Zone Array Mode 4 - 5f mode .....................................................................6-14 6.2.5 Zone Array Mode 5 -float center mode .......................................................6-14 6.2.6 Zone Array Mode Setting.............................................................................6-14 6.3 Zone Selection Mode ...............................................................................................6-15 6.3.1 Zone Selection Mode 1 - Auto Mode ..........................................................6-15 6.3.2 Zone Selection Mode 2 - Semi Auto Mode .................................................6-15 6.3.3 Zone Selection Mode 3 - Manual Mode ......................................................6-15 6.3.4 Zone Selection Mode Setting .......................................................................6-15 7 Update History .....................................................................................................................7-17 2009-8-18 proprietary to Omnivision Technologies www.DataSheet.in OV5642 1 Embedded Firmware user guide Embedded Resources Embedded Micro-controller 6KB of embedded program memory Two general purpose IO ports (GPIO0, GPIO1). If the output format of OV5642 is not 10-bit RGB RAW format, Y0, Y1 could also be used as GPIO. Built-in Auto Focus Control (AFC) functions. AFC module collects edge information for at least five programmable zones proprietary to Omnivision Technologies Version 0.21 www.DataSheet.in 2-5 2 Auto Focus Solution There are two basic Auto Focus solutions: embedded auto focus solution and external auto focus solution. 2.1 Embedded Auto Focus Solution For Embedded auto focus solution, the auto focus function is controlled by the built-in micro-controller of OV5642. OV5642 AF Core GPIO User Interface Host VCM Driver IC The advantages of embedded auto focus solution include: The auto focus function is built inside camera module. Baseband or Application Processor could use the module in the same way as fixed focus module. The auto focus information is accessed by built-in micro controller in real time. The auto focus calculation is also done by built-in micro-controller. The speed of auto focus is very fast compared to external auto focus solution. OmniVision had built-in the embedded auto focus control in firmware of OV5642. This document is only for the firmware of this solution. Currently, the auto focus firmware supports following auto focus camera modules: 1. 2. 3. 4. OV5642 + OV5642 + OV5642 + OV5642 + VCM + AD5820 VCM + AD5822 VCM + AD5827 VCM + DW9710 If you need to support other VCM driver IC, please contact with OmniVision local FAE. 2009-8-18 proprietary to Omnivision Technologies www.DataSheet.in OV5642 2.2 Embedded Firmware user guide External Auto Focus Solution OV5642 Host VCM Driver IC GPIO AF Core For External AF solution, the auto focus control is implemented in Baseband or Application Processor. Baseband or application processors get auto focus information of OV5642 by SCCB interface. Then it does auto focus calculation and send the actuator control commend by I2C. The I2c of actuator could be shared with the SCCB control of OV5642. The advantage of external auto focus control is that customer could implement its own auto focus algorithms. The disadvantage is the auto focus speed is not as fast as embedded auto focus. Since embedded auto focus solution has many advantages over external auto focus solution, only embedded auto focus solution is discussed in details in this document. proprietary to Omnivision Technologies Version 0.21 www.DataSheet.in 3-7 3 3.1 User Interface Command and Status Registers Eight registers are used for OV5642 firmware interface. The MCU will auto clear CMD_MAIN to zero after the command is receipt, and auto clear CMD_TAG to zero when ready to receive next command. Name CMD_MAIN CMD_TAG CMD_PARA3 CMD_PARA2 CMD_PARA1 CMD_PARA0 STA_ZONE Register 0x3024 0x3025 0x5082 0x5083 0x5084 0x5085 0x3026 Description main command command tag parameter hh byte parameter hl byte parameter lh byte parameter ll byte zone status Read/Write Write only Write only read/write read/write read/write read/write read only Notes (1) STA_FOCUS 0x3027 focus status read only (1) If the command needs tag and parameters, the main command must be the last register to be sent. 3.2 Value 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 Main Command Table Main Command Description Enable Overlay Disable Overlay Single focus mode Const focus mode Step mode Pause(const focus mode) Reserved Return to Idle mode Reserved Set Zone mode Update Zone * Set Motor mode * Set Scan mode * tag/parameters no no no no need no * no no need no * need * need 0x09- 0x0F 0x10 0x12 ... 0x20 ... 0x30 ~ 0xFF* * For commands without tag/parameter, set the CMD_TAG to value that not equal to zero. 2009-8-18 proprietary to Omnivision Technologies www.DataSheet.in OV5642 3.3 Embedded Firmware user guide Auto Focus Status STA_FOCUS is the current focus state: 0xFF 0xFA 0xFE 0xEE 0x00 0x01 0x02 0x12 0x20 S_FIRWARE Firmware is downloaded and not run. S_STARTUP Firmware is initializing. S_ERROR Unknown Firmware state S_DRVICERR Driver IC is not found. S_IDLE Idle state, lens is located at the furthest position. S_FOCUSING Auto Focus is running. S_FOCUSED Auto Focus is stopped. S_CAPTURE Read to capture S_STEP Manual mode Other values are not defined. STA_ZONE is the current zone state: BIT7 BIT6 BIT5 BIT4 BIT3 BIT2-BIT0 Zone 4 is focused Zone 3 is focused Zone 2 is focused Zone 1 is focused Zone 0 is focused The Zone ID of current selected zone. The valid value is [0, 4] proprietary to Omnivision Technologies Version 0.21 www.DataSheet.in 4-9 4 4.1 Firmware User Guide Initialization Sensor Initialization Please contact with OmniVision local FAE for OV5642 initialization setting. Download firmware to built-in memory Please contact with OmniVision local FAE to get OV5642 auto focus firmware. The format of firmware is same as register setting file. It should be downloaded to OV5642 as writing register one by one byte. Please don't modify the firmware. After download firmware, Baseband or application processor could also modify other registers (except for some registers internal used by firmware) of OV5642 as fixed focus (FF) applications. Host Communicate with firmware to control Auto Focus Please find more detail information from other sections. If reset OV5642, restart the flow. 4.2 State Transition Diagram The focus state is transmitted after special command or running event. Download Single Focus mode S_STARTUP S_DRVICERR Const Focus mode Step Focus mode S_IDLE S_STEP Auto Initialize success Auto Initialize failed S_FOCUSING Single Focus mode Command Const Focus mode Command Step Focus mode Command S_FOCUSED Idle mode Command Pause Command Auto Scan completed S_CAPTURE Auto Rescan 2009-8-18 proprietary to Omnivision Technologies www.DataSheet.in OV5642 4.3 Embedded Firmware user guide Auto Focus Control The AF function can run in different control mode. If only Firmware is in S_IDLE state, host can change the control mode for next AF. At present, the following control modes are support: Motor Driver Mode AF Zone Array Mode AF Zone Selection Mode 4.4 4.4.1 Step Focus Mode Commands Step to Near Object 0x01 0x05 CMD_TAG CMD_MAIN 4.4.2 Step to Far Object 0x02 0x05 CMD_TAG CMD_MAIN 4.4.3 Step to Furthest Object 0x03 0x05 CMD_TAG CMD_MAIN 4.4.4 Step to Nearest Object 0x04 0x05 CMD_TAG CMD_MAIN 4.4.5 Step to Specified Position 0x10 Sp 0x05 CMD_TAG CMD_PARA0 CMD_MAIN 4.4.6 Samples //Specified Position. 0 is Furthest, 255 is nearest. CMD_TAG 0x03 CMD_MAIN 0x05 //Reset to furthest Waiting for CMD_TAG reset to zero proprietary to Omnivision Technologies Version 0.21 www.DataSheet.in 4-11 CMD_TAG 0x01 CMD_MAIN 0x05 //Move 1 step to near Waiting for CMD_TAG reset to zero CMD_TAG 0x01 CMD_MAIN 0x05 //Move 1 step to near Waiting for CMD_TAG reset to zero CMD_TAG 0x01 CMD_MAIN 0x05 //Move 1 step to near Waiting for CMD_TAG reset to zero CMD_TAG 0x04 CMD_PARA0 0xFF CMD_MAIN 0x05 Waiting for CMD_TAG reset to zero CMD_TAG 0x04 CMD_PARA0 0x80 CMD_MAIN 0x05 Waiting for CMD_TAG reset to zero 4.5 1) 2) 3) Auto Focus Sample Flow Initialize sensor Download firmware to sensor Checking for status. If S_STARTUP, then retry. If S_DRVICERR, then return error. If S_IDLE, then continue to 4. If not using default Motor Driver mode, change it If not using default Scan mode, change it If not using default Zone Array mode, change it If not using default Zone Selection mode, change it Send Single focus mode command to firmware. Checking for status. If FOCUSING, then retry. If S_FOCUSED, then continue to 10. If need to focus again, go to 8. Host capture image. Send idle mode command to firmware. Host send setting to change resolution Send update zone command (0x12) to firmware. If sensor registers about resolution are changed, update zone is needed. Go to 4. 4) 5) 6) 7) 8) 9) 10) 11) 12) 13) 14) 15) 2009-8-18 proprietary to Omnivision Technologies www.DataSheet.in OV5642 5 5.1 Embedded Firmware user guide Motor Driver Mode Normal Driver Mode 5.2 Special Driver Mode 5.3 Motor Driver Mode Setting Normal Driver mode CMD_TAG 0x01 CMD_MAIN 0x20 Special Driver mode CMD_TAG 0x02 CMD_MAIN 0x20 Normal motor driver is the default motor driver mode. proprietary to Omnivision Technologies Version 0.21 www.DataSheet.in 6-13 6 Auto Focus Zone The firmware supports 4 Zone Array modes and 2 Zone Selection modes. If special Zone Array mode is required, please contact with OmniVision local FAE. 6.1 Zone(X0, Y0, X1, Y1) (0, 0) x (64, 0) (X0, Y0) (X1, Y1) y (0, 48) (64, 48) The zone definition is base on the virtual viewfinder (VVF). The full size of VVF is 64 x 48. 6.2 Zone Array Mode There are four zone array mode supported: Center mode, 5x mode, 5+ mode and 4f mode. In run-time, the size and position of zones are fixed in Center mode, 5x modes and 5+ mode. If needing to update the zone size and position in run-time, please use 4f mode. If only need to focus on center region, the center mode is better. 6.2.1 (0, 0) Zone Array Mode 1 - center mode x Zone (24, 18, 40, 30) (64, 0) y (0, 48) (64, 48) 2009-8-18 proprietary to Omnivision Technologies www.DataSheet.in OV5642 6.2.2 Embedded Firmware user guide Zone Array Mode 2 - 5x mode x (64, 0) 4 2 3 Zone 0 (40, 28, 48, 36) Zone 1 (16, 28, 24, 36) Zone 2 (28, 20, 36, 28) Zone 3 (40, 12, 48, 20) Zone 4 (16, 12, 24, 20) (0, 0) y (0, 48) 1 0 (64, 48) 6.2.3 Zone Array Mode 3 - 5+ mode x (64, 0) 4 1 2 0 (64, 48) 3 Zone 0 (28, 32, 36, 40) Zone 1 (12, 20, 20, 28) Zone 2 (28, 20, 36, 28) Zone 3 (44, 20, 52, 28) Zone 4 (28, 8, 36, 16) (0, 0) y (0, 48) 6.2.4 Zone Array Mode 4 - 5f mode In this mode, the four zones (0, 1, 2, 3, and 4) are all free in run-time. All the zones can be defined by User. 6.2.5 Zone Array Mode 5 -float center mode This mode is same as center mode except the center point is controlled by HOST 6.2.6 Zone Array Mode Setting Zone Array Mode 1 - Center mode CMD_TAG 0x01 CMD_MAIN 0x10 Zone Array Mode 2 - 5x mode CMD_TAG 0x02 CMD_MAIN 0x10 proprietary to Omnivision Technologies Version 0.21 www.DataSheet.in 6-15 Zone Array Mode 3 - 5+ mode CMD_TAG 0x03 CMD_MAIN 0x10 Zone Array Mode 4 - 5f mode If you need to support this function, please contact with OmniVision local FAE. Zone Array Mode 5 - float center mode CMD_TAG 0x11 CMD_PARA1 Xc // X of Center CMD_PARA0 Yc // Y of Center CMD_MAIN 0x10 Zone Array Mode 1 is the default zone array mode. 6.3 Zone Selection Mode If there are multi zones, zone selection will decide which zone is the focused zone. For center zone array mode and float center mode, the zone selection mode is invalid. In zone selection mode 2 and 3, the selected zone is updated by host driver. 6.3.1 Zone Selection Mode 1 - Auto Mode In this mode, system will auto select the focus zone. This mode is supported in Zone Array Mode 2, 3 and 4. 6.3.2 Zone Selection Mode 2 - Semi Auto Mode In this mode, system will auto select the focus zone based one the zone selected by user. This mode is supported in Zone Array Mode 2 and 3. 6.3.3 Zone Selection Mode 3 - Manual Mode In this mode, the focused zone will be selected by user. This mode is supported in Zone Array Mode 2, 3 and 4. 6.3.4 Zone Selection Mode Setting Auto Zone Selection Mode CMD_TAG 0x0B CMD_MAIN 0x10 Semi Auto Zone Selection Mode CMD_TAG 0x0C CMD_MAIN 0x10 2009-8-18 proprietary to Omnivision Technologies www.DataSheet.in OV5642 Embedded Firmware user guide Manual Zone Selection Mode CMD_TAG 0x0D CMD_MAIN 0x10 Rotate Selected Zone CMD_TAG 0x0E CMD_MAIN 0x10 Auto Zone selection mode is the default zone selection mode for Zone Array Mode 2, 3 and 4. After Zone Array Mode commands is sent, the auto zone selection will reset to default. STA_ZONE[2:0] is the current selected zone proprietary to Omnivision Technologies Version 0.21 www.DataSheet.in 7-17 7 Update History July-13-2009 Version 0.10 Firmware Version update to V1.00 Aug-11-2009 Version 0.20 Firmware Version update to V1.05 Aug-11-2009 Version 0.21 Removed the bug about [Step to Specified Position] Command in this document. 2009-8-18 proprietary to Omnivision Technologies www.DataSheet.in |
Price & Availability of OV5642
![]() |
|
|
All Rights Reserved © IC-ON-LINE 2003 - 2022 |
[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy] |
Mirror Sites : [www.datasheet.hk]
[www.maxim4u.com] [www.ic-on-line.cn]
[www.ic-on-line.com] [www.ic-on-line.net]
[www.alldatasheet.com.cn]
[www.gdcy.com]
[www.gdcy.net] |