0v7670窗口显示异常

2019-12-27 19:04发布

在320X240的液晶上显示qvga,一切正常。打算让摄像头显示在窗口280X200,怎么都是错位。
void OV_HW(unsigned int  hstart, unsigned int hstop, unsigned int vstart, unsigned int vstop)
{
    uint8_t v;
    OV7670_WriteReg(0x17, (hstart >> 3) & 0xff); //HSTART
    OV7670_WriteReg(0x18, (hstop >> 3) & 0xff); //HSTOP
    OV7670_ReadReg(0x32,&v);
    v = (v & 0xc0) | ((hstop & 0x7) << 3) | (hstart & 0x7);
    OV7670_WriteReg(0x32, v); //HREF

    OV7670_WriteReg(0x19, (vstart >> 2) & 0xff); //VSTART 开始高8位
    OV7670_WriteReg(0x1a, (vstop >> 2) & 0xff); //VSTOP        结束高8位
     OV7670_ReadReg(0x03,&v );
    v = (v & 0xf0) | ((vstop & 0x3) << 2) | (vstart & 0x3);
   OV7670_WriteReg(0x03, v); //VREF
    OV7670_WriteReg(0x11, 0x00);
}
19条回答
chengying
2019-12-28 13:08
本帖最后由 chengying 于 2016-6-28 09:36 编辑
heitu103 发表于 2016-6-27 18:16
忘记说了,OV7670_config_window函数的前两个参数是固定的,比如你要设置160x120大小的画面,参数是这样 ...


你好,设置160X120画面,为何显示是160X60两个画面叠加,你那也会这样吗,我现在是OV7670_config_window(184,10,160,240);才能正常显示160X120,另外为和起始地址是184和10,为何不能0,?

一周热门 更多>