本帖最后由 往事啊 于 2018-6-11 22:14 编辑
#define OV7670_VSYNC HAL_GPIO_ReadPin(GPIOF,GPIO_PIN_8) //同步信号检测IO
#define OV7670_WRST(n) (n?HAL_GPIO_WritePin(GPIOF,GPIO_PIN_7,GPIO_PIN_SET):HAL_GPIO_WritePin(GPIOF,GPIO_PIN_7,GPIO_PIN_RESET)) //写指针复位
#define OV7670_WREN(n) (n?HAL_GPIO_WritePin(GPIOF,GPIO_PIN_6,GPIO_PIN_SET):HAL_GPIO_WritePin(GPIOF,GPIO_PIN_6,GPIO_PIN_RESET)) //写入FIFO使能
#define OV7670_RCK_H GPIOH->BSRR=1<<5 //设置读数据时钟高电平
#define OV7670_RCK_L GPIOH->BSRR=1<<21 //设置读数据时钟低电平
#define OV7670_RRST(n) (n?HAL_GPIO_WritePin(GPIOF,GPIO_PIN_9,GPIO_PIN_SET):HAL_GPIO_WritePin(GPIOF,GPIO_PIN_9,GPIO_PIN_RESET)) //读指针复位
#define OV7670_CS(n) (nHAL_GPIO_WritePin(GPIOH,GPIO_PIN_4,GPIO_PIN_SET):HAL_GPIO_WritePin(GPIOH,GPIO_PIN_4,GPIO_PIN_RESET)) //片选信号(OE)
#define OV7670_DATA (u8)((GPIOC->IDR&0x0030>>4)|((GPIOC->IDR&0x0400)>>4)|(GPIOB->IDR&0xe000)>>11|(GPIOG->IDR&0x1400)>>5)




上图是F7几个IO口我图像出来这样的
for(j=0;j<76800;j++)// {
OV7670_RCK_L;
color=OV7670_DATA; //读数据
OV7670_RCK_H;
color<<=8;
OV7670_RCK_L;
color|=OV7670_DATA; //读数据
OV7670_RCK_H;
LCD->LCD_RAM=color;
}
弄了好长时间,不知道问题出在哪了,希望原子哥和其他的大佬能帮我看看,找找原因
一周热门 更多>