原子大大, 为什么OV7670无法全屏

2019-07-20 06:29发布

原子大大, 为什么OV7670无法全屏;

目前只能设置320x320以下,但是我记得ov7670好像支持640x480的;
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
16条回答
wlq390934605
2019-07-20 10:10
这样我们就可以写一个简单的函数来设置 OV7670 的分辨率了
输入图像的行起始点,场起始点, 宽度 ,高度计算得到相应寄存器的值
编译环境:keil mdk
void OV7670_config_window(u16 startx,u16 starty,u16 width, u16 height) {
u16 endx=(startx+width*2)%784;
u16 endy=(starty+height*2);
u8 x_reg, y_reg;
u8 state,temp;
state= rdOV7670Reg(0x32, &x_reg ); x_reg&= 0xC0;
state= rdOV7670Reg(0x03, &y_reg ); y_reg&= 0xF0;
//设置 HREF
temp = x_reg|((endx&0x7)<<3)|(startx&0x7); state = wrOV7670Reg(0x32, temp );
temp = (startx&0x7F8)>>3;
state = wrOV7670Reg(0x17, temp );
temp = (endx&0x7F8)>>3;
state = wrOV7670Reg(0x18, temp );
//设置 VREF
temp = y_reg|((endy&0x3)<<2)|(starty&0x3); state = wrOV7670Reg(0x03, temp );
temp = (starty&0x3FC)>>2;
state = wrOV7670Reg(0x19, temp );
temp = (endy&0x3FC)>>2;
state = wrOV7670Reg(0x1A, temp );
}

一周热门 更多>