On the OV7670 camera, I think I've partially understood the HSTART and HSTOP registers. In the I2S camera code, (and indeed on a few different solutions working with the camera), the authors typically say
Code: Select all
frameControl(196, 52, 8, 488); //no clue why horizontal needs such strange values
So here is a clue: the horizontal timing is such that a VGA scan line takes 784 PCLKs (640 + 144 PCLK times between lines). So HSTOP must be 640 bigger than HSTART, but modulus 784. So for any HSTART value, we can compute HSTOP as (HSTART + 640) % 784. This has worked nicely for me. My experiments also indicate that HSTOP points to the pixel
beyond the last one. (HSTART + 639) % 768 just slews my images.
- Camera_specs.png (36.56 KiB) Viewed 9810 times
Now why does HSTART begin at such a weird value? I'm still puzzed. I suspect it counts PCLKs relative to HSYNC (which is not broken out onto a pin, or easily observable), but I cannot find any obvious synchonization point or timing that explains HSTART.
Any ideas or extra insights, please let me know. If you can tell me how to get HSTART, I thinnk I can tell you how to get HSTOP.
Peter