OV5640 Auto FocusCamera Module Application Notes
OV5640 Auto Focus Camera Module Application Notes
(with DVP Interface)
Last Modified: Apr. 15
th
, 2013
Document Revision: 2.16
OmniVision Technologies, Inc. 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.
1 Company Confidential
Confidential For ZHENG ZHOU VOM Only
OV5640 Auto FocusCamera Module Application Notes
内容目录
1. Overview of OV5640 Application....................................................................................................4
2. Hardware Design..............................................................................................................................5
2.1 OV5640 Camera Module Reference Design.............................................................................5
2.2 Host Interface.............................................................................................................................6
2.1.1 Pin Definition.....................................................................................................................6
2.2 Power Supply.............................................................................................................................6
2.2.1 Host used 1.8V IO and OV5640 uses 1.8V IO..................................................................7
2.2.2 Host used 2.8V IO and OV5640 uses 1.8V IO..................................................................7
2.2.3 Host used 2.8V IO and OV5640 uses 1.8V IO..................................................................8
2.3 Deal with Lens...........................................................................................................................9
2.3.1 Light fall off.......................................................................................................................9
2.3.2 Dark corner........................................................................................................................9
2.3.3 Resolution..........................................................................................................................9
2.3.4 Optical contrast..................................................................................................................9
2.3.5 Lens Cover.........................................................................................................................9
2.3.6 Lens Correction..................................................................................................................9
2.3.6.1 Lens Correction:.........................................................................................................9
2.3.6.2 Lens Correction: ........................................................................................................9
3. Hardware Operation.......................................................................................................................10
3.1 Operation Modes......................................................................................................................10
3.1.1 Power Up..........................................................................................................................10
3.1.2 Power Down.....................................................................................................................11
3.1.3 Wake up from Power down..............................................................................................11
3.1.4 Power OFF ......................................................................................................................11
3.1.5 Hardware Reset................................................................................................................12
3.2 Operations................................................................................................................................12
3.2.1 OV5640 single camera, cut of power when not used.......................................................12
3.2.2 OV5640 single camera, power down when not used.......................................................12
3.2.3 OV5640 with other camera, cut off power when not used..............................................12
3.2.4 OV5640 with other camera, power down when not used................................................13
3.2.5 OV5640 share I2C bus with other devices.......................................................................13
4. Software Operation.........................................................................................................................14
4.1 YCbCr/Compression Reference Settings.................................................................................14
4.1.1 Initial Setting....................................................................................................................14
4.1.2 VGA Preview...................................................................................................................19
4.1.3 800x480 Preview..............................................................................................................20
4.1.4 854x480 Preview..............................................................................................................21
4.1.5 720p Video.......................................................................................................................23
4.1.6 5M YCbCr Capture..........................................................................................................24
4.1.7 5M JPEG Capture............................................................................................................26
4.2 Signal Polarity..........................................................................................................................28
4.3 Drive Capability.......................................................................................................................28
4.4 I/O Control...............................................................................................................................28
4.5 YUV Sequence ........................................................................................................................29
4.6 Mirror and Flip.........................................................................................................................29
4.7 Test Pattern...............................................................................................................................31
2 Company Confidential
Confidential For ZHENG ZHOU VOM Only
OV5640 Auto FocusCamera Module Application Notes
4.8 Remove Light Band.................................................................................................................31
4.9 User Interface Functions..........................................................................................................32
4.9.1 Brightness.........................................................................................................................32
4.9.2 Contrast............................................................................................................................33
4.9.3 Saturation.........................................................................................................................34
4.9.4 EV....................................................................................................................................37
4.9.5 Light Mode.......................................................................................................................38
4.9.6 Special Effects..................................................................................................................39
4.9.7 Night Mode......................................................................................................................41
4.7.8 Banding Filter Selection...................................................................................................41
4.10 Auto Focus.............................................................................................................................42
4.10.1 Embedded Auto Focus Solution....................................................................................42
4.10.2 I2C Commands for Auto Focus.....................................................................................42
4.10.3 AF Sequence .................................................................................................................43
4.10.4 Download firmware......................................................................................................43
4.10.5 Auto focus.....................................................................................................................43
4.10.6 Release Focus................................................................................................................43
4.11 Capture Sequence...................................................................................................................43
4.11.1 Shutter............................................................................................................................43
4.11.2 Gain................................................................................................................................44
4.11.3 Dummy Lines and Dummy Pixels.................................................................................44
4.11.4 Capture Sequence...........................................................................................................44
4.11.4.1 Auto Focus..............................................................................................................44
4.11.4.2 Read Preview Registers..........................................................................................44
4.11.4.3 Change Resolution to Capture................................................................................44
4.11.4.4 Read Capture Register Values................................................................................44
4.11.4.5 Preview Gain/Exposure to Capture/Gain Exposure...............................................45
4.11.4.6 Gain to Exposure and Capture Banding Filter.......................................................45
4.11.4.7 Write gain/exposure value......................................................................................45
4.11.4.8 Capture...................................................................................................................46
4.11.4.9 Back to Preview......................................................................................................46
4.12 Scale and Zoom.....................................................................................................................46
4.12.1 Scale...............................................................................................................................46
4.12.2 Digital Zoom..................................................................................................................47
Appendix I Sample Code of Camera Driver......................................................................................49
Revision History.................................................................................................................................63
3 Company Confidential
Confidential For ZHENG ZHOU VOM Only
OV5640 Auto FocusCamera Module Application Notes
1. Overview of OV5640 Application
OV5640 is a 1/4 inch high performance 5M camera supporting both DVP and MIPI interface. This
document focus on DVP interface application of OV5640. For MIPI interface application of
OV5640, please read “OV5640 Camera Module Application Notes (with MIPI interface)”
OV5640 could be used as
5M Main Camera for Cellular Phone Applications
5M Main Camera for Tablet Applications
4 Company Confidential
Confidential For ZHENG ZHOU VOM Only
OV5640 Auto FocusCamera Module Application Notes
2. Hardware Design
2.1 OV5640 Camera Module Reference Design
Note:
1. PWND, active HIGH as DOVDD to power down OV5640, should be connected to ground
outside of module if unused
2. RESETB. Active LOW to reset OV5640, should be connected to DOVDD outside of
module if unused
3. AVDD is 2.6-3.0V of sensor analog power (clean). 2.8V is recommended. AVDD must be
2.5V+-5% for OTP write, and OTP read does not have such requirement
4. DVDD is 1.5V±5% of sensor digital power(clean). Using the internal DVDD regulator is
strongly recommended
5. DOVDD. 1.8V recommended is 1.7V-3.0V of sensor digital IO power(clean)
6. sensor AGND and DGND should be separated and connected to a single point outside PCB,
Do not connect inside module
7. Capacitors should be close to the related sensor pins
8. D[9:0] is sensor 10 bit RGB RAW output. D[9:2] is sensor 8-bit YUV/RGB Compress
output
5 Company Confidential
Confidential For ZHENG ZHOU VOM Only