cancel
Showing results for 
Search instead for 
Did you mean: 

DCMI interface + camera module

khouja_houssem
Associate II
Posted on September 12, 2013 at 20:27

Hi,

I am trying to interface the OV5642 camera module with the STM32F4 microcontroller. 

So I wanted to ask about the XCLK signal in the camera, should it stay NC, or should I connect it to a clock (10Mhz to 24Mhz clock), or maybe I can generate that clock signal from the STM32F4 controller.

What do you suggest?
3 REPLIES 3
Posted on September 12, 2013 at 21:30

A cursory review of the

http://www.uctronics.com/download/cam_module/ov5642.zip

indicate you need to provide a clock. Something synchronous with the STM32F4 at 6-27 MHz would be fine.

You should be able to generate 24 MHz via an APB2 TIM from 168 MHz, perhaps also MCO2 via PLLI2S. You could get 8 MHz via MCO/HSE
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
michaelmccartyeng
Associate II
Posted on September 12, 2013 at 22:04

/**
* @brief Set PA8 Output SYSCLK/2.
* @param None
* @retval None
*/
void MCO1_Init(void)
{
GPIO_InitTypeDef GPIO_InitStructure;
RCC_ClockSecuritySystemCmd(ENABLE);
/* Enable GPIOs clocks */
RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOA, ENABLE);
GPIO_PinAFConfig(GPIOA, GPIO_PinSource8, GPIO_AF_MCO);
/* Configure MCO (PA8) */
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_8;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP; 
GPIO_Init(GPIOA, &GPIO_InitStructure);
RCC_MCO1Config(RCC_MCO1Source_PLLCLK, RCC_MCO1Div_3);
}

khouja_houssem
Associate II
Posted on September 13, 2013 at 22:27

Thanks again for your help!! ^^

So if I use the HSE clock as a source with RCC_MCO1Div_1, I will get 8Mhz.

Does it work that way I just want to make sure cause I don't have an oscilloscope to verify it.