cancel
Showing results for 
Search instead for 
Did you mean: 

Interfacing 2 cameras with an STM32

ISeed
Senior

Hi!

I need to interface 2 VGA cameras with an STM32. The cameras are for snapshots only, so FPS and throughput are not issues, the only issues are:

  • physical interfacing
  • keeping up with received snapshot data
  • retaining the data before storage

There doesn't seem to be much public info on the subject, so I came here.

From what I understand, I have several options:

  1. get a camera that has a simple serial interface (SPI / UART), where I can just configure and ask for snapshots. No luck finding anything like that from a known vendor
  2. get a camera that has some DCMI interface, with 18 pins and somehow bitbang with them
  3. some MIPI camera, which I know nothing about.
  4. get 2 USB cameras and work with them using USB OTG with 2 STM32 hosts - one main and one secondary, who sends the snapshot to the main over UART.
  5. Some other option I'm not aware of?

I can't find a good solution for 1.

The 2nd one - bitbanging DCMI seems dirty and doable, however, getting into a long adventure only to discover it was a poor choice is not good. Ann example or recommendation would be appreciated.

The 3rd solution -are the good examples? is it viable with STM32?

The 4rd one seems to be the simplest to integrate physically, the cheapest and with the most market variation, but how difficult is it to use USB OTG with a USB camera, really?

So, an input from you guys would be much appreciated - how would you go about connecting 2 cameras to an STM32 (or a couple of them)?

Thanks!

8 REPLIES 8

Couldn't you just mux the input pins? Or route via a CPLD?

Also look at camera's with FIFO chip.

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

Do you need to have both active at the same time?

Otherwise, if it's an XOR, check the DCMI alternate pins on the datasheet.

If the DCMI exist in 2 sets of pins, you can just switch the active pins by SW.

Otherwise, if it's only to run pictures (not video) check for SPI cameras and longevity of the corresponding parts.

FIFO if cool, unforunately, didn't find a FIFO camera for a good price, my budget is 6$ per camera for mass production.

No, the cameras will work one at a time 🙂

Also, how would muxing help?

S.Ma
Principal

Then check the alternate function table to get duplicate DCMI pins. Then check which package are suitable (the pin table just before the alternate on the datasheet). You can dynamically change the DCMI pins by SW by changing MODER of the GPIO port registers. Do make the transition properly to avoid glitches or transients.

ISeed
Senior

Got it. Thanks! It's either that, or worst case, to get an MCU with enough pins.

What about data retention before saving to flash? I suppose it's either SRAM or a large enough RAM. Possible problem with SRAM is that it might be too slow to save, compared to the camera data rate. What are the standard solutions for this?

S.Ma
Principal

Only way to know more about camera would be to find a reference SW example from a Discovery or some related application notes. Not expert on camera here...