OV7670 capture part of a frame fast

I have stolen a lot of code from mr_arduino (thanks very much).
camInit();
setRes(qvga);
setColor(yuv422);
wrReg(0x11,12);

My problem is that it takes too long time to capture an image. I only need about 60x300 pixels and then only in B&W. I'm trying to read a barcode.

Is there anything I can do to increase the frame rate, I seam to spend most of my time waiting for VSYNC

I've changed the values of HSTART,HSTOP VSTART VSTOP HREF VREF to reduce the image size.
But it seams as if VSYNC doesnt change

//Wait for vsync it is on pin 3 (counting from 0) portD
while(!(PIND&8));//wait for high
while((PIND&8));//wait for low

It seams as if I only get a pulse every second or so. The ov7670 can work at 30fps so hoped for
one every 1/30 of a second.

I am doing very little within the image capture loop, and what I do do I've put in the space where the OV7670 sends the UV byte of the YUV data:

xPixel=Wide;
while(xPixel--){
yPixel=High;
bars=&counts[0];
while(yPixel--){
while((PIND&4));//wait for low
hold = (PINC&15)|(PIND&240);
while(!(PIND&4));//wait for high
while((PIND&4));//wait for low
// if above add to count
if(hold>Threshold){
*bars=1+*bars;}
bars++;

while(!(PIND&4));//wait for high

}
}
// process bars

I have tried changing register CLKRC but I get garbage. Do I need to change others CLK_EXT, CLK_SCALE DBCLK and to what?

The clock is set in the first bit of code:
void setup(void){
Serial.begin(9600);
DDRB|=(1<<3);//pin 11
ASSR &= ~(_BV(EXCLK) | _BV(AS2));
TCCR2A=(1<<COM2A0)|(1<<WGM21)|(1<<WGM20);
TCCR2B=(1<<WGM22)|(1<<CS20);
OCR2A=0;//(F_CPU)/(2*(X+1))
DDRC&=~15;//low d0-d3 camera
DDRD&=~252;//d7-d4 and interrupt pins

_delay_ms(3000);
//set up twi for 100khz
TWSR&=~3;//disable prescaler for TWI
TWBR=72;//set to 100khz
//enable serial
UBRR0H=0;
UBRR0L=1;//0 = 2M baud rate. 1 = 1M baud. 3 = 0.5M. 7 = 250k 207 is 9600 baud rate.
UCSR0A|=2;//double speed aysnc
UCSR0B = (1<<RXEN0)|(1<<TXEN0);//Enable receiver and transmitter
//when using serial RX we need also
UCSR0B = UCSR0B | (1<<RXCIE0); //enable interrupt on byte receive
UCSR0C=6;//async 1 stop bit 8bit char no parity bits

Can anybody tell me what registers should be set to what values to get the OV7670 to send data at the maximum speed that the arduino can handle. Even 10fps would be an improvement.

Is there a maximum data rate the arduino can handle.

10fps x 640*480 x 3 requires is 9MHz ( I know 10fps x 320x60 x1 is less data but its the frame time that matters)
I'm not even sure what rate I'm reading with the current settings.

Thanks again for getting me this far. I'm nearly there.

Gary.

can't help with the problem as Iam not familiar with the hardware, but I have some code style tips for you:

first:

while(!(PIND&8));//wait for high
while((PIND&8));//wait for low

these cool guys are missing [code][/code] tags (please modify your post and use them)

furthermore it is good pratice to write magic numbers like in

hold = (PINC&15)|(PIND&240);

in hexadecimal style or Binary

hold = (PINC & 0x0F) | (PIND & 0xF0);
hold = (PINC & 0b00001111) | (PIND & 0b11110000);

and yes, spaces in formulas improve readability

Finally the Arduino IDE has the CTRL-T option for auto indenting code, which improves readability too,

Sorry I could not help with the real problem,