STM32 port and OV7670 ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2014-04-07 7:11 PM
Guys,
I have OV7670 module and STM32 dev board, I'm confused on how to connect the port of STM32 and OV7670 at the module because of the name of the port on OV7670 is different with in STM32 code, anyone has experience ? thanks
/*------------------------------------------------------
Ä£¿éÒý½ÅÃû³Æ | ÃèÊö | STM32¶ËÒý½Å�?¬½Ó |
------------------------------------------------------
SCCB_SCL : SCCBʱÖÓ : PB10 I2C2_SCL
SCCB_SDA : SCCBÊý¾�? : PB11 I2C2_SDA
CAM_VSYNC : Ö¡�?¬²½ : PA0 �?ⲿÖ�?¶�?0
CAM_HREF : FIFO : PB7 GPIO
CAM_WEN : FIFO�?´ÔÊ�?à : PD3 GPIO
XCLK : CMOS´«¸�?Æ÷Ö÷ʱÖÓ: PA8 MCOÊä³ö
CAM_RRST : FIFO¶�?µØÖ·¸´Î» : PE0 GPIO
CAM_REN : FIFOƬѡ : PD6 GPIO
CAM_RCLK : FIFO¶�?ʱÖÓ : PE1 GPIO
FIFO D0~D7 : FIFOÊý¾�?Êä³ö : PC0~PC7 GPIO
-----------------------------------------------------*/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2014-04-08 5:28 PM
How to use DMA ? Isn't it related with 72MHz clock ? I'm using 8MHz crystal, but I don't know how to set it as 72MHz, is it RCC configuration ?
thanks- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2014-04-08 5:39 PM
I have the OmniVision documentation, but you are using some other board, built by someone else which contains a camera and fifo, and presumably some other clocking or connectivity. Who built that board, and where's the documentation for that?
I have no idea what your code looks like, or how you are clocking data out the fifo. I can presume that it's reading GPIO pins for the data bits, and then bit-banging some of the control lines to the fifo to extract the data. That is likely quite slow. If you are bit banging the interface it might be difficult to use DMA, you could perhaps use a TIM to drive a signal to the fifo, and clock a GPIO-to-MEMORY DMA transfer, but that's probably beyond your grasp from an implementation perspective, and I don't want to write it.Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2014-04-08 5:55 PM
The main code I use :
LCD_Initializtion();
USART_Configuration();
printf
(
''**************************************************************
''
);
printf
(
''* *
''
);
printf
(
''* OV7670 STM32 TEST ^_^ *
''
);
printf
(
''* *
''
);
printf
(
''**************************************************************
''
);
FIFO_GPIO_Configuration();
FIFO_CS_L();
FIFO_WE_H();
while
( 1 != Sensor_Init() );
OV7670_EXTI_Configuration();
OV7670_NVIC_Configuration();
printf
(
''OV7670_NVIC_Configuration.....''
);
NEXT_LINE;
Vsync = 0;
/* Infinite loop */
while
(1)
{
uint32_t count;
uint16_t CMOS_Data;
// lcd_red();
delay_ms(1500);
if
( Vsync == 2 )
{
LCD_SetCursor(0, 319);
LCD_WriteRAM_Prepare();
/* Prepare to write GRAM */
FIFO_RRST_L();
FIFO_RCLK_L();
FIFO_RCLK_H();
FIFO_RRST_H();
FIFO_RCLK_L();
FIFO_RCLK_H();
for
( count = 0; count < 76800; count++ )
{
FIFO_RCLK_L();
CMOS_Data = (GPIOC->IDR<<8) & 0xff00;
/* ( GPIO_ReadInputData(GPIOC) << 8 ) & 0xff00; */
FIFO_RCLK_H();
FIFO_RCLK_L();
CMOS_Data |= (GPIOC->IDR) & 0x00ff;
/* ( GPIO_ReadInputData(GPIOC) ) & 0x00ff; */
FIFO_RCLK_H();
LCD_WriteRAM(CMOS_Data);
}
Vsync = 0;
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2014-04-08 6:11 PM
Yes, so the main loop bit bangs the clock output to get two byte pairs from the FIFO, and then send them to the LCD. You could perhaps optimize this loop in assembler, and perhaps optimize or inline the code to perform LCD_WriteRAM()
If you scope the RCLK pin it would allow you to quantify the transfer rate you are achieving currently.Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2014-04-08 6:53 PM
is it ok to overclock STM32F103 to 96 MHz ? I can see the picture already, I must fix the focus of the lense, but the picture changing is slow...any solutions for it ? thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2014-04-08 7:01 PM
Your bandwidth is limited by your choice of STM32 part, and the speed of the previously provided loop.
Look at the code generated for the loop, how the clock is pulled up/down, and how the LCD is written.Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2014-04-08 7:07 PM
Last result :
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2014-04-08 8:53 PM
Shall I put 10K pull up resistor on RESET pin on OV7670 ?
It's running but sometimes it's stopping and has blank screen, I need to reset the MCU.... thanks- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2014-04-09 3:35 AM
Is it possible for me to save the picture from the camera to sdcard with SDIO interface ? any ideas ? thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2014-04-09 4:45 AM
How can I do that ? quantify the transfer rate
Use a scope, and measure the periodicity of consecutive read-read-write iterations , by looking at the RCLK signal. To write to a SD card you'd need to read the image into a buffer (perhaps 512 byte, 1K or more, depending on what's available) at a time and then write that to a file and to the LCD, and getting the next block.Up vote any posts that you find helpful, it shows what's working..
