Pages: [1]   Go Down
Author Topic: High Frequency Speed digitalRead/Write (Arduino MEGA 2560)  (Read 1719 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

I am trying to read/write one image from OV7670 (640x480) at 30 fps. So I need read pixel/pixel in (~10MHZ).
I would like to know, how can I do this in Arduino MEGA 2560, cause the structure digitalRead/Write is very slow for this application.

I know the clock in Arduino MEGA 2560 is 16 MHz, so I need help to know how to use this in best performance.

Thank you.
Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 212
Posts: 8974
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You can use SPI on any 16 MHz Arduino to transfer data at about 8 megabits per second. I doubt the Arduino will be able to do much with data arriving that quickly.
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 549
Posts: 27418
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

640*480 = 307,200 pixels.
Is it 1 bit/pixel? Or 8?
Say 8, just for B/W data.
You can't store/buffer 1 frame's worth of data without extra hardware.
1 frame then takes at least 2,457,600 bits of data to come in.

http://www.voti.nl/docs/OV7670.pdf

I would say 8 bit processor at 16 MHz is really underpowered for this device.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am using ov7670 + al422b , so it's not a problem to capture and save in the camera. The problem is the speed to read at the arduino board.
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 549
Posts: 27418
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Do you have a spec? Idon't know what the interface is to the AL422B.

I was some other hits on "ov7670  arduino" when I googled earlier. Basic amount of data to read & write out? to what? would seem to preclude 30 fps with 16 MHz uC tho.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Newbie
*
Karma: 0
Posts: 13
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Guys,
Why use OV7670, it outputs uncompressed image, that is really to large for Arduino to handle.
You can try other image sensors from Omnivision like OV2640, OV3640 ,OV5642 which can output compressed JPEG image. And the output data is really small than OV7670.
You can take a look at OV5642 camera module sample pictures from http://www.arducam.com/camera-modules/5mp-ov5642/
Logged

Offline Offline
Sr. Member
****
Karma: 11
Posts: 358
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It is possible to capture data from the ov7670 enspecially if you have the one with the fifo or as ardufans said get an arducam. However I have gotten the ov7670 to work without a fifo see http://forum.arduino.cc/index.php?topic=159557.0
Logged

Pages: [1]   Go Up
Jump to: