ov7670-no-ram-arduino-uno icon indicating copy to clipboard operation
ov7670-no-ram-arduino-uno copied to clipboard

Datarate

Open abbanerjeersm opened this issue 9 years ago • 4 comments

Hi,

In your main.c, you poll PORT D2 for rising edge to collect the 8 bits of pixel data. This is your PCLK. This clock is running at 8 Mhz - so essentially you are producing 64 Mbits per second or 8 mega bytes per second. Your UART is 2 Mbps or 250 Kilo Bytes per second.

Everytime you push the data into UDR0 - it gets transmitted at a much slower pace. This should lead to some sort of missing bytes or data buffer overrun but I guess it dosent.

So in summary, given your PCLK produces roughly 1 byte at 8 Mhz rate, and your serial connection is 250 KB/s , why dosent this mismatch lead to failure of transmission ?

As your code works, obviously I am missing something. Can you please enlighten me ?

abbanerjeersm avatar Jun 28 '15 23:06 abbanerjeersm

I've try with your code already. VGA (640 X 480) and bayer RGB. USART speed is 9600 Bps. I've set Arduino to capture only 1 snapshot. OV7670 can transfer data to Arduino properly BUT many data lost. Every time that I reset It show "RDY" in the serial monitor and followed by 1,920 bytes of data.

seewseew avatar Jul 13 '15 03:07 seewseew

I forgot to comment some details. I use 2 of 10K resisters for I2C on both SIOC and SIOD as you mentioned in "Fritzing.org" project and 74LS shift level at XCLK to reduce from 5V to 3V.

seewseew avatar Jul 13 '15 03:07 seewseew

@abbanerjeersm actually datarate is even less. 2Mbaud uses 10 bits per byte (1 start bit, 8 data bits and 1 stop bit), so actual rate is 2M / 10 = 200 KBps. But I suspect, that PCLK is not working at full 8 MHz. I think, but I haven't checked yet, that there is a divisor used and the PCLK is actually running at much lower speed.

dmmedia avatar Jul 14 '15 14:07 dmmedia

Hi, I've arduino nano connected to ov7670. I've similar problem while reading frames using simpleFrameGrabber application. #./grab 160 120 rgb565 2000000 /dev/ttyUSB0 0 .... I read "Frames per second = 0.007594" After some time I get a noisy image.Can anybody help me in this regard. Thanks,

badarineo avatar Nov 18 '15 19:11 badarineo