OV2640 cropping full resolution, registers

Discussion related to "under the hood" OpenMV topics.
Posts: 1
Joined: Wed May 20, 2020 8:09 am

OV2640 cropping full resolution, registers

Postby meruje » Wed May 20, 2020 8:17 am

Hello, I'm trying to adapt this ov2640 interface https://github.com/openmv/openmv/blob/m ... v/ov2640.c to a project.
The thing is, I want to process UXGA pictures, but the board I'm using doesn't have enough RAM to have a full picture in memory.
With that in mind, I'm trying to use the registers described in the datasheet: https://www.uctronics.com/download/cam_ ... 2640DS.pdf, and my idea is to only retrieve a "crop" of the full resolution at a time. The thing is I don't understand how the registers relate to each other, and I'm getting a lot of "sensor timeouts", "green images" and other things of the sort.
I've identified the following registers as being relevant: HSIZE, VSIZE, XOFFL, YOFFL, VHYX, TEST, ZMOW, ZMOH, ZMHH, SIZEL, HSIZE8, VSIZE8, COM1, COM7, HREFST, HREFEND, VSTRT, VEND and REG32.

Can someone help me understand how this registers work and how to use them to achieve the desired objective?
Say I want to retrieve only one 224x224 portion of the full UXGA resolution at a time, what values should I use for image size, etc...?
User avatar
Posts: 4107
Joined: Sun May 24, 2015 2:10 pm

Re: OV2640 cropping full resolution, registers

Postby kwagyeman » Wed May 20, 2020 11:11 pm

While it may not look like it from the code... we typically spends weeks of effort on getting drivers working. It's very hard.

Please check the OV5640 driver. It does what you want. Given the cameras are similar maybe you can get a hint from that code on how to control the OV2640.

Return to “Technical Discussion”

Who is online

Users browsing this forum: No registered users and 4 guests