Use this forum to chat about hardware specific topics for the ESP8266 (peripherals, memory, clocks, JTAG, programming)

User avatar
By anvoice
#22785 If I recall correctly the ESP has 96Kb of data ram, which would be enough to capture a single frame at low resolution using the yuv422 format. So if it's possible to capture the data, and then transmit it before the next frame starts, should be doable.

I was also thinking of something along the lines of "get 1 byte, send it, get another byte" and reconstituting the image at the receiving side. Just that my limited experience doesn't tell me if either of those two ways is manageable.

I'm in the process of trying to program the ESP8266, but haven't been able to upload to it because my usb-ttl cable hasn't arrived yet and I couldn't get the arduino as ISP to work.

Edit: a bit of extra info about the way the camera works, taking from http://embeddedprogrammer.blogspot.com/2012/07/hacking-ov7670-camera-module-sccb-cheat.html. The falling edge of a signal (VSYNC) indicates the start of a frame, and the frame is obtained while VSYNC is low. The rising edge of another signal (HREF) indicates the start of a line, and the line is obtained while HREF is high. The data registers (D0-7, a byte) are then sampled at the rising edge of the clock signal, which is either the same frequency as the driving frequency (e.g. 8MHz) or scaled by a factor. From this I'm guessing the ESP8266 would basically need to wait for the conditions (VSYNC low, HREF high), then start sampling the D0-D9 channels at a rate of 8MHz. If I understand correctly, D0-D9 must all be read before the next rising edge of the clock pulse, so that means the ESP must access its pins at a rate of 8MHz * 8 pins = 64MHz at least. That is for VGA mode, perhaps the lower resolution modes behave somewhat differently.
User avatar
By 0xPIT
#22790 Typically, µC's that handle video data from cameras have to be equipped with DMA, like the STM32 series.
I don't think is viable to produce any reasonably high resolution or adequate frame rate on the ESP8266, especially not via WIFI and definitely not if you need to compress the video frames.

Still images will be fine though, you'd need to implement a PNG or JPEG compressor, there are open soruce embedded implementations for this.
User avatar
By anvoice
#22791 No, that link is for the VC0706, which is actually a different camera from the OV7670, which I have. The OV7670 does not have Tx and Rx pins, as long as it is powered and supplied with a clock signal, it will acquire data and drive its HREF, VSYNC and data pins.

As I mentioned, the camera handles compression. It has a DSP module, and its output is the compressed image format. Basically its outputs (data pins 0-7) will transmit a byte of compressed information on each clock signal, provided HREF is high and VSYNC is low. Thus all I'd need to do is grab the data and transfer it via wifi, either as it comes or in chunks between acquisitions, e.g. transfer a line as soon as it completes and before the next one starts.