AnsweredAssumed Answered

STM32F103VCT6 as a CSI (camera) reader

Question asked by leighton.luke on Oct 14, 2013
Latest reply on Oct 15, 2013 by leighton.luke
hi i am in the middle of an R&D phase setting up a tablet where audio and camera will be controlled by an STM32F as a general-purpose peripheral (status is here:

before going for a 3rd revision of the PCB i'd very much appreciate some guidance on how to do this properly.  the original software i planned the schematics around does bit-banging in an ISR (

as the STM32F103VCT6 needs to do other tasks, 100% CPU load reading the camera data isn't acceptable!  so i have looked around and learned that it may be possible to read up to 6mhz of GPIO via DMA.  the problem i have is that it's an external pixel clock coming from the camera.

what i've done so far:

* confirmed with a scope that the camera runs (at 12mhz) by directing HSE to PA8 as a MCO
* confirmed that the camera is then contactable over I2C (it is)
* initialised it (successfully)
* asked it to set its Pixel Clock to 6mhz (also successful)

note here that whilst there is a master-clock in to the camera, the camera then has an *output* (called Pixel Clock) which, obviously, syncs the 8 (or 10) bits of data out.  there's also an HSYNC and a VSYNC output: these are also connected up to GPIO lines.

the next phase is, clearly, to read the data.  here is the plan that i believe is necessary:

* connect the camera's Pixel Clock line to e.g. PE0/TIM4_ETR
* set DMA2 to sync to TIM4
* set up DMA2 to do memory-to-memory transfer from PD8-15
* have EINT connect to the camera HSYNC line which starts DMA

the rest i can deal with (USB transfer of the data) but i wanted to get people's opinions on whether this looks like a viable plan.

i'm well aware that the STM32F207VCT6 already has DCMI but the project is cost-sensitive: although it would be nice to be capable of doing 720p24 using the STM32F207, we have to do 320x240 using a chip that's almost half the cost, first!

so - is there anything unreasonable about this plan to connect ETR to Timer to DMA to PD8-15 to USB? :)

thanks in advance for any guidance.