完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
数据有干扰,先解决干扰问题,杜邦线连接的?
|
|
|
|
杜邦线连接的。我按着你的方法把数据线绑一起,其他的线绑一起也是这样。用彩带测试的时候彩带颜色不是渐变的,每条彩带之间有杂色。。。还有显示分成三块是什么原因
|
|
|
|
得慢慢调试了
|
|
|
|
c彩条测试这样了,颜色顺序不对
|
|
|
|
|
|
|
|
出来图像呢,不是楼主位的图像吧?
|
|
|
|
原子哥,现在显示的情况就是这样,是不合适寄存器设置的有问题呢
|
|
|
|
原子哥7楼的图是我现在的现实情况,是不是寄存器设置的有问题?
|
|
|
|
[C] 纯文本查看 复制代码
总线void StartI2C0(void){//OV7670_Contr=OV_SDA_Dir|0x01; //SDA_Dir=1,Output modeOV7670_Contr=OV_SDA|0x01; //SDA=1Delay(1);OV7670_Contr=OV_SCLK|0x01; //SCLK=1Delay(1); OV7670_Contr=OV_SDA|0x00; //SDA=0Delay(1);OV7670_Contr=OV_SCLK|0x00; //SCLK=0 Delay(1);//OV7670_Contr=OV_SDA_Dir|0x00; //SDA_Dir=0,Input mode}void StopI2C0(void){//OV7670_Contr=OV_SDA_Dir|0x01; //SDA_Dir=1,Output modeOV7670_Contr=OV_SDA|0x00; //SDA=0 Delay(1); OV7670_Contr=OV_SCLK|0x01; //SCLK=1 Delay(1); OV7670_Contr=OV_SDA|0x01; //SDA=1 Delay(1);//OV7670_Contr=OV_SDA_Dir|0x00; //SDA_Dir=0,Input mode}void NoAck0(void){OV7670_Contr=OV_SDA|0x01; //SDA=1Delay(1);OV7670_Contr=OV_SCLK|0x01; //SCLK=1Delay(1);OV7670_Contr=OV_SCLK|0x00; //SCLK=0Delay(1);OV7670_Contr=OV_SDA|0x00; //SDA=0//Delay(1);}unsigned char I2CWrite0(unsigned char DData){unsigned char j,tem;volatile unsigned short int flag=0;OV7670_Contr=OV_SDA_Dir|0x01; //SDA_Dir=1,Output modefor(j=0;j<8;j++) {if((DData< 摄像头[C] 纯文本查看 复制代码 [mw_shl_code=c,true]#include "I2C.h"#include "Common.h"#include "OV7670.h"unsigned char WrCmos7670(unsigned char regID, unsigned char regDat){StartI2C0();if(0==I2CWrite0(0x42)) //CMOS器件地址(写){StopI2C0();return(0);}Delay(1); if(0==I2CWrite0(regID)) //CMOS寄存器地址{StopI2C0();return(0);}Delay(1); if(0==I2CWrite0(regDat))//待写入指定寄存器的值{StopI2C0();return(0);} StopI2C0(); return(1);}unsigned char ReCmos7670(unsigned char regID,unsigned char *DData) //{ StartI2C0();if(0==I2CWrite0(0x42)) { StopI2C0(); return(0); } Delay(100); if(0==I2CWrite0(regID)) { StopI2C0(); return(0); } StopI2C0();StartI2C0();if(0==I2CWrite0(0x43))//if(0==I2CWrite0(0x43)){StopI2C0();return(0);}Delay(1);*DData=I2CRead0();NoAck0();StopI2C0();return(1);}void set_Cmos7670reg(void){WrCmos7670(0x3a, 0x04);WrCmos7670(0x40, 0xd0);// WrCmos7670(0x12, 0x14);//输出格式:QVGA(分辨率为320*240)RGBWrCmos7670(0x32, 0x80);//HREF WrCmos7670(0x32, 0x80) WrCmos7670(0x17, 0x13);//行频 WrCmos7670(0x17, 0x16)17WrCmos7670(0x18, 0x01);//行频 WrCmos7670(0x18, 0x04)05WrCmos7670(0x19, 0x02);//场频 WrCmos7670(0x1a, 0x7a);//场频 WrCmos7670(0x1a, 0x7b)WrCmos7670(0x03, 0x0a);//VREF WCmos7670(0x03, 0x06) 00WrCmos7670(0x0c, 0x00);WrCmos7670(0x3e, 0x00);//PCLK分频00 Normal,10(1分频),11(2分频),12(4分频),13(8分频)14(16分频)WrCmos7670(0x70, 0x00);//通常设置为0 WrCmos7670(0x70, 0x3a)WrCmos7670(0x71, 0x00);//0x71 赋值为0x80时输出8条彩带 35 WrCmos7670(0x72, 0x11);WrCmos7670(0x73, 0x00);//DSP缩放时钟分频00 Normal,10(1分频),11(2分频),12(4分频),13(8分频)14(16分频) WrCmos7670(0xa2, 0x02);WrCmos7670(0x11, 0x87);//(0x11,0x80)内部工作时钟设置,直接使用外部时钟源(80)WrCmos7670(0x7a, 0x20);WrCmos7670(0x7b, 0x1c);WrCmos7670(0x7c, 0x28);WrCmos7670(0x7d, 0x3c);WrCmos7670(0x7e, 0x55);WrCmos7670(0x7f, 0x68);WrCmos7670(0x80, 0x76);WrCmos7670(0x81, 0x80);WrCmos7670(0x82, 0x88);WrCmos7670(0x83, 0x8f);WrCmos7670(0x84, 0x96);WrCmos7670(0x85, 0xa3);WrCmos7670(0x86, 0xaf);WrCmos7670(0x87, 0xc4);WrCmos7670(0x88, 0xd7);WrCmos7670(0x89, 0xe8);WrCmos7670(0x13, 0xe0);WrCmos7670(0x00, 0x00);WrCmos7670(0x10, 0xFf);WrCmos7670(0x0d, 0x00);WrCmos7670(0x14, 0x29);WrCmos7670(0xa5, 0x05);WrCmos7670(0xab, 0x07);WrCmos7670(0x24, 0x75);WrCmos7670(0x25, 0x63);WrCmos7670(0x26, 0xA5);WrCmos7670(0x9f, 0x78);WrCmos7670(0xa0, 0x68);WrCmos7670(0xa1, 0x03);WrCmos7670(0xa6, 0xdf);WrCmos7670(0xa7, 0xdf);WrCmos7670(0xa8, 0xf0);WrCmos7670(0xa9, 0x90);WrCmos7670(0xaa, 0x94);WrCmos7670(0x13, 0xe5);WrCmos7670(0x0e, 0x61);WrCmos7670(0x0f, 0x4b);WrCmos7670(0x16, 0x02);WrCmos7670(0x1e, 0x37);//31?WrCmos7670(0x21, 0x02);WrCmos7670(0x22, 0x91);WrCmos7670(0x29, 0x07);WrCmos7670(0x33, 0x0b);WrCmos7670(0x35, 0x0b);WrCmos7670(0x37, 0x1d);WrCmos7670(0x38, 0x71);WrCmos7670(0x39, 0x2a);WrCmos7670(0x3c, 0x78);WrCmos7670(0x4d, 0x40);WrCmos7670(0x4e, 0x20);WrCmos7670(0x69, 0x00);WrCmos7670(0x6b, 0x60);//(旁路PLL倍频;0x0A:关闭内部LDO;0x00:打开LDOWrCmos7670(0x74, 0x19);WrCmos7670(0x8d, 0x4f);WrCmos7670(0x8e, 0x00);WrCmos7670(0x8f, 0x00);WrCmos7670(0x90, 0x00);WrCmos7670(0x91, 0x00);WrCmos7670(0x92, 0x00);WrCmos7670(0x96, 0x00);WrCmos7670(0x9a, 0x80);WrCmos7670(0xb0, 0x84);WrCmos7670(0xb1, 0x0c);WrCmos7670(0xb2, 0x0e);WrCmos7670(0xb3, 0x82);WrCmos7670(0xb8, 0x0a);WrCmos7670(0x43, 0x14);WrCmos7670(0x44, 0xf0);WrCmos7670(0x45, 0x34);WrCmos7670(0x46, 0x58);WrCmos7670(0x47, 0x28);WrCmos7670(0x48, 0x3a);WrCmos7670(0x59, 0x88);WrCmos7670(0x5a, 0x88);WrCmos7670(0x5b, 0x44);WrCmos7670(0x5c, 0x67);WrCmos7670(0x5d, 0x49);WrCmos7670(0x5e, 0x0e);WrCmos7670(0x64, 0x04);WrCmos7670(0x65, 0x20);WrCmos7670(0x66, 0x05);WrCmos7670(0x94, 0x04);WrCmos7670(0x95, 0x08);WrCmos7670(0x6c, 0x0a);WrCmos7670(0x6d, 0x55);WrCmos7670(0x6e, 0x11);WrCmos7670(0x6f, 0x9f);WrCmos7670(0x6a, 0x40);WrCmos7670(0x01, 0x80);//0x40WrCmos7670(0x02, 0x80);//0x40WrCmos7670(0x13, 0xe6);WrCmos7670(0x15, 0x00);//0x00WrCmos7670(0x4f, 0x80);WrCmos7670(0x50, 0x80);WrCmos7670(0x51, 0x00);WrCmos7670(0x52, 0x22);WrCmos7670(0x53, 0x5e);WrCmos7670(0x54, 0x80);WrCmos7670(0x58, 0x9e);WrCmos7670(0x41, 0x18);WrCmos7670(0x3f, 0x00);WrCmos7670(0x75, 0x0F);WrCmos7670(0x76, 0xeF);WrCmos7670(0x4c, 0x00);WrCmos7670(0x77, 0x01);WrCmos7670(0x3d, 0xc2);//0xc8?WrCmos7670(0x4b, 0x09);WrCmos7670(0xc9, 0x60);WrCmos7670(0x41, 0x38);WrCmos7670(0x56, 0x40);WrCmos7670(0x34, 0x11);WrCmos7670(0x3b, 0x02); WrCmos7670(0xa4, 0x89);WrCmos7670(0x96, 0x00);WrCmos7670(0x97, 0x30);WrCmos7670(0x98, 0x20);WrCmos7670(0x99, 0x30);WrCmos7670(0x9a, 0x84);WrCmos7670(0x9b, 0x29);WrCmos7670(0x9c, 0x03);WrCmos7670(0x9d, 0x4c);WrCmos7670(0x9e, 0x3f);WrCmos7670(0x78, 0x04);}unsigned char Cmos7670_init(void){ if(0==WrCmos7670(0x12,0x80)) {return 0 ;}Delay(1); set_Cmos7670reg();return 1; } [/mw_shl_code] |
|
|
|
就是把0x71 设置为0x80,显示的彩条对应的颜色不对
|
|
|
|
没遇到过了。你这彩条看似正常, 出来的图像这般摸样...
|
|
|
|
只有小组成员才能发言,加入小组>>
2883 浏览 3 评论
27666 浏览 2 评论
3458 浏览 2 评论
3975 浏览 4 评论
基于采用FPGA控制MV-D1024E系列相机的图像采集系统设计
2319 浏览 3 评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-3 06:45 , Processed in 1.009063 second(s), Total 97, Slave 78 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号