cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F4-Discovery, DCMI interface, camera module OV5642

khouja_houssem
Associate II
Posted on September 03, 2013 at 17:02

Hi,

I'am starting a new project and I will need to interface the STM32F4 discovery with a camera module (OV5642) via DCMI interface. (I won't use an LCD module).

I will need a high resolution photo (>1024 pixel). I'am not sure if this is possible with the STM32F4.

I wanted to know if this is possible and if it is not what should I add as electronics to make it?
13 REPLIES 13
Posted on September 04, 2013 at 21:54

Whatever the resolution you'll need enough memory to store the incoming data.

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 05, 2013 at 04:18

The OV5652 does have jpeg. Try to calculate the largest jpg file of the size you want then see if that will actually fit in the stm32's memory. I'm using the F4 and I only have 192kb of ram. You need some ram for the rest of your variables and arrays and stuff.

High res jpg can easily get into the 1000's of kb so if you want to use the F4 you will either have to use a lower (really lower) resolution or setup another solution.

A good solution that I had never thought of was what the arducam does, it uses a 3MB fifo chip and pumps the camera data into that, then pumps it out of that into whatever it wants. These chips are pretty inexpensive and would let you have a high res img without using all your ram. check out the chip they use al4228 3m ''averlogic'' chip

best of luck to you, 

 its not a easy thing to do. If you gave me more info of your goal I might be able to help more. 

  

khouja_houssem
Associate II
Posted on September 05, 2013 at 10:21

Thank you mccarty.michael.

The project is about creating a laser measurement device using a laser pointer and a camera.

I will need to treat the picture captured to spot the laser dot and then determine the distance. So I will need fast access to the picture data (A flash memory or SD card is too slow).

I will need a 16MB external memory.To use that I will need 21 address signals. in the STM32F4-Discovery I only have access to 8 address pins which can't do the job.

Is there any other ST product where I can have access to more pins (like this one

http://www.haoyuelectronics.com/Attachment/HY-STM32F2xxCore144/HY-STM32F2xxCore144_UserManual.pdf

) but with ST-Link interface.

0690X0000060MntQAE.gif

michaelmccartyeng
Associate II
Posted on September 05, 2013 at 15:02

I cant remember where but I have seen systems that do this before (in hobby robotics). You dont really even need to save the image. The ''lazer'' dot will be the brightest pixels in the image. So you could literally just parse the data as it comes in and see where the brightest pixel is, then convert that into a distance and save that value. There is no need to store the image. 

There are several ''color following'' robots that do this. I saw one do it with the stm32F3 (search robot2 an arm based color tracking robot).

Timing would be very important, but you could simply save the ''last brightest pixel location'' in one variable. Then in the space between lines parse through the data received in the previous line and see if any of those pixels is ''brighter''. 

You would also be better off using raw YUV for this since the 'Y' portion is the ''brightness'' in one byte. Even if you get a compressed jpg you will have to uncompress it or convert it to find the laser (or display it). 

Again good luck ! This is one of the features i'm wanting to add to my robotics project, thats why i've thought of it and researched it a lot. 

Posted on September 06, 2013 at 01:23

16MB is going to be a problem, while one could of course bank SRAM parts, SDRAM is a more practical route. For that you'd need to be looking at

http://www.st.com/web/catalog/mmc/FM141/SC1169/SS1577/LN1806

type parts which haven't officially been released yet.

More likely, you might want something with more horsepower, with a faster processor and faster external busing and caching.

MarsBoard + USB Camera

http://www.hotmcu.com/marsboard-a10-dev-board-p-59.html

https://www.olimex.com/Products/OLinuXino/A13/A13-OLinuXino/
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
khouja_houssem
Associate II
Posted on September 06, 2013 at 14:26

Thank you for your suggestions. 

These controllers are too oversized for our project.

I didn't understand why 16MB SRAM won't work with the STM32F407VG. Can you please explain more.

@mccarthy: good idea. I will consider it, maybe I will try to do both solutions.
Posted on September 06, 2013 at 15:24

Cite the 16MB SRAM part you find, or do you mean 16 Mbit (2 MByte)

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
khouja_houssem
Associate II
Posted on September 06, 2013 at 16:01

No 16 mega bytes like this one: 

http://datasheets.maximintegrated.com/en/ds/DS1270W.pdf

I need 21 address pins to use it but I only have access to 8 address pins from the FSMC interface on the STM32F4-Discovery board. 

I hope I can find an other ST product in which I can have access to the 21 address pins needed and with the ST-Link interface, so I can program it easily.

Posted on September 06, 2013 at 16:20

That's a 2MB device, 2097152 bytes.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..