cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F2xx Interfacing CMOS Image Sensor

Nandish Jasani
Associate II
Posted on August 07, 2017 at 07:17

Hi,

   Good day,

   I an new in Image sensing technology.

   Is 2752 x 2004 pixels image sensor can interface with STM32F2xx?

   Waiting for reply.

  Thanks in Advance.

Nandish Jasani.

1 REPLY 1
megahercas6
Senior
Posted on August 07, 2017 at 13:34

You have DCMI for that.

Basic idea is you get VSYNC interrupt, you reset address, and configure DMA to transfer data from DCMI data register to memory ( internal or external), and DMA will increment it, and when you get HSYNC interrupt, you add address offset and increment line number , that's it

void VSYNC_Reset(void)

{

    VSYNC++;

    LINE=0;

    DMA_DeInit(DMA2_Stream1);

    DMA_DoubleBufferModeConfig(DMA2_Stream1, (uint32_t)SRAM_BANK_ADDR, DMA_Memory_0);

    DMA_DoubleBufferModeCmd(DMA2_Stream1, ENABLE);

    DMA_Init(DMA2_Stream1, &DMA_InitStructure);

    DMA_Cmd(DMA2_Stream1,ENABLE);

}

void EXTI4_IRQHandler(void)

{

  if ((EXTI->PR & EXTI_Line4) != (uint32_t)RESET)

  {

    GPIOB->BSRRL = 2;

    DMA2_Stream1->CR &= ~DMA_SxCR_EN;

    if((DMA2_Stream1->CR & DMA_SxCR_CT) != 1)

    {

      DMA2_Stream1->M0AR = SRAM_BANK_ADDR+(LINE*binning_addr);

    }

    else

    {

      DMA2_Stream1->M1AR = SRAM_BANK_ADDR+(LINE*binning_addr);

    }

    DMA2_Stream1->CR |= DMA_SxCR_EN;

    LINE++;

    EXTI->PR = EXTI_Line4;

    GPIOB->BSRRH = 2;

  }

}

This is a lot of data, what are you planing to do with this ? Also go for STM32F429, it has more power. (F7 or even better, H7 would be better, but you have to deal with HALL, and it sucks)

Also you will need SDRAM for that, since image is very large ! I use SRAM since my image is less than 2Mx16b