OV7670 with QQVGA format

Hello!
I am trying to get a QQVGA output to a computer using an OV7670 camera connected to an Arduino Due.

The following registers give a decent QVGA image. See attachment QVGA OUTPUT.png.

//setup for QVGA
writeReg(R_COM3, 0x04);

  • writeReg(R_COM14, 0x19);*
  • writeReg(R_HSTART,0x16);*
  • writeReg(R_HSTOP, 0x04);*
  • writeReg(R_HREF, 0x24);*
  • writeReg(R_VSTRT, 0x02); *
  • writeReg(R_VSTOP, 0x7A);*
  • writeReg(R_VREF, 0x0A);*
  • writeReg(R_SCALING_DCWCTR, 0x11);*
  • writeReg(R_SCALING_PCLK_DIV, 0xF1);*

After changing the downsampling value to 4:

writeReg(R_SCALING_DCWCTR, 0x22),

four images appear on the single output screen. The quality is not nearly as good as with the standard QVGA output. See attachment QVGA OUTPUT DOKWNSAMPLING x4.png.

Changing the frame size to 160x120 to get a single QQVGA image makes the image's quality worse. See attachment QQVGA OUTPUT ATTEMPT.png.

Does anyone have any suggestions on how to get a QQVGA image from the OV7670? I've tried messing with some registers and doing research but still cannot get it working.

The OV7670 Omniworks Quick Start manual has some recommended register settings, but it doesn't include HSTART, HSTOP, HREF, VSTART, VSTOP, and VREF.

QVGA OUTPUT.png

QVGA OUTPUT DOWNSAMPLING x4.png

QQVGA OUTPUT ATTEMPT.png

QVGA OUTPUT.png

QVGA OUTPUT DOWNSAMPLING x4.png

QQVGA OUTPUT ATTEMPT.png

By the way... this code gave the result I was looking for

void setupQQVGA() {
//setup for QQVGA
writeReg(R_COM3, 0x04);
writeReg(R_COM7, 0x04); //QCIF
writeReg(R_COM14, 0x1a);
writeReg(R_HSTART,0x16);
writeReg(R_HSTOP, 0x04);
writeReg(R_HREF, 0xa4);
writeReg(R_VSTRT, 0x02);
writeReg(R_VSTOP, 0x7A);
writeReg(R_VREF, 0xa4);
writeReg(R_SCALING_DCWCTR, 0x22);
writeReg(R_SCALING_PCLK_DIV, 0xF2);
}

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.