Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Datarate #10

Open
abbanerjeersm opened this issue Jun 28, 2015 · 4 comments
Open

Datarate #10

abbanerjeersm opened this issue Jun 28, 2015 · 4 comments

Comments

@abbanerjeersm
Copy link

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 ?

@seewseew
Copy link

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
Copy link

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.

@dmmedia
Copy link

dmmedia commented Jul 14, 2015

@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.

@badarineo
Copy link

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,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants