indrekluuk / LiveOV7670

A step-by-step guide to building the circuit for this project:
https://circuitjournal.com/arduino-ov7670-10fps
237 stars 91 forks source link

Framerate #10

Open kozuch opened 6 years ago

kozuch commented 6 years ago

What is the framerate you achieved? It probably depends on the Arduino model used, right? Did you test FPS limits of various boards?

I need 320x240 at 15 fps with 8 bit pixel data. Can you suggest a board for this please? I want sensor without fifo and also Ethernet capability on the board. Can Arduino do this (maybe Due) or is something like STM32 or ESP32 needed?

Thanks in advance!

indrekluuk commented 6 years ago

I have only tried with Arduino Nano/Uno and STM32 "blue pill" board. For Arduino 16Mhz clock rate sets the limit and there isn't any time left to squeeze more out of it.

With the STM32 (72Mhz) I was reliably getting it to work 160x120@12fps and semi-reliably @15fps. But here with enough tweaking and twiddling it should be possible to get more out of it. I got the STM32 project into good enough state for me and haven't experimented it with after that.

I haven't used Arduino Due myself but it seems to have similar specs to the STM32 "blue pill" board. So what you want (320x240 at 15 fps) might be possible but it requires lots of experimentation.

At some point I want to experiment with the esp8266 wifi module. It is much faster (400Mhz) but it has to share work load to do its wifi stuff. And also it doesn't have many IO ports. So maybe the solution is to add some shift register chips between camera and the module so that SPI can be used to get data to the wifi module.

kozuch commented 6 years ago

Thanks for your reply! It is a real challenge to deal with image sensors definitely! :)

I saw the bitluni's post on ESP32 - he uses I2S for parallel data - not sure if this helps wih framerate etc. Also, I noticed that higher end STM32s do have a Digital camera interface (DCMI - see here) - if I understand things correctly this interface may offload the camera sensor data acquisition from the CPU so that higher framerates may be possible?

I would like to keep things as simple as possible and would like to explore all possibilities before stepping up to dedicated camera interfaces (DCMI).

indrekluuk commented 6 years ago

Yes I read from the https://www.stm32duino.com forums that STM32 has the possibility to read entire byte at hardware level (no need to manually check the PCLK). I haven't experimented it myself but that would greatly increase the reading speed and stability.

kozuch commented 6 years ago

What resolution and FPS did you achieve on the 16 MHz uno? The "blue pil" board is 4.5 faster at 72 MHz and 320x240 is 4x 160x120 in pixel count so you assume this could theoretically work? What exactly limited you after you reached 160x120@12fps on the blue pill?

indrekluuk commented 6 years ago

The "for" loop that checked PCLK and then read a pixel byte was too slow.

For Arduino I was able to cheat. I don't check PCLK during line read because the reading was in perfect sync with camera. I couldn't get that perfect sync with the STM32 board.

But if you manage to get the pixel read working on hardware level (without checking PCLK in you code) then I think 320x240@10fps is doable. And then if there is some left-over time then try to increase frame rate.