求助!新手!stm32f407z的摄像头OV9655实验
时间:10-02
整理:3721RD
点击:
用的是微雪的STM32F407z的开发板,摄像头是OV9655,用随板的示例程序测试只显示已初始化成功,LCD上并无成像,是怎么回事啊?摄像头,板子和lcd屏都没问题!
我是新手,解答请详细点,在此拜谢各位大神!
ps:附主程序
#include "stm32f4xx.h"
#include "usart.h"
#include "LCD/LCD.h"
#include "camera/dcmi_OV9655.h"
void LCD_CS_ResetBits(void);
void Delay(__IO uint32_t nTime);
void TimingDelay_Decrement(void);
static __IO uint32_t TimingDelay;
uint32_t fps=0;
uint32_t disfps=0;
uint32_t fpsbuff[5];
int main(void)
{
OV9655_IDTypeDef OV9655ID;
USART_Configuration();
//USART_NVIC_Config();
LCD_Initializtion();
LCD_Clear(Red);
GUI_Text(50,70,"Camera Init..",White,Red);
printf("\r\n\r\nWelcome to WaveShare STM32F4 series MCU Board Open407I\r\n");
printf("OV9655 Init..\r\n");
if(DCMI_OV9655Config()==0){
printf("Camera Have Init..\r\n");
GUI_Text(50,90,"Camera Have Init..",White,Red);
}
else {
printf("OV9655 Init fails!\r\n");
GUI_Text(50,90,"OV9655 Init fails!",White,Red);
}
DCMI_OV9655_ReadID(&OV9655ID);
printf("OV9655 ID:0x%x 0x%x 0x%x 0x%x\r\n",OV9655ID.Manufacturer_ID1, OV9655ID.Manufacturer_ID2, OV9655ID.PID, OV9655ID.Version);
LCD_WriteReg(0x0011,0x6068);
LCD_SetCursor(0,0);
Prepare_Write_RAM();
/* Start Image capture and Display on the LCD *****************************/
/* Enable DMA transfer */
DMA_Cmd(DMA2_Stream1, ENABLE);
/* Enable DCMI interface */
DCMI_Cmd(ENABLE);
/* Start Image capture */
DCMI_CaptureCmd(ENABLE);
//DCMI_SingleRandomWrite(OV9655_DEVICE_WRITE_ADDRESS,0x8d, 0x10); //color test on
//DCMI_SingleRandomWrite(OV9655_DEVICE_WRITE_ADDRESS,0x0c, 0x80); //color test on
//uint32_t i=0x1fffff;
// while(i--);
//DCMI_SingleRandomWrite(OV9655_DEVICE_WRITE_ADDRESS,0x8d, 0x00); //color test off
//DCMI_SingleRandomWrite(OV9655_DEVICE_WRITE_ADDRESS,0x0c, 0x00); //color test off
while (1)
{
}
}
void Delay(__IO uint32_t nTime)
{
TimingDelay = nTime;
while(TimingDelay != 0)
{}
}
void TimingDelay_Decrement(void)
{
if (TimingDelay != 0x00)
{
TimingDelay--;
}
}
void LCD_CS_ResetBits(void)
{
GPIO_InitTypeDef GPIO_InitStructure;
RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOD, ENABLE);
//LCD_CS PD7
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_7;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
GPIO_Init(GPIOD, &GPIO_InitStructure);
GPIO_ResetBits(GPIOD , GPIO_Pin_7); //CS=0;
}
#ifdef USE_FULL_ASSERT
void assert_failed(uint8_t* file, uint32_t line)
{
/* User can add his own implementation to report the file name and line number,
ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */
/* Infinite loop */
while (1)
{
}
}
#endif
我是新手,解答请详细点,在此拜谢各位大神!
ps:附主程序
#include "stm32f4xx.h"
#include "usart.h"
#include "LCD/LCD.h"
#include "camera/dcmi_OV9655.h"
void LCD_CS_ResetBits(void);
void Delay(__IO uint32_t nTime);
void TimingDelay_Decrement(void);
static __IO uint32_t TimingDelay;
uint32_t fps=0;
uint32_t disfps=0;
uint32_t fpsbuff[5];
int main(void)
{
OV9655_IDTypeDef OV9655ID;
USART_Configuration();
//USART_NVIC_Config();
LCD_Initializtion();
LCD_Clear(Red);
GUI_Text(50,70,"Camera Init..",White,Red);
printf("\r\n\r\nWelcome to WaveShare STM32F4 series MCU Board Open407I\r\n");
printf("OV9655 Init..\r\n");
if(DCMI_OV9655Config()==0){
printf("Camera Have Init..\r\n");
GUI_Text(50,90,"Camera Have Init..",White,Red);
}
else {
printf("OV9655 Init fails!\r\n");
GUI_Text(50,90,"OV9655 Init fails!",White,Red);
}
DCMI_OV9655_ReadID(&OV9655ID);
printf("OV9655 ID:0x%x 0x%x 0x%x 0x%x\r\n",OV9655ID.Manufacturer_ID1, OV9655ID.Manufacturer_ID2, OV9655ID.PID, OV9655ID.Version);
LCD_WriteReg(0x0011,0x6068);
LCD_SetCursor(0,0);
Prepare_Write_RAM();
/* Start Image capture and Display on the LCD *****************************/
/* Enable DMA transfer */
DMA_Cmd(DMA2_Stream1, ENABLE);
/* Enable DCMI interface */
DCMI_Cmd(ENABLE);
/* Start Image capture */
DCMI_CaptureCmd(ENABLE);
//DCMI_SingleRandomWrite(OV9655_DEVICE_WRITE_ADDRESS,0x8d, 0x10); //color test on
//DCMI_SingleRandomWrite(OV9655_DEVICE_WRITE_ADDRESS,0x0c, 0x80); //color test on
//uint32_t i=0x1fffff;
// while(i--);
//DCMI_SingleRandomWrite(OV9655_DEVICE_WRITE_ADDRESS,0x8d, 0x00); //color test off
//DCMI_SingleRandomWrite(OV9655_DEVICE_WRITE_ADDRESS,0x0c, 0x00); //color test off
while (1)
{
}
}
void Delay(__IO uint32_t nTime)
{
TimingDelay = nTime;
while(TimingDelay != 0)
{}
}
void TimingDelay_Decrement(void)
{
if (TimingDelay != 0x00)
{
TimingDelay--;
}
}
void LCD_CS_ResetBits(void)
{
GPIO_InitTypeDef GPIO_InitStructure;
RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOD, ENABLE);
//LCD_CS PD7
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_7;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
GPIO_Init(GPIOD, &GPIO_InitStructure);
GPIO_ResetBits(GPIOD , GPIO_Pin_7); //CS=0;
}
#ifdef USE_FULL_ASSERT
void assert_failed(uint8_t* file, uint32_t line)
{
/* User can add his own implementation to report the file name and line number,
ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */
/* Infinite loop */
while (1)
{
}
}
#endif
不懂 只想拿分。
请问小编解决没呢,我也遇到这个问题了 用他们给的程序调不出来
不错,下载下来看看。