Home > other >  Stm32 ov7670 camera fuzzy split screen problem [red envelope appreciation]
Stm32 ov7670 camera fuzzy split screen problem [red envelope appreciation]

Time:05-20

Ribbons output normal:


Output fuzzy point also can't see photo shoot and vague:


This was shot using a mobile phone real figure:


Speculation is the cause of the resolution Settings, is unlikely to configure ov7670 resolution. Hope people:
Enclosed, source:
 13 void OV7670_Window_Set (under-16 sx, under-16 sy, under-16 width, under-16 height) 
12 {
11 under-16 endx;
10 under-16 endy.
9 u8 temp;
8 endx=sx + width * 2;//V * 2
7 endy=sy + height * 2;
6 the if (endy> Endy - 784)=784;
Temp=5 SCCB_RD_Reg (0 x03);//read Vref before the value of the
4 temp&=0 xf0;
3 \ |=((endx& 0 x03) & lt; <(2) | sx& 0 x03);
2
1 SCCB_WR_Reg (0 x03, temp);//set the Vref of start and end of the lowest 2 [& gt;/
0 SCCB_WR_Reg (0 x19 sx> 2);//set the Vref start high 8 [& gt;/
1 SCCB_WR_Reg (0 x1a endx> 2);//set the Vref end high 8 [& gt;/
2
3 temp=SCCB_RD_Reg x32 (0);//read before the Href value
4 temp&=0 xc0;
5 \ |=((endy& 0 x07) & lt; <(3) | sy& 0 x07);
6 SCCB_WR_Reg (0 x17, sy> 3);//set the Href start high 8 [& gt;/
7 SCCB_WR_Reg (0 x18, endy> 3);//set the Href end high eight
8}
9


Register configuration:
Ov7670config. H
 const u8 ov7670_init_reg_tbl [], [2]=
{
{0 x3a, 0 x04},
{0 x40, 0 x10},
{0 x12, 0 x14},
{0 x32, 0 x80},
{0 x17, 0 x17},
{0 x18, 0 x05},
{0 x19, 0 x02},
{0 x1a, 0 x7b},//0 x7a,
{0 x03, 0 x0a},//0 x0a,
{0 x0c, 0 x0c},
{0 x3e, 0 x00},//
X70 {0, 0 x00},
{0 x71, 0 x01},
X71//{0, 0 x80},//0 x80 test striped
{0 x72, 0 x11},
X73 {0, 0 x09},//
{0 xa2, 0 x02},
X11 {0, 0 x00},
{0 x7a, 0 x20},
{0 x7b, 0 x1c},
{0 x7c, 0 x28},
{0 x7d, 0 x3c},
{0 x7e, 0 x55},
{0 x7f, 0 x68},
{0 x80, 0 x76},
{0 x81, 0 x80},
{0 x82, 0 x88},
{0 x83, 0 x8f},
{0 x84, 0 x96},
{0 x85, 0 xa3},
{0 x86, 0 xaf},
{0 x87, 0 xc4},
{0 x88, 0 xd7},
{0 x89, 0 xe8},
{0 x13, 0 xe0-0xfc},
{0 x00 to 0 x00},
{0 x10, 0 x00},
{0 x0d, 0 x00},
{0 x14, 0 x38},
{0 xa5, 0 x05},
{0 xab, 0 x07},
{0 x24, 0 x75},
{0 x25, 0 x63},
{0 x26, 0 xa5},
{0 x9f, 0 x78},
{0 xa0, 0 x68},
{0 xa1, 0 x03},//0 x0b,
XDF xa6 {0, 0},//0 xd8,
XDF xa7 {0, 0},//0 xd8,
{0 xa8, 0 xf0},
{0 xa9, 0 x90},
{0 xaa, 0 x94},
{0 x13, 0 xe5},
{0 x0e, 0 x61},
{0 x0f, 0 x4b},
{0 x16, 0 x02},
{0 x1e, 0 x27},//0 x07,
{0 x21, 0 x02},
{0 x22, 0 x91},
X29 {0, 0 x07},
{0 x33, 0 x0b},
{0 x35, 0 x0b},
{0 x37, 0 x1d},
{0 x38, 0 x71},
{0 x39, 0 x2a},
{0 x3c, 0 x78},
{0 x4d, 0 x40},
{0 x4e, 0 x20},
{0 x69, 0 x5d},
{0 x6b, 0 x40},//PLL
{0 x74, 0 x19},
{0 x8d, 0 x4f},
{0 x8e, 0 x00},
{0 x8f, 0 x00},
{0 x90, 0 x00},
{0 x91, 0 x00},
{0 x92, 0 x00},//0 x19,//0 x66
{0 x96, 0 x00},
{0 x9a, 0 x80},
{0 xb0, 0 x84},
{0 xb1, 0 x0c},
{0 sets, 0 x0e},
{0 xb2, 0 x82},
{0 xb8, 0 x0a},
{0 x43, 0 x14},
X44 {0, 0 xf0},
{0 x45, 0 x34},
{0 x46, 0 x58},
X47 {0, 0 x28},
{0 x48, 0 x3a},
{0 x59, 0 x88},
{0 x5a, 0 x88},
{0 x5b, 0 x44},
{0 x5c, 0 x67},
{0 x5d, 0 x49},
{0 x5e, 0 x0e},
X64 {0, 0 x04},
{0 x65, 0 x20},
{0 x66, 0 x05},
{0 x94, 0 x04},
{0 x95, 0 x08},
{0 x6c, 0 x0a},
{0 x6d, 0 x55},
{0 x6e, 0 x11},
{0 x6f, 0 x9f},
{0 x6a, 0 x40},
//{0 x01, 0 x60},
//{0 x02, 0 x60},
{0 x13, 0 xe7},
{0 x15, 0 x00},
{0 x4f, 0 x80},
{0 x50, 0 x80},
{0 x51, 0 x00},
{0 x52, 0 x22},
X53 {0, 0 x5e},
{0 x54, 0 x80},
{0 x55, 0 x00},
//brightness{0 x56, 0 x60},//contrast
{0 x57, 0 x90},
{0 x58, 0 x9e},
{0 x41, 0 x08},
X3f {0, 0 x05},//edge enhancement adjustment
{0 x75, 0 x05},
{0 x76, 0 xe1},
{0 x4c, 0 x0f},
//noise suppression strengthX77 {0, 0 x0a},
X3d {0, 0 xc2},//0 xc0,
{0 x4b, 0 x09},
{0 xc9, 0 xc8},
{0 x41, 0 x38},

{0 x34, 0 x11},
{0 x3b, 0 x02},//0 x00,//0 x02,
{0 xa4, 0 x89},//0 x88,
{0 x96, 0 x00},
{0 x97, 0 x30},
{0 x98, 0 x20},
{0 x99, 0 x30},
{0 x9a, 0 x84},
{0 x9b, 0 x29},
{0 x9c, 0 x03},
{0 x9d, 0 x4c},
{0 x9e, 0 x3f},
{0 x78, 0 x04},
X79 {0, 0 x01},
{0 xc8, 0 xf0},
X79 {0, 0 x0f},
{0 xc8, 0 x00},
X79 {0, 0 x10},
{0 xc8, 0 x7e},
X79 {0, 0 x0a},
{0 xc8, 0 x80},
X79 {0, 0 x0b},
{0 xc8, 0 x01},
X79 {0, 0 x0c},
{0 xc8, 0 x0f},
X79 {0, 0 x0d},
{0 xc8, 0 x20},
X79 {0, 0 x09},
{0 xc8, 0 x80},
X79 {0, 0 x02},
{0 xc8, 0 xc0},
X79 {0, 0 x03},
{0 xc8, 0 x40},
X79 {0, 0 x05},
{0 xc8, 0 x30},
{0 x69, 0 xaa},//
{0 x09, 0 x00},
{0 x3b, 0 x42},
{0 x2d, 0 x01},
};
  • Related